VIVO-112: ISF changes relating to vcard classes

This commit is contained in:
tworrall 2013-09-18 11:34:32 -04:00
parent 0dc3956b09
commit e739a94222
2 changed files with 26 additions and 14 deletions

View file

@ -144,7 +144,7 @@ var customForm = {
// Put this case first, because in edit mode with // Put this case first, because in edit mode with
// validation errors we just want initFormFullView. // validation errors we just want initFormFullView.
// if ((!this.supportEdit) && (this.editMode == 'edit' || this.editMode == 'repair')) { // if ((!this.supportEdit) && (this.editMode == 'edit' || this.editMode == 'repair')) {
if (this.editMode == 'edit' || this.editMode == 'repair') { if (this.editMode == 'edit' || this.editMode == 'repair' || this.editMode == 'error') {
this.initFormWithValidationErrors(); this.initFormWithValidationErrors();
} }
else if (this.findValidationErrors()) { else if (this.findValidationErrors()) {

View file

@ -108,13 +108,13 @@ name will be used as the label. -->
<#if editable> <#if editable>
<#local url = property.addUrl> <#local url = property.addUrl>
<#if url?has_content> <#if url?has_content>
<@showAddLink property.localName label url /> <@showAddLink property.localName property.name label url />
</#if> </#if>
</#if> </#if>
</#macro> </#macro>
<#macro showAddLink propertyLocalName label url> <#macro showAddLink propertyLocalName propertyName label url>
<#if propertyLocalName == "informationResourceInAuthorship" || propertyLocalName == "webpage" || propertyLocalName == "hasResearchArea"> <#if propertyName == "informationResourceInAuthorship" || propertyName == "webpage" || propertyLocalName == "hasResearchArea">
<a class="add-${propertyLocalName}" href="${url}" title="${i18n().manage_list_of} ${label?lower_case}"> <a class="add-${propertyLocalName}" href="${url}" title="${i18n().manage_list_of} ${label?lower_case}">
<img class="add-individual" src="${urls.images}/individual/manage-icon.png" alt="${i18n().manage}" /></a> <img class="add-individual" src="${urls.images}/individual/manage-icon.png" alt="${i18n().manage}" /></a>
<#else> <#else>
@ -131,30 +131,42 @@ name will be used as the label. -->
<#macro propertyListItem property statement editable > <#macro propertyListItem property statement editable >
<li role="listitem"> <li role="listitem">
<#nested> <#nested>
<@editingLinks "${property.localName}" statement editable/> <@editingLinks "${property.localName}" "${property.name}" statement editable/>
</li> </li>
</#macro> </#macro>
<#macro editingLinks propertyLocalName statement editable> <#macro editingLinks propertyLocalName propertyName statement editable>
<#if editable && (propertyLocalName != "informationResourceInAuthorship" && propertyLocalName != "webpage" && propertyLocalName != "hasResearchArea")> <#if editable && (propertyName != "authors" && propertyName != "webpage" && propertyLocalName != "hasResearchArea")>
<@editLink propertyLocalName statement /> <@editLink propertyLocalName propertyName statement />
<@deleteLink propertyLocalName statement /> <@deleteLink propertyLocalName propertyName statement />
</#if> </#if>
</#macro> </#macro>
<#macro editLink propertyLocalName propertyName statement>
<#macro editLink propertyLocalName statement> <#if propertyLocalName?contains("ARG_2000028")>
<#if propertyName?contains("mailing address")>
<#local url = statement.editUrl + "&addressUri=" + "${statement.address!}">
<#elseif propertyName?contains("phone")>
<#local url = statement.editUrl + "&phoneUri=" + "${statement.phone!}">
<#elseif propertyName?contains("primary email") || propertyName?contains("additional emails")>
<#local url = statement.editUrl + "&emailUri=" + "${statement.email!}">
<#elseif propertyName?contains("full name")>
<#local url = statement.editUrl + "&fullNameUri=" + "${statement.fullName!}">
</#if>
<#else>
<#local url = statement.editUrl> <#local url = statement.editUrl>
</#if>
<#if url?has_content> <#if url?has_content>
<@showEditLink propertyLocalName url /> <@showEditLink propertyLocalName url />
</#if> </#if>
</#macro> </#macro>
<#macro showEditLink propertyLocalName url> <#macro showEditLink propertyLocalName url>
<a class="edit-${propertyLocalName}" href="${url}" title="${i18n().edit_entry}"><img class="edit-individual" src="${urls.images}/individual/editIcon.gif" alt="${i18n().edit_entry}" /></a> <a class="edit-${propertyLocalName}" href="${url}" title="${i18n().edit_entry}"><img class="edit-individual" src="${urls.images}/individual/editIcon.gif" alt="${i18n().edit_entry}" /></a>
</#macro> </#macro>
<#macro deleteLink propertyLocalName statement> <#macro deleteLink propertyLocalName propertyName statement>
<#local url = statement.deleteUrl> <#local url = statement.deleteUrl>
<#if url?has_content> <#if url?has_content>
<@showDeleteLink propertyLocalName url /> <@showDeleteLink propertyLocalName url />
@ -197,7 +209,7 @@ name will be used as the label. -->
<a href="${individual.imageUrl}" title="${i18n().alt_thumbnail_photo}"> <a href="${individual.imageUrl}" title="${i18n().alt_thumbnail_photo}">
<img class="individual-photo" src="${thumbUrl}" title="${i18n().click_to_view_larger}" alt="${individual.name}" width="${imageWidth!}" /> <img class="individual-photo" src="${thumbUrl}" title="${i18n().click_to_view_larger}" alt="${individual.name}" width="${imageWidth!}" />
</a> </a>
<@editingLinks "${mainImage.localName}" mainImage.first() editable /> <@editingLinks "${mainImage.localName}" "" mainImage.first() editable />
<#else> <#else>
<#local imageLabel><@addLinkWithLabel mainImage editable "${i18n().photo}" /></#local> <#local imageLabel><@addLinkWithLabel mainImage editable "${i18n().photo}" /></#local>
${imageLabel} ${imageLabel}
@ -218,7 +230,7 @@ name will be used as the label. -->
<#local label = individual.nameStatement> <#local label = individual.nameStatement>
${label.value} ${label.value}
<#if useEditLink> <#if useEditLink>
<@editingLinks "label" label editable /> <@editingLinks "label" "" label editable />
<#elseif editable || (labelCount > 1)> <#elseif editable || (labelCount > 1)>
<#--We display the link even when the user is not logged in case of multiple labels--> <#--We display the link even when the user is not logged in case of multiple labels-->
<#if editable> <#if editable>