Menu management templates

This commit is contained in:
ryounes 2011-06-21 19:04:01 +00:00
parent bfb26e31ea
commit 79607581ed
4 changed files with 23 additions and 57 deletions

View file

@ -1,24 +0,0 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#-- Template for menu management page -->
<#import "lib-properties.ftl" as p>
<#list propertyGroups.all as group>
<#assign groupName = group.getName(nameForOtherGroup)>
<#-- Display the group heading -->
<#if groupName?has_content>
<h2 id="${groupName}">${groupName?capitalize}</h2>
</#if>
<#-- List the menu items(properties) in the group -->
<#list group.properties as property>
<#if property.localName == "hasElement">
<#-- List menu Items -->
<@p.objectProperty property editable property.template />
<br /><#--remove break-->
<@p.addLink property editable />
</#if>
</#list>
</#list>

View file

@ -75,11 +75,7 @@ Assumes property is non-null. -->
<#macro objectPropertyList property editable statements=property.statements template=property.template>
<#list statements as statement>
<#if property.localName == "hasElement">
<@menuItem property statement editable><#include "${template}"></@menuItem>
<#else>
<@propertyListItem property statement editable><#include "${template}"></@propertyListItem>
</#if>
</#list>
</#macro>
@ -96,14 +92,9 @@ name will be used as the label. -->
<#macro addLink property editable label="${property.name}" extraParams="">
<#if editable>
<#--@dump var="property"/-->
<#local url = property.addUrl>
<#if url?has_content>
<#if property.localName == "hasElement">
<@showAddMenuItemLink property.localName label addParamsToEditUrl(url, extraParams) />
<#else>
<@showAddLink property.localName label addParamsToEditUrl(url, extraParams) />
</#if>
<@showAddLink property.localName label addParamsToEditUrl(url, extraParams) />
</#if>
</#if>
</#macro>
@ -249,12 +240,3 @@ name will be used as the label. -->
<@editingLinks "label" label editable />
</#macro>
<#-- Add menu item button -->
<#macro showAddMenuItemLink propertyLocalName label url>
<a class="add-${propertyLocalName} green button" href="${url}" title="Add new ${label?lower_case} entry">Add menu item</a>
</#macro>
<#-- List menu items -->
<#macro menuItem property statement editable >
Position | <#nested> | <@editingLinks "${property.localName}" statement editable/> <br />
</#macro>