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
end
end
feature
set_page (a_page: like page)
@@ -73,4 +74,5 @@ feature
data: ITERABLE [G]
deferred
end
end

View File

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

View File

@@ -63,13 +63,13 @@ feature -- Implementation
render: STRING
local
attributes: STRING
attrs: STRING
do
attributes := "type=%"checkbox%""
attrs := "type=%"checkbox%""
if checked then
attributes := attributes + " checked"
attrs := attrs + " checked"
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
value: BOOLEAN

View File

@@ -17,24 +17,35 @@ create
feature
collapse: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]
nav: WSF_STATELESS_MULTI_CONTROL [WSF_STATELESS_CONTROL]
feature {NONE} -- Initialization
make_navbar (brand: STRING)
local
container: 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
make_multi_control
add_class ("navbar navbar-inverse navbar-fixed-top")
create container.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
add_control (header)
create nav.make_multi_control
container.add_class ("container")
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="container">
-- <div class="navbar-header">

View File

@@ -67,11 +67,11 @@ feature {WSF_PAGE_CONTROL, WSF_CONTROL} -- STATE MANAGEMENT
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
l_attributes: STRING
do
l_attributes := attributes
l_attributes := attrs
if not css_classes_string.is_empty then
l_attributes := l_attributes + " class=%"" + css_classes_string + "%""
end

View File

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

View File

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

View File

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