diff --git a/cms/src/kernel/link/cms_menu_system.e b/cms/src/kernel/link/cms_menu_system.e index 15978bd..81948f5 100644 --- a/cms/src/kernel/link/cms_menu_system.e +++ b/cms/src/kernel/link/cms_menu_system.e @@ -20,10 +20,10 @@ feature {NONE} -- Initialization do to_implement ("Refactor, take the info from a Database or Configuration file.") create items.make (5) - force (create {CMS_MENU}.make ("main-menu", 3)) - force (create {CMS_MENU}.make_with_title ("management", "Management", 3)) - force (create {CMS_MENU}.make_with_title ("navigation", "Navigation", 3)) - force (create {CMS_MENU}.make_with_title ("user", "User", 3)) + force (create {CMS_MENU}.make ("main-menu", 3)) -- primary menu + force (create {CMS_MENU}.make_with_title ("management", "Management", 3)) -- secondary in admin view. + force (create {CMS_MENU}.make_with_title ("navigation", "Navigation", 3)) -- secondary + force (create {CMS_MENU}.make_with_title ("user", "User", 3)) -- first_side_bar end feature -- Access diff --git a/cms/src/modules/node/node_module.e b/cms/src/modules/node/node_module.e index e1e59a5..25b47c3 100644 --- a/cms/src/modules/node/node_module.e +++ b/cms/src/modules/node/node_module.e @@ -153,7 +153,7 @@ feature -- Hooks perms: detachable ARRAYED_LIST [READABLE_STRING_8] do create lnk.make ("List of nodes", "/nodes") - a_menu_system.main_menu.extend (lnk) + a_menu_system.navigation_menu.extend (lnk) end end diff --git a/cms/src/service/response/cms_response.e b/cms/src/service/response/cms_response.e index 8927719..e78930f 100644 --- a/cms/src/service/response/cms_response.e +++ b/cms/src/service/response/cms_response.e @@ -201,6 +201,29 @@ feature -- Blocks l_region.extend (b) end + + set_blocks (a_page: CMS_HTML_PAGE) + -- Set blocks to the current `a_page' + do + debug + fixme ("Experimental code") + end + -- top_header_block + set_header_block (a_page) + + end + + + set_header_block (a_page: CMS_HTML_PAGE) + do + if not main_menu.is_empty then + a_page.register_variable (main_menu, "primary_nav") + end + if not navigation_menu.is_empty then + a_page.register_variable (navigation_menu, "secondary_nav") + end + end + get_blocks do fixme ("find a way to have this in configuration or database, and allow different order") @@ -312,7 +335,7 @@ feature -- Blocks l_hb.append ("[ - + ]") end @@ -616,18 +639,19 @@ feature -- Generation call_menu_alter_hooks (menu_system) prepare_menu_system (menu_system) - get_blocks - across - regions as reg_ic - loop - across - reg_ic.item.blocks as ic - loop - if attached {CMS_MENU_BLOCK} ic.item as l_menu_block then - recursive_get_active (l_menu_block.menu, request) - end - end - end + set_blocks (page) +-- get_blocks +-- across +-- regions as reg_ic +-- loop +-- across +-- reg_ic.item.blocks as ic +-- loop +-- if attached {CMS_MENU_BLOCK} ic.item as l_menu_block then +-- recursive_get_active (l_menu_block.menu, request) +-- end +-- end +-- end if attached title as l_title then page.set_title (l_title) @@ -635,16 +659,16 @@ feature -- Generation page.set_title ("CMS::" + request.path_info) end - -- blocks - across - regions as reg_ic - loop - across - reg_ic.item.blocks as ic - loop - page.add_to_region (theme.block_html (ic.item), reg_ic.item.name) - end - end +-- -- blocks +-- across +-- regions as reg_ic +-- loop +-- across +-- reg_ic.item.blocks as ic +-- loop +-- page.add_to_region (theme.block_html (ic.item), reg_ic.item.name) +-- end +-- end end common_prepare (page: CMS_HTML_PAGE) diff --git a/cms/src/theme/smarty_theme/smarty_cms_theme.e b/cms/src/theme/smarty_theme/smarty_cms_theme.e index 39ea5df..1eb14f1 100644 --- a/cms/src/theme/smarty_theme/smarty_cms_theme.e +++ b/cms/src/theme/smarty_theme/smarty_cms_theme.e @@ -88,7 +88,7 @@ feature -- Conversion to_implement ("Maybe we need a SMARTY_CMS_REGION_TEMPLATE") to_implement ("Provide a default Menu using HTML hardcoded, maybe using the Default or providing a default implementation in CMS_THEME.menu_html") -- Use the similar pattern to SMARTY_CMS_PAGE_TEMPLATE, with a different prepare - -- feature. + -- feature create tpl.make ("tpl/menu", Current) create l_page.make l_page.register_variable (a_menu, "menu") diff --git a/examples/roc_api/site/www/template/html/layout2.tpl b/examples/roc_api/site/www/template/html/layout2.tpl deleted file mode 100644 index 34a5659..0000000 --- a/examples/roc_api/site/www/template/html/layout2.tpl +++ /dev/null @@ -1,40 +0,0 @@ - - - - {include file="master2/head.tpl"/} - - - - - {include file="master2/site_navigation.tpl"/} - - - -
-
-
-
- {include file="master2/content.tpl"/} -
-
-
- - - - {if condition="$web"} - {include file="master2/optional_enhancement_js.tpl"/} - {/if} - - {if condition="$html"} - {include file="master2/optional_enhancement_js.tpl"/} - {/if} - - - - \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/master2/content.tpl b/examples/roc_api/site/www/template/html/master2/content.tpl deleted file mode 100644 index b18c5dd..0000000 --- a/examples/roc_api/site/www/template/html/master2/content.tpl +++ /dev/null @@ -1,11 +0,0 @@ - -
-

Top most recent nodes


- - - {foreach from="$nodes" item="item"} - - {/foreach} -
diff --git a/examples/roc_api/site/www/template/html/master2/error.tpl b/examples/roc_api/site/www/template/html/master2/error.tpl deleted file mode 100644 index 0ca7ad0..0000000 --- a/examples/roc_api/site/www/template/html/master2/error.tpl +++ /dev/null @@ -1,18 +0,0 @@ -

Error: {$code/}

- -{assign name="status400" value="400"/} -{assign name="status404" value="404"/} -{assign name="status500" value="500"/} - -{if condition="$code ~ $status500"} -

Internal server error, for the request {$request/}

-{/if} - - -{if condition="$code ~ $status404"} -

Resourse not found, for the request {$request/}

-{/if} - -{if condition="$code ~ $status400"} -

Bad request, the request {$request/} is not valid

-{/if} \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/master2/footer.tpl b/examples/roc_api/site/www/template/html/master2/footer.tpl deleted file mode 100644 index 11fe183..0000000 --- a/examples/roc_api/site/www/template/html/master2/footer.tpl +++ /dev/null @@ -1,7 +0,0 @@ - -
-

API Documentation     - Questions? Comments? Let us know!

-

© Copyright 2014 Eiffel Software -- Privacy Policy -

-
\ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/master2/head.tpl b/examples/roc_api/site/www/template/html/master2/head.tpl deleted file mode 100644 index 4ba4616..0000000 --- a/examples/roc_api/site/www/template/html/master2/head.tpl +++ /dev/null @@ -1,10 +0,0 @@ - - -Eiffel RESTonCMS -{if condition="$web"} - {include file="master2/optional_styling_css.tpl"/} -{/if} -{if condition="$html"} - {include file="master2/optional_styling_css.tpl"/} -{/if} - diff --git a/examples/roc_api/site/www/template/html/master2/header.tpl b/examples/roc_api/site/www/template/html/master2/header.tpl deleted file mode 100644 index ce8ec71..0000000 --- a/examples/roc_api/site/www/template/html/master2/header.tpl +++ /dev/null @@ -1,2 +0,0 @@ -

RESTonCMS

-

Tagline

\ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/master2/logoff.tpl b/examples/roc_api/site/www/template/html/master2/logoff.tpl deleted file mode 100644 index 8139dc7..0000000 --- a/examples/roc_api/site/www/template/html/master2/logoff.tpl +++ /dev/null @@ -1,5 +0,0 @@ -

You have successfully signed out

- -You may want to return - -Press this neat little button:Take Me Home diff --git a/examples/roc_api/site/www/template/html/master2/main_navigation.tpl b/examples/roc_api/site/www/template/html/master2/main_navigation.tpl deleted file mode 100644 index 88365d7..0000000 --- a/examples/roc_api/site/www/template/html/master2/main_navigation.tpl +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/master2/optional_enhancement_js.tpl b/examples/roc_api/site/www/template/html/master2/optional_enhancement_js.tpl deleted file mode 100644 index 1353b83..0000000 --- a/examples/roc_api/site/www/template/html/master2/optional_enhancement_js.tpl +++ /dev/null @@ -1,5 +0,0 @@ - - -{if condition="$web"} - -{/if} \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/master2/optional_styling_css.tpl b/examples/roc_api/site/www/template/html/master2/optional_styling_css.tpl deleted file mode 100644 index f56d770..0000000 --- a/examples/roc_api/site/www/template/html/master2/optional_styling_css.tpl +++ /dev/null @@ -1,9 +0,0 @@ -{if condition="$html"} - - - -{/if} -{if condition="$web"} - - -{/if} diff --git a/examples/roc_api/site/www/template/html/master2/site_navigation.tpl b/examples/roc_api/site/www/template/html/master2/site_navigation.tpl deleted file mode 100644 index a75760c..0000000 --- a/examples/roc_api/site/www/template/html/master2/site_navigation.tpl +++ /dev/null @@ -1,27 +0,0 @@ - - - - \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/modules/navigation.tpl b/examples/roc_api/site/www/template/html/modules/navigation.tpl deleted file mode 100644 index ee2d15e..0000000 --- a/examples/roc_api/site/www/template/html/modules/navigation.tpl +++ /dev/null @@ -1,8 +0,0 @@ -{if isset="$user"} - Logoff -{/if} -{unless isset="$user"} - Login - Register -{/unless} -List of Nodes diff --git a/examples/roc_api/site/www/template/html/modules/node.tpl b/examples/roc_api/site/www/template/html/modules/node.tpl deleted file mode 100644 index 0f6173f..0000000 --- a/examples/roc_api/site/www/template/html/modules/node.tpl +++ /dev/null @@ -1,174 +0,0 @@ -{if condition="html"} - - - - {include file="master2/head.tpl"/} - - -{/if} - -{unless condition="$web"} - - {include file="master2/site_navigation.tpl"/} -{/unless} - - -{if condition="html"} - -
-
-
-
-{/if} - - -
- {if condition="$web"} - - {/if} - {if condition="$html"} - - {/if} -
-
- {if isset="$node"} -
-
-
-
-

{$node.title/}

-
-
-
{$node.content/}
-
-
-
- {/if} -
- -
- {if isset="$user"} -
-
-
- {if isset="$node"} - -
- {/if} -
-
-
- {if isset="$user"} -
-
- - {if isset="$node"} -
- -
- Delete Node - -
- -
-
-
- {/if} -
- {/if} -
-
-
- -{if condition="html"} -
-
-
-{/if} - - -{if condition="html"} - - - - {include file="master2/optional_enhancement_js.tpl"/} - - - -{/if} \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/modules/node_content.tpl b/examples/roc_api/site/www/template/html/modules/node_content.tpl deleted file mode 100644 index 4825500..0000000 --- a/examples/roc_api/site/www/template/html/modules/node_content.tpl +++ /dev/null @@ -1,70 +0,0 @@ -{if condition="html"} - - - - {include file="master2/head.tpl"/} - - -{/if} - -{unless condition="$web"} - - {include file="master2/site_navigation.tpl"/} -{/unless} - -{if condition="html"} - -
-
-
-
-{/if} - - -
-
-
- -
- Edit Node Content - -
-
- -
-
- -
-
- -
- -
-
-
-
-
-{if condition="html"} - -
-
-
-{/if} - - -{if condition="html"} - - - - {include file="master2/optional_enhancement_js.tpl"/} - - - -{/if} \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/modules/node_summary.tpl b/examples/roc_api/site/www/template/html/modules/node_summary.tpl deleted file mode 100644 index 24f69e6..0000000 --- a/examples/roc_api/site/www/template/html/modules/node_summary.tpl +++ /dev/null @@ -1,71 +0,0 @@ -{if condition="html"} - - - - {include file="master2/head.tpl"/} - - -{/if} - - - {unless condition="$web"} - - {include file="master2/site_navigation.tpl"/} - {/unless} - -{if condition="html"} - -
-
-
-
-{/if} - -
-
-
- -
- Edit Node Summary - -
-
- -
-
- -
-
- -
- -
-
-
-
-
- -{if condition="html"} - -
-
-
-{/if} - - -{if condition="html"} - - - - {include file="master2/optional_enhancement_js.tpl"/} - - - -{/if} \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/modules/node_title.tpl b/examples/roc_api/site/www/template/html/modules/node_title.tpl deleted file mode 100644 index 2e02d02..0000000 --- a/examples/roc_api/site/www/template/html/modules/node_title.tpl +++ /dev/null @@ -1,70 +0,0 @@ -{if condition="html"} - - - - {include file="master2/head.tpl"/} - - -{/if} - - {unless condition="$web"} - - {include file="master2/site_navigation.tpl"/} - {/unless} - - -{if condition="html"} - -
-
-
-
-{/if} - -
-
-
- -
- Edit Node Title - -
-
- -
-
- -
-
- -
- -
-
-
-
-
-{if condition="html"} - -
-
-
-{/if} - - -{if condition="html"} - - - - {include file="master2/optional_enhancement_js.tpl"/} - - - -{/if} \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/modules/nodes.tpl b/examples/roc_api/site/www/template/html/modules/nodes.tpl deleted file mode 100644 index 23b24c7..0000000 --- a/examples/roc_api/site/www/template/html/modules/nodes.tpl +++ /dev/null @@ -1,52 +0,0 @@ -{if condition="html"} - - - - {include file="master2/head.tpl"/} - - -{/if} - -{unless condition="$web"} - - {include file="master2/site_navigation.tpl"/} -{/unless} - -{if condition="html"} - -
-
-
-
-{/if} -
-

List nodes


- - - {foreach from="$nodes" item="item"} - - {/foreach} -
- -{if condition="html"} -
-
-
-{/if} - - -{if condition="html"} - - - - {include file="master2/optional_enhancement_js.tpl"/} - - - -{/if} \ No newline at end of file diff --git a/examples/roc_api/site/www/template/html/modules/register.tpl b/examples/roc_api/site/www/template/html/modules/register.tpl deleted file mode 100644 index 3a14667..0000000 --- a/examples/roc_api/site/www/template/html/modules/register.tpl +++ /dev/null @@ -1,100 +0,0 @@ -{if condition="html"} - - - - {include file="master2/head.tpl"/} - - -{/if} - - -{unless condition="$web"} - - {include file="master2/site_navigation.tpl"/} -{/unless} - -{if condition="html"} - -
-
-
-
-{/if} - - -
-
-
-
- Register -
-

Register new user

-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
- s
- -
- -
-
-
-
-
- -{if condition="html"} -
-
-
-{/if} - - -{if condition="html"} - - - - {include file="master2/optional_enhancement_js.tpl"/} - - - -{/if} \ No newline at end of file diff --git a/examples/roc_api/site/www/themes/bootstrap/layout.tpl b/examples/roc_api/site/www/themes/bootstrap/layout.tpl deleted file mode 100644 index c2ed53f..0000000 --- a/examples/roc_api/site/www/themes/bootstrap/layout.tpl +++ /dev/null @@ -1,64 +0,0 @@ - - - - - ROC- Layout with defualt Regions - - - - - - - - -ROC CMS - A responsive layout - - - - {include file="tpl/page_top.tpl"/} - - -
- - - {include file="tpl/page_header.tpl"/} - - -
- - - - {include file="tpl/left_sidebar.tpl"/} - - -
- - {include file="tpl/highlighted_section.tpl"/} - - - - {include file="tpl/help_section.tpl"/} - - - - {include file="tpl/main_content.tpl"/} -
- - - {include file="tpl/right_sidebar.tpl"/} -
-
- - - {include file="tpl/page_footer.tpl"/} - - - {include file="tpl/page_bottom.tpl"/} - - - - diff --git a/examples/roc_api/site/www/themes/bootstrap/page.tpl b/examples/roc_api/site/www/themes/bootstrap/page.tpl index 8ee484d..7f32495 100644 --- a/examples/roc_api/site/www/themes/bootstrap/page.tpl +++ b/examples/roc_api/site/www/themes/bootstrap/page.tpl @@ -4,12 +4,20 @@ ROC- Layout with defualt Regions - + + + + + + + + + + - @@ -17,13 +25,16 @@ - {$region_top/} - + {if isset="$top"} + {$region_top/} + {/if}
- {$region_header/} +
diff --git a/examples/roc_api/site/www/themes/bootstrap/roc_template -2.html b/examples/roc_api/site/www/themes/bootstrap/roc_template -2.html new file mode 100644 index 0000000..17b8074 --- /dev/null +++ b/examples/roc_api/site/www/themes/bootstrap/roc_template -2.html @@ -0,0 +1,108 @@ + + + + + ROC- Layout with defualt Regions + + + + + + + + +ROC CMS - A responsive layout + + + + +
+

ROC Layout with Defaul Regions

+ + + +
+ + + + + + + +
+

Highlighted Section

+

Help Section

+ +

Main Content Section

+

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil imperdiet doming id quod mazim placerat facer possim assum.

+ +

Typi non habent claritatem insitam; est usus legentis in iis qui facit eorum claritatem. Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant sollemnes in futurum.

+
+ + + +
+
+ + + + + + + + + diff --git a/examples/roc_api/site/www/themes/bootstrap/roc_template.html b/examples/roc_api/site/www/themes/bootstrap/roc_template.html index 83d6149..1472f38 100644 --- a/examples/roc_api/site/www/themes/bootstrap/roc_template.html +++ b/examples/roc_api/site/www/themes/bootstrap/roc_template.html @@ -4,12 +4,20 @@ ROC- Layout with defualt Regions - + + + + + + + + + + - @@ -18,33 +26,72 @@ -
-

ROC Layout with Defaul Regions

-