Merge r1133 from http://svn.mannlib.cornell.edu/svn/vivo/branches/rel-1.1-maint
This commit is contained in:
parent
7ce437e5bc
commit
7f27c12fce
3 changed files with 36 additions and 31 deletions
|
@ -58,9 +58,6 @@ This is intended to create a set of statements like:
|
|||
<c:set var="rdf" value="<%= VitroVocabulary.RDF %>" />
|
||||
<c:set var="label" value="${rdfs}label" />
|
||||
|
||||
<%-- grantLabel is required if we are doing an update --%>
|
||||
<c:set var="labelRequired" ><%= request.getAttribute("objectUri")== null?"":"\"nonempty\"," %></c:set>
|
||||
|
||||
<% // set role type based on predicate
|
||||
String subjectName = ((Individual) request.getAttribute("subject")).getName();
|
||||
if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvestigatorRole") ) { %>
|
||||
|
@ -77,6 +74,22 @@ if ( ((String)request.getAttribute("predicateUri")).endsWith("hasPrincipalInvest
|
|||
<c:set var="formHeading">investigator entry for <%= subjectName %></c:set>
|
||||
<% } %>
|
||||
|
||||
<c:choose>
|
||||
<c:when test="<%= request.getAttribute(\"objectUri\")!=null %>">
|
||||
<c:set var="formHeading" value="Edit ${formHeading}" />
|
||||
<c:set var="editMode" value="edit" />
|
||||
<c:set var="submitButtonLabel" value="Edit ${submitButtonLabel}" />
|
||||
<c:set var="labelRequired" value="" />
|
||||
<c:set var="disabledVal" value="disabled" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:set var="formHeading" value="Create a new ${formHeading}" />
|
||||
<c:set var="editMode" value="add" />
|
||||
<c:set var="labelRequired" value="\"nonempty\"," />
|
||||
<c:set var="disabledVal" value="" />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
<c:set var="startYearUri" value="${vivoCore}startYear" />
|
||||
<v:jsonset var="startYearAssertion" >
|
||||
?role <${startYearUri}> ?startYear .
|
||||
|
@ -264,18 +277,6 @@ PREFIX core: <${vivoCore}>
|
|||
<c:set var="requiredHint" value="<span class='requiredHint'> *</span>" />
|
||||
<c:set var="yearHint" value="<span class='hint'>(YYYY)</span>" />
|
||||
|
||||
<c:choose>
|
||||
<c:when test="<%= request.getAttribute(\"objectUri\")!=null %>">
|
||||
<c:set var="formHeading" value="Edit ${formHeading}" />
|
||||
<c:set var="editMode" value="edit" />
|
||||
<c:set var="submitButtonLabel" value="Edit ${submitButtonLabel}" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:set var="formHeading" value="Create a new ${formHeading}" />
|
||||
<c:set var="editMode" value="add" />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
<jsp:include page="${preForm}" />
|
||||
|
||||
<h2>${formHeading}</h2>
|
||||
|
@ -285,7 +286,13 @@ PREFIX core: <${vivoCore}>
|
|||
<%-- DO NOT CHANGE IDS, CLASSES, OR HTML STRUCTURE IN THIS FORM WITHOUT UNDERSTANDING THE IMPACT ON THE JAVASCRIPT! --%>
|
||||
<form id="addGrantRoleToPerson" class="noIE67" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
|
||||
|
||||
<p><v:input type="text" id="relatedIndLabel" name="grantLabel" label="Name ${requiredHint}" cssClass="acSelector" size="50" /></p>
|
||||
<p><v:input type="text" id="relatedIndLabel" name="grantLabel" label="Name ${requiredHint}" cssClass="acSelector" size="50" disabled="${disabledVal}" /></p>
|
||||
|
||||
<%-- Store this value in a hidden field, because the displayed field is disabled and don't submit. This ensures that when
|
||||
returning from a validation error, we retain the value. --%>
|
||||
<c:if test="${editMode == 'edit'}">
|
||||
<v:input type="hidden" id="grantLabel" />
|
||||
</c:if>
|
||||
|
||||
<div class="acSelection">
|
||||
<p class="inline"><label>Selected Grant:</label><span class="acSelectionInfo"></span><a href="<c:url value="/individual?uri=" />" class="verifyMatch">(Verify this match)</a></p>
|
||||
|
|
|
@ -149,7 +149,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
|
|||
|
||||
<%-- label and type required if we are doing an add or a repair, but not an edit --%>
|
||||
<c:set var="labelRequired" ><%= (mode == 1 || mode == 3) ?"\"nonempty\"," : "" %></c:set>
|
||||
<c:set var="typeRequired" ><%= (mode == 1 || mode == 3) ?"\"nonempty\"," : "" %></c:set>
|
||||
<c:set var="typeRequired" ><%= (mode == 1 || mode == 3) ?"\"nonempty\"" : "" %></c:set>
|
||||
|
||||
<%--
|
||||
<c:choose>
|
||||
|
@ -259,7 +259,7 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
|
|||
"urisInScope" : { "inverseRolePredicate" : "${inversePredicate}" },
|
||||
"literalsInScope": { },
|
||||
"urisOnForm" : [ "roleActivity", "roleActivityType" ],
|
||||
"literalsOnForm" : [ "activityLabel", "roleLabel", "startYear", "endYear", "existingActivityLabel" ],
|
||||
"literalsOnForm" : [ "activityLabel", "roleLabel", "startYear", "endYear" ],
|
||||
"filesOnForm" : [ ],
|
||||
"sparqlForLiterals" : { },
|
||||
"sparqlForUris" : { },
|
||||
|
@ -377,11 +377,13 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
|
|||
<c:when test="<%= request.getAttribute(\"objectUri\")!=null %>">
|
||||
<c:set var="titleText" value="Edit" />
|
||||
<c:set var="submitButtonText" value="Edit ${buttonLabel}" />
|
||||
<c:set var="disabledVal" value="disabled" />
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<c:set var="titleText" value="Create a new" />
|
||||
<c:set var="editMode" value="add" />
|
||||
<c:set var="submitButtonText" value="${buttonLabel}" />
|
||||
<c:set var="disabledVal" value="" />
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
|
||||
|
@ -393,15 +395,21 @@ public static Log log = LogFactory.getLog("edu.cornell.mannlib.vitro.webapp.jsp.
|
|||
<% }else{ %>
|
||||
|
||||
<h2>${titleText} ${roleActivityTypeLabel} entry for <%= subjectName %></h2>
|
||||
|
||||
<%-- DO NOT CHANGE IDS, CLASSES, OR HTML STRUCTURE IN THIS FORM WITHOUT UNDERSTANDING THE IMPACT ON THE JAVASCRIPT! --%>
|
||||
<form id="addRoleForm" action="<c:url value="/edit/processRdfForm2.jsp"/>" >
|
||||
|
||||
<p class="inline"><v:input type="select" label="${roleActivityTitleCase} Type ${requiredHint}" name="roleActivityType" id="typeSelector" /></p>
|
||||
<p class="inline"><v:input type="select" label="${roleActivityTitleCase} Type ${requiredHint}" name="roleActivityType" disabled="${disabledVal}" id="typeSelector" /></p>
|
||||
|
||||
<div class="fullViewOnly">
|
||||
|
||||
<p><v:input type="text" id="relatedIndLabel" name="activityLabel" label="Name ${requiredHint}" cssClass="acSelector" size="50" /></p>
|
||||
<p><v:input type="text" id="relatedIndLabel" name="activityLabel" label="Name ${requiredHint}" cssClass="acSelector" disabled="${disabledVal}" size="50" /></p>
|
||||
|
||||
<%-- Store these values in hidden fields, because the displayed fields are disabled and don't submit. This ensures that when
|
||||
returning from a validation error, we retain the values. --%>
|
||||
<c:if test="${editMode == 'edit'}">
|
||||
<v:input type="hidden" id="roleActivityType" />
|
||||
<v:input type="hidden" id="activityLabel" />
|
||||
</c:if>
|
||||
|
||||
<div class="acSelection">
|
||||
<%-- RY maybe make this a label and input field. See what looks best. --%>
|
||||
|
|
|
@ -137,10 +137,6 @@ var customForm = {
|
|||
|
||||
initFormFullView: function() {
|
||||
|
||||
if (this.editMode == 'edit') {
|
||||
this.initFormEditView();
|
||||
}
|
||||
|
||||
this.setType();
|
||||
this.fullViewOnly.show();
|
||||
this.or.show();
|
||||
|
@ -182,12 +178,6 @@ var customForm = {
|
|||
|
||||
},
|
||||
|
||||
initFormEditView: function() {
|
||||
// These are not editable: only properties of the role are editable.
|
||||
this.typeSelector.attr('disabled', 'disabled');
|
||||
this.relatedIndLabel.attr('disabled', 'disabled');
|
||||
},
|
||||
|
||||
// Bind event listeners that persist over the life of the page. Event listeners
|
||||
// that depend on the view should be initialized in the view setup method.
|
||||
bindEventListeners: function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue