Changeset 31540
- Timestamp:
- 2017-03-27T18:01:36+13:00 (7 years ago)
- Location:
- main/trunk/greenstone3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/service/GS2Construct.java
r31537 r31540 331 331 // If a user is only adding comments, they don't need to have editing powers over a collection 332 332 // but they need to be logged in 333 String[] docids = isAddingUserComments(request, params);333 String[] docids = getDocIDsifAddingUserComments(params); //isAddingUserComments(request, params); 334 334 boolean isAddingUserComments = (docids == null) ? false : true; 335 335 … … 1021 1021 } 1022 1022 1023 1024 protected String[] isAddingUserComments(Element request,HashMap<String, Serializable> params) {1023 // getDocIdsWithOptFilter(JSONArray json, Pattern filterFields, boolean strictOrPermissible) 1024 protected String[] getDocIDsifAddingUserComments(HashMap<String, Serializable> params) { 1025 1025 1026 1026 String metaserver_command = (String) params.get("a"); // e.g. set-archives-metadata or set-metadata-array -
main/trunk/greenstone3/web/interfaces/default/js/user_comments.js
r31537 r31540 76 76 var i = 0; 77 77 var looping = true; 78 var print_heading = false; // UNUSED SECTION if(print_heading) below 79 78 79 80 // if there's at least one existing comment OR if the form is currently being displayed 81 // (regardless of whether previous comments exist), display a heading for the comments section 82 if(metatable[0].metavals[0] != undefined || document.getElementById("usercommentform") != undefined) { 83 var heading=document.createElement("div"); 84 var attr=document.createAttribute("class"); 85 attr.nodeValue="usercommentheading"; 86 heading.setAttributeNode(attr); 87 var txt=document.createTextNode(gs.variables["textusercommentssection"]); ///"_textusercommentssection_"); 88 heading.appendChild(txt); 89 usercommentdiv.appendChild(heading); 90 } 91 92 80 93 // metatable[0] = list of usernames, metatable[1] = list of timestamps, metatable[2] = list of comments 81 94 // the 3 lists/arrays should be of even length. Assuming this, loop as long as there's another username … … 86 99 } 87 100 else { 88 89 // BEGIN UNUSED90 if(print_heading) {91 var heading=document.createElement("div");92 var attr=document.createAttribute("class");93 attr.nodeValue="usercommentheading";94 heading.setAttributeNode(attr);95 var txt=document.createTextNode(gs.variables["textusercommentssection"]); ///"_textusercommentssection_");96 heading.appendChild(txt);97 usercommentdiv.appendChild(heading);98 99 print_heading = false;100 }101 // END UNUSED102 101 103 102 var username = metaval_rec.metavalue; -
main/trunk/greenstone3/web/interfaces/default/style/core.css
r31537 r31540 1253 1253 .usercommentheading { 1254 1254 font-weight: bold; 1255 color: # 006666;1255 color: #3c8700; 1256 1256 border-top: solid 1px black; 1257 1257 } … … 1268 1268 text-decoration: none; 1269 1269 font-weight: bold; 1270 color: # 006666;1270 color: #3c8700; 1271 1271 } 1272 1272 #usercommentlink a:visited, #usercommentlogoutlink a:visited { 1273 color: # 006666;1273 color: #3c8700; 1274 1274 } 1275 1275 -
main/trunk/greenstone3/web/interfaces/default/transform/layouts/usercomments.xsl
r31537 r31540 27 27 <div id="commentssection" class="centrediv"> 28 28 <div id="usercomments"> 29 <!-- The div that loads the user comments that were already submitted --> 30 <div class="usercommentheading"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'usercomments.heading')"/></div> 29 <!-- A heading for the comment section will be added here dynamically either if 30 previously submitted comments exist, or if the form#usercommentform to add 31 a new comment is displayed. Otherwise only the "Add Comments" link is shown. --> 32 <xsl:comment>Existing comments will be loaded dynamically loaded into this div#usercomments</xsl:comment> 31 33 </div> 32 34 -
main/trunk/greenstone3/web/interfaces/default/transform/pages/document.xsl
r31537 r31540 374 374 <xsl:otherwise> <!-- display the standard greenstone document --> 375 375 <xsl:call-template name="wrappedDocument"/> 376 <br /><xsl:call-template name="userCommentsSection"/> 376 377 </xsl:otherwise> 377 378 </xsl:choose>
Note:
See TracChangeset
for help on using the changeset viewer.