Small changes/fixes

This commit is contained in:
Severin Münger
2013-09-13 01:08:18 +02:00
parent 9c65194d91
commit f53974b138
8 changed files with 57 additions and 33 deletions

View File

@@ -40,6 +40,7 @@ feature --State
sort_direction := new_sort_direction.item sort_direction := new_sort_direction.item
end end
end end
feature feature
set_page (a_page: like page) set_page (a_page: like page)
@@ -73,4 +74,5 @@ feature
data: ITERABLE [G] data: ITERABLE [G]
deferred deferred
end end
end end

View File

@@ -6,8 +6,10 @@ note
class class
WSF_GRID_COLUMN WSF_GRID_COLUMN
create create
make_column make_column
feature {NONE} feature {NONE}
make_column (a_header, a_field: STRING) make_column (a_header, a_field: STRING)
@@ -16,6 +18,7 @@ feature {NONE}
field_name := a_field field_name := a_field
sorting_name := a_field sorting_name := a_field
end end
feature feature
header: STRING header: STRING

View File

@@ -63,13 +63,13 @@ feature -- Implementation
render: STRING render: STRING
local local
attributes: STRING attrs: STRING
do do
attributes := "type=%"checkbox%"" attrs := "type=%"checkbox%""
if checked then if checked then
attributes := attributes + " checked" attrs := attrs + " checked"
end end
Result := render_tag_with_tagname ("div", render_tag_with_tagname ("label", render_tag ("", attributes) + " " + label, "", ""), "", "checkbox") Result := render_tag_with_tagname ("div", render_tag_with_tagname ("label", render_tag ("", attrs) + " " + label, "", ""), "", "checkbox")
end end
value: BOOLEAN value: BOOLEAN

View File

@@ -17,24 +17,35 @@ create
feature feature
collapse: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL] collapse: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]
nav: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL] nav: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]
feature {NONE} -- Initialization feature {NONE} -- Initialization
make_navbar (brand: STRING) make_navbar (brand: STRING)
local local
container: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL] container: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]
header: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL] header: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]
collapse_button: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]
do do
make_multi_control make_multi_control
add_class ("navbar navbar-inverse navbar-fixed-top") add_class ("navbar navbar-inverse navbar-fixed-top")
create container.make_multi_control
create header.make_multi_control create header.make_multi_control
create nav.make_multi_control create collapse_button.make_with_tag_name ("button")
create collapse.make_multi_control create collapse.make_multi_control
add_control (header) create nav.make_multi_control
container.add_class ("container")
header.add_class ("navbar-header") header.add_class ("navbar-header")
collapse_button.add_class ("navbar-toggle")
collapse_button.set_attributes ("data-target=%".navbar-collapse%" data-toggle=%"collapse%" type=%"button%"")
collapse.add_class ("navbar-collapse")
collapse.add_control (nav)
container.add_control (header)
container.add_control (collapse)
add_control (container)
-- EXAMPLE NAVBAR USED AS REFERENCE
-- <div class="navbar navbar-inverse navbar-fixed-top"> -- <div class="navbar navbar-inverse navbar-fixed-top">
-- <div class="container"> -- <div class="container">
-- <div class="navbar-header"> -- <div class="navbar-header">

View File

@@ -67,11 +67,11 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
feature -- Rendering feature -- Rendering
render_tag_with_tagname (tag, body, attributes, css_classes_string: STRING): STRING render_tag_with_tagname (tag, body, attrs, css_classes_string: STRING): STRING
local local
l_attributes: STRING l_attributes: STRING
do do
l_attributes := attributes l_attributes := attrs
if not css_classes_string.is_empty then if not css_classes_string.is_empty then
l_attributes := l_attributes + " class=%"" + css_classes_string + "%"" l_attributes := l_attributes + " class=%"" + css_classes_string + "%""
end end

View File

@@ -69,6 +69,4 @@ feature
html: STRING html: STRING
end end

View File

@@ -13,6 +13,10 @@ feature
css_classes: LINKED_LIST [STRING] css_classes: LINKED_LIST [STRING]
--TODO: Maybe improve
attributes: detachable STRING
feature {NONE} feature {NONE}
make (a_tag_name: STRING) make (a_tag_name: STRING)
@@ -25,12 +29,17 @@ feature {NONE}
feature feature
set_attributes (a: STRING)
do
attributes := a
end
add_class (c: STRING) add_class (c: STRING)
do do
css_classes.extend (c) css_classes.extend (c)
end end
render_tag (body, attributes: STRING): STRING render_tag (body, attrs: STRING): STRING
local local
css_classes_string: STRING css_classes_string: STRING
do do
@@ -40,14 +49,14 @@ feature
loop loop
css_classes_string := css_classes_string + " " + c.item css_classes_string := css_classes_string + " " + c.item
end end
Result := render_tag_with_tagname (tag_name, body, attributes, css_classes_string) Result := render_tag_with_tagname (tag_name, body, attrs, css_classes_string)
end end
render_tag_with_tagname (tag, body, attributes, css_classes_string: STRING): STRING render_tag_with_tagname (tag, body, attrs, css_classes_string: STRING): STRING
local local
l_attributes: STRING l_attributes: STRING
do do
l_attributes := attributes l_attributes := attrs
if not css_classes_string.is_empty then if not css_classes_string.is_empty then
l_attributes := l_attributes + " class=%"" + css_classes_string + "%"" l_attributes := l_attributes + " class=%"" + css_classes_string + "%""
end end

View File

@@ -24,6 +24,7 @@
<cluster name="input" location=".\webcontrol\input\"/> <cluster name="input" location=".\webcontrol\input\"/>
<cluster name="grid" location=".\webcontrol\grid\"/> <cluster name="grid" location=".\webcontrol\grid\"/>
<cluster name="autocompletions" location=".\webcontrol\autocompletions\"/> <cluster name="autocompletions" location=".\webcontrol\autocompletions\"/>
<cluster name="navbar" location="\home\severin\Documents\EWF\EWF\library\server\wsf_html\webcontrol\navbar\"/>
</cluster> </cluster>
<cluster name="widget" location=".\widget\" recursive="true"/> <cluster name="widget" location=".\widget\" recursive="true"/>
</target> </target>