Fixing vitro namespace property edit hiding for blurb, description and citation. NIHVIVO-274

This commit is contained in:
bdc34 2010-04-05 17:26:14 +00:00
parent e31c551260
commit 103cf1ec18
2 changed files with 49 additions and 37 deletions

View file

@ -250,17 +250,19 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
<%-- Blurb --%> <%-- Blurb --%>
<c:if test="${showEdits || !empty entity.blurb}"> <c:if test="${showEdits || !empty entity.blurb}">
<div id="dprop-vitro-blurb" class="propsItem ${editingClass}"> <c:if test="${not empty entity.blurb }">
<c:if test="${not empty entity.blurb }">
<c:set var="editLinksForExistingBlurb"><edLnk:editLinks item="<%= VitroVocabulary.BLURB %>" data="${entity.blurb}" icons="false"/></c:set> <c:set var="editLinksForExistingBlurb"><edLnk:editLinks item="<%= VitroVocabulary.BLURB %>" data="${entity.blurb}" icons="false"/></c:set>
</c:if> </c:if>
<c:set var="editLinksForNewBlurb"><edLnk:editLinks item="<%= VitroVocabulary.BLURB %>" icons="false"/></c:set> <c:set var="editLinksForNewBlurb"><edLnk:editLinks item="<%= VitroVocabulary.BLURB %>" icons="false"/></c:set>
<c:if test="${showEdits || (( empty entity.blurb and not empty editLinksForNewBlurb) or ( not empty entity.blurb and not empty editLinksForExistingBlurb)) }"> <c:set var="mayEditBlurb" value="${showEdits && (( empty entity.blurb and not empty editLinksForNewBlurb) or ( not empty entity.blurb and not empty editLinksForExistingBlurb)) }"/>
<h3 class="propertyName">blurb</h3>
${editLinksForNewBlurb} <c:if test="${ mayEditBlurb || ! empty entity.blurb }">
</c:if> <div id="dprop-vitro-blurb" class="propsItem ${editingClass}">
<c:if test="${!empty entity.blurb}"> <h3 class="propertyName">blurb</h3> ${editLinksForNewBlurb}
</c:if>
<c:if test="${!empty entity.blurb}">
<div class="datatypeProperties"> <div class="datatypeProperties">
<div class="datatypePropertyValue"> <div class="datatypePropertyValue">
<div class="statementWrap"> <div class="statementWrap">
@ -271,35 +273,40 @@ if (VitroRequestPrep.isSelfEditing(request) || LoginFormBean.loggedIn(request, L
</div> </div>
</div> </div>
</div> </div>
</c:if> </c:if>
</div> <c:if test="${ mayEditBlurb || ! empty entity.blurb }">
</div>
</c:if>
</c:if> </c:if>
<%-- Description --%> <%-- Description --%>
<c:if test="${ showEdits || !empty entity.description}"> <c:if test="${ showEdits || !empty entity.description}">
<div id="dprop-vitro-description" class="propsItem ${editingClass}">
<c:if test="${not empty entity.description }"> <c:if test="${not empty entity.description }">
<c:set var="editLinksForExisitngDesc"><edLnk:editLinks item="<%= VitroVocabulary.DESCRIPTION %>" data="${entity.description}" icons="false"/></c:set> <c:set var="editLinksForExisitngDesc"><edLnk:editLinks item="<%= VitroVocabulary.DESCRIPTION %>" data="${entity.description}" icons="false"/></c:set>
</c:if> </c:if>
<c:set var="editLinksForNewDesc"><edLnk:editLinks item="<%= VitroVocabulary.DESCRIPTION %>" icons="false"/></c:set> <c:set var="editLinksForNewDesc"><edLnk:editLinks item="<%= VitroVocabulary.DESCRIPTION %>" icons="false"/></c:set>
<c:set var="mayEditDesc" value="${showEdits && ((empty entity.description and not empty editLinksForNewDesc) or (not empty entity.description and not empty editLinksForExisitngDesc))}"/>
<c:if test="${showEdits || ((empty entity.description and not empty editLinksForNewDesc) or (not empty entity.description and not empty editLinksForExisitngDesc))}">
<h3 class="propertyName">description</h3> <c:if test="${mayEditDesc || ! empty entity.description }">
${editLinksForNewDesc} <div id="dprop-vitro-description" class="propsItem ${editingClass}">
</c:if> <h3 class="propertyName">description</h3> ${editLinksForNewDesc}
<c:if test="${!empty entity.description}"> </c:if>
<div class="datatypeProperties">
<div class="datatypePropertyValue"> <c:if test="${!empty entity.description}">
<div class="statementWrap"> <div class="datatypeProperties">
<div class="description"><p:process>${entity.description}</p:process></div> <div class="datatypePropertyValue">
<c:if test="${showEdits && !empty editLinksForExisitngDesc}"> <div class="statementWrap">
<span class="editLinks">${editLinksForExisitngDesc}</span> <div class="description"><p:process>${entity.description}</p:process></div>
</c:if> <c:if test="${showEdits && !empty editLinksForExisitngDesc}">
</div> <span class="editLinks">${editLinksForExisitngDesc}</span>
</div> </c:if>
</div> </div>
</c:if> </div>
</div> </div>
</c:if>
<c:if test="${mayEditDesc || ! empty entity.description }">
</div>
</c:if>
</c:if> </c:if>

View file

@ -5,15 +5,18 @@
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<c:if test="${showEdits || !empty entity.citation}"> <c:if test="${showEdits || !empty entity.citation}">
<div id="dprop-vitro-citation" class="propsItem ${editingClass}">
<c:if test="${not empty entity.citation }"> <c:if test="${not empty entity.citation }">
<c:set var="editLinksForExisting"><edLnk:editLinks item="<%= VitroVocabulary.CITATION %>" data="${entity.citation}" icons="false"/></c:set> <c:set var="editLinksForExisting"><edLnk:editLinks item="<%= VitroVocabulary.CITATION %>" data="${entity.citation}" icons="false"/></c:set>
</c:if> </c:if>
<c:set var="editLinksForNew"><edLnk:editLinks item="<%= VitroVocabulary.CITATION %>" icons="false"/></c:set> <c:set var="editLinksForNew"><edLnk:editLinks item="<%= VitroVocabulary.CITATION %>" icons="false"/></c:set>
<c:if test="${showEdits or (( empty entity.citation and !empty editLinksForNew) or ( ! empty entity.citation and !empty editLinksForExisting)) }"> <c:set var="mayEditCitation" value="${showEdits and (( empty entity.citation and !empty editLinksForNew) or ( ! empty entity.citation and !empty editLinksForExisting)) }"/>
<h3 class="propertyName">citation</h3>
${editLinksForNew} <c:if test="${ !empty entity.citation || mayEditCitation }">
<div id="dprop-vitro-citation" class="propsItem ${editingClass}">
<h3 class="propertyName">citation</h3> ${editLinksForNew}
</c:if> </c:if>
<c:if test="${!empty entity.citation}"> <c:if test="${!empty entity.citation}">
<div class="datatypeProperties"> <div class="datatypeProperties">
<div class="datatypePropertyValue"> <div class="datatypePropertyValue">
@ -26,5 +29,7 @@
</div> </div>
</div> </div>
</c:if> </c:if>
</div> <c:if test="${ !empty entity.citation || mayEditCitation }">
</div>
</c:if>
</c:if> </c:if>