Changeset 27294


Ignore:
Timestamp:
2013-05-02T19:18:38+12:00 (11 years ago)
Author:
ak19
Message:
  1. Basic authentication when adding user comments. 2. Rearranged some divs to do with adding user comments. 3. A few default css statements for the form.
Location:
main/trunk/greenstone2
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/macros/document.dm

    r27293 r27294  
    124124#######################################################################
    125125
     126# The div that loads the user comments that were already submitted
    126127# associated javascript function loadUserComments is in style.dm's _globalscripts_ macro
    127128_usercomments_ {
     
    131132}
    132133
    133 
    134134# Display the add-user-comment form on actual document pages and not when browsing/searching
    135135# This means the form should only be displayed on pages where the _cgiargd_ (the docid) is set
     136
     137# If the user's logged in, show the comment form, else show the link to the login page
     138_addusercomment_ {
     139_If_(_cgiargd_,
     140_If_(_cgiargun_,_usercommentform_,_loginlink_)
     141)
     142}
     143
     144_doc-url_ {_gwcgi_?e=_compressedoptions_&a=_cgiarga_&c=_cgiargc_&cl=_cgiargcl_&d=_cgiargd_}
     145
     146_loginlink_ {
     147<div id="usercommentlink"><a href="_doc-url_&amp;uan=1">_textaddusercomment_</a></div>
     148}
    136149
    137150# For getting the submitbutton to make Ajax calls, see
     
    139152# http://stackoverflow.com/questions/8869341/ajax-form-submit-with-submit-button
    140153
    141 _addusercomment_ {
    142 
    143 _If_(_cgiargd_,
    144 
     154_usercommentform_ {
    145155<form name="AddUserCommentForm">
    146 <p>_textcommentusername_ <input type="text" name="username"></p>
     156<!--<p>_textcommentusername_ <input type="text" name="username"></p>-->
     157<input type=hidden name="username" value="_cgiargun_">
    147158<p>
    148159_textaddusercomment_
     
    154165<label id="usercommentfeedback"></label>
    155166</form>
    156 )
     167
    157168
    158169<script type="text/javascript"> 
     
    656667</div> <!-- document:footer -->
    657668
    658 <div class="navarrowsbottom">
    659 _navarrowsbottom_
    660 </div>
    661669
    662670<center>
     
    669677</td></tr></table>
    670678</center>
     679
     680<div class="navarrowsbottom">
     681_navarrowsbottom_
     682</div>
     683
    671684
    672685_endspacer__htmlfooter_
  • main/trunk/greenstone2/macros/english.dm

    r27293 r27294  
    336336}
    337337
    338 _textcommentusername_ {User name:}
    339 _textaddusercomment_ {Comment:}
    340 _textaddcomment_ {add comment}
     338_textcommentusername_ {User name}
     339_textaddusercomment_ {Add Comment}
     340_textaddcomment_ {submit comment}
    341341_textcommentsubmitted_ {Comment Submitted}
    342 _text-is-empty_ {Can't add empty values}
     342_text-is-empty_ {Comment was empty.}
     343_text-usercomments-section_ {Comments}
    343344
    344345_textgoto_ {go to page}
  • main/trunk/greenstone2/macros/style.dm

    r27293 r27294  
    330330    // (we do this here for all values together to hopefully avoid reloading the page for each comment)
    331331
     332    if(metapos > 0) \{
     333        var heading=document.createElement("div");
     334        var attr=document.createAttribute("class");
     335        attr.nodeValue="usercommentheading";
     336        heading.setAttributeNode(attr);
     337        var txt=document.createTextNode("_text-usercomments-section_");
     338        heading.appendChild(txt);
     339        usercommentdiv.appendChild(heading);
     340    \}
     341
    332342    for(var i = 0; i < metapos; i++) \{
    333 
    334343        var comment_record = comments_arraymap[i];
    335344
  • main/trunk/greenstone2/web/style/style.css

    r26549 r27294  
    334334    text-transform:capitalize;
    335335}
     336
     337#usercomments {
     338    margin: 10px 0;
     339}
     340
     341.usercommentheading {
     342    font-weight: bold;
     343    color: #006666;
     344    border-top: solid 1px black;
     345}
     346
     347.usercomment {
     348    margin: 10px 0;
     349}
     350
     351#usercommentlink {
     352    margin: 10px 0 20px 0;
     353}
     354
     355#usercommentlink a {
     356 text-decoration: none;
     357 font-weight: bold;
     358}
Note: See TracChangeset for help on using the changeset viewer.