NIHVIVO-2232. Worked on menu management main page. Work in progress.

This commit is contained in:
manolobevia 2011-06-17 17:34:06 +00:00
parent 86a22b397d
commit 7cd7e7f8a6
3 changed files with 78 additions and 2 deletions

View file

@ -0,0 +1,24 @@
<#-- $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,7 +75,11 @@ Assumes property is non-null. -->
<#macro objectPropertyList property editable statements=property.statements template=property.template>
<#list statements as statement>
<@propertyListItem property statement editable><#include "${template}"></@propertyListItem>
<#if property.localName == "hasElement">
<@menuItem property statement editable><#include "${template}"></@menuItem>
<#else>
<@propertyListItem property statement editable><#include "${template}"></@propertyListItem>
</#if>
</#list>
</#macro>
@ -95,7 +99,11 @@ name will be used as the label. -->
<#--@dump var="property"/-->
<#local url = property.addUrl>
<#if url?has_content>
<@showAddLink property.localName label addParamsToEditUrl(url, extraParams) />
<#if property.localName == "hasElement">
<@showAddMenuItemLink property.localName label addParamsToEditUrl(url, extraParams) />
<#else>
<@showAddLink property.localName label addParamsToEditUrl(url, extraParams) />
</#if>
</#if>
</#if>
</#macro>
@ -241,4 +249,12 @@ 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>