diff --git a/productMods/edit/forms/addAuthorsToInformationResource.jsp b/productMods/edit/forms/addAuthorsToInformationResource.jsp index 086ca4b5..06c1e60e 100644 --- a/productMods/edit/forms/addAuthorsToInformationResource.jsp +++ b/productMods/edit/forms/addAuthorsToInformationResource.jsp @@ -21,6 +21,7 @@ core:authorInAuthorship (Person : Authorship) - inverse of linkedAuthor --%> <%@ page import="java.util.List" %> +<%@ page import="java.util.Map" %> <%@ page import="java.util.ArrayList" %> <%@ page import="java.util.Arrays" %> <%@ page import="java.util.Collections" %> @@ -38,6 +39,7 @@ core:authorInAuthorship (Person : Authorship) - inverse of linkedAuthor <%@ page import="edu.cornell.mannlib.vitro.webapp.dao.WebappDaoFactory" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.VitroRequest" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.web.MiscWebUtils" %> +<%@ page import="edu.cornell.mannlib.vitro.webapp.utils.StringUtils" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.JavaScript" %> <%@ page import="edu.cornell.mannlib.vitro.webapp.controller.freemarker.UrlBuilder.Css" %> @@ -234,7 +236,7 @@ SPARQL queries for existing values. --%> } -<% +<% log.debug(request.getAttribute("editjson")); EditConfiguration editConfig = EditConfiguration.getConfigFromSession(session,request); @@ -274,6 +276,19 @@ SPARQL queries for existing values. --%> "/edit/forms/css/addAuthorsToInformationResource.css" )); request.setAttribute("customCss", customCss); + + String ulClass = ""; + List ulClasses = new ArrayList(); + + if (authorships.size() > 1) { + // This class triggers application of dd styles. Don't wait for js to add + // the ui-sortable class, because then the page flashes as the styles are updated. + ulClasses.add("dd"); + } + + if (ulClasses.size() > 0) { + ulClass="class=\"" + StringUtils.join(ulClasses, " ") + "\""; + } %> @@ -284,20 +299,6 @@ SPARQL queries for existing values. --%>

${title}

-<% - String ulClass = ""; - - if (authorships.size() > 1) { - // This class triggers application of dd styles. Don't wait for js to add - // the ui-sortable class, because then the page flashes as the styles are updated. - ulClass = "dd"; - } - - if (! "".equals(ulClass)) { - ulClass = "class='" + ulClass + "'"; - } -%> -
    > <% diff --git a/productMods/edit/forms/js/addAuthorsToInformationResource.js b/productMods/edit/forms/js/addAuthorsToInformationResource.js index 462e6a1d..2b7e3059 100644 --- a/productMods/edit/forms/js/addAuthorsToInformationResource.js +++ b/productMods/edit/forms/js/addAuthorsToInformationResource.js @@ -161,11 +161,11 @@ var addAuthorForm = { minLength: 2, source: function(request, response) { if (request.term in addAuthorForm.acCache) { - // console.log("found term in cache"); + // console.log('found term in cache'); response(addAuthorForm.acCache[request.term]); return; } - // console.log("not getting term from cache"); + // console.log('not getting term from cache'); // If the url query params are too long, we could do a post // here instead of a get. Add the exclude uris to the data @@ -195,8 +195,8 @@ var addAuthorForm = { var url = this.baseAcUrl, existingAuthors = $('#authorships .authorLink'); - //console.log("in setAcUrl()"); - //console.log("number of existing authors: " + existingAuthors.length); + //console.log('in setAcUrl()'); + //console.log('number of existing authors: ' + existingAuthors.length); existingAuthors.each(function() { url += '&excludeUri=' + $(this).attr('id'); @@ -286,8 +286,8 @@ var addAuthorForm = { }); // console.log(authorships) - // console.log("additions: " + additions); - // console.log("retractions: " + retractions); + // console.log('additions: ' + additions); + // console.log('retractions: ' + retractions); $.ajax({ url: $('.reorderUrl').attr('id'), @@ -469,7 +469,7 @@ var addAuthorForm = { removeAuthorship: function(link) { // RY Upgrade this to a modal window - var message = "Are you sure you want to remove this author?"; + var message = 'Are you sure you want to remove this author?'; if (!confirm(message)) { return false; } @@ -525,7 +525,7 @@ var addAuthorForm = { // $(this).siblings('.undo').show(); // author.html(authorName + ' has been removed'); // author.css('width', 'auto'); -// author.effect("highlight", {}, 3000); +// author.effect('highlight', {}, 3000); } else { alert('Error processing request: author not removed'); } @@ -544,8 +544,8 @@ var addAuthorForm = { // RY To be implemented later. toggleRemoveLink: function() { - // when clicking remove: remove the author, and change link text to "undo" - // when clicking undo: add the author back, and change link text to "remove" + // when clicking remove: remove the author, and change link text to 'undo' + // when clicking undo: add the author back, and change link text to 'remove' } }; diff --git a/productMods/templates/entity/authorshipShortView.jsp b/productMods/templates/entity/authorshipShortView.jsp index 54496767..f6a43d3b 100644 --- a/productMods/templates/entity/authorshipShortView.jsp +++ b/productMods/templates/entity/authorshipShortView.jsp @@ -12,13 +12,13 @@ <%-- SUBJECT is a Person, so get info from Authorship about related Publication --%> - <%-- this Position is linked to an Organization --%> + <%-- this Authorship is linked to an InformationResource --%> - + - + - + <%-- this Position is not linked to a Publication yet; use Authorship name as a placeholder and add link to the Authorship so user can add more information --%>