Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds extra forms after a user clicks the "Update References" button. * Improves reference correction form layout * Keeps the output format while searching for references to add
- Loading branch information
Showing
15 changed files
with
658 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# -*- coding: utf-8 -*- | ||
## | ||
## This file is part of Invenio. | ||
## Copyright (C) 2014 CERN. | ||
## | ||
## Invenio is free software; you can redistribute it and/or | ||
## modify it under the terms of the GNU General Public License as | ||
## published by the Free Software Foundation; either version 2 of the | ||
## License, or (at your option) any later version. | ||
## | ||
## Invenio is distributed in the hope that it will be useful, but | ||
## WITHOUT ANY WARRANTY; without even the implied warranty of | ||
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
## General Public License for more details. | ||
## | ||
## You should have received a copy of the GNU General Public License | ||
## along with Invenio; if not, write to the Free Software Foundation, Inc., | ||
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. | ||
"""BibFormat element - Creates update references button | ||
""" | ||
|
||
|
||
def format_element(bfo, position='top'): | ||
out = """ | ||
<div id='referenceinp_link_box'> | ||
<span id='referenceinp_link_span'> | ||
""" | ||
references = bfo.fields("999C5", escape=1, repeatable_subfields_p=True) | ||
if references: | ||
out += "<a id='referenceinp_link' href='/record/%s/export/hru'>Update these references</a>" % bfo.control_field("001") | ||
else: | ||
if position == "bottom": | ||
out += "<a id='referenceinp_link' href='/record/%s/export/hra'>Add references</a>" % bfo.control_field("001") | ||
else: | ||
return "" | ||
out += """ | ||
</span> | ||
</div> | ||
""" | ||
return out | ||
|
||
|
||
def escape_values(bfo): | ||
""" | ||
Called by BibFormat in order to check if output of this element | ||
should be escaped. | ||
""" | ||
return 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 95 additions & 0 deletions
95
bibformat/format_templates/reference_correction_options.bft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
<style> | ||
.radio { | ||
margin-top:10px; | ||
} | ||
|
||
.tiny { | ||
font-size: 85%; | ||
color: grey; | ||
} | ||
|
||
#ref-form { | ||
font-size: 80%; | ||
} | ||
|
||
#email-required { | ||
color: red; | ||
font-style: italic; | ||
} | ||
</style> | ||
|
||
<script> | ||
$().ready(function() { | ||
if ( !$('#arxiv').is(':checked') ) { | ||
$("#ref-extra-comments").hide(); | ||
} | ||
|
||
$( "input[type=radio]" ).change(function() { | ||
if( $(this).is(':checked') && $(this).attr("value") != "arxiv"){ | ||
$("#ref-extra-comments").slideUp(); | ||
} | ||
else { | ||
$("#ref-extra-comments").slideDown(); | ||
} | ||
}); | ||
|
||
$("#ref-form").on("submit", function(event) { | ||
/* Snippet from http://stackoverflow.com/questions/4964691/super-simple-email-validation-with-javascript*/ | ||
var email = $("#email").val(); | ||
if ( !$('#arxiv').is(':checked') || /(.+)@(.+){2,}\.(.+){2,}/.test(email) ){ | ||
return; | ||
} else { | ||
$("#email-required").html("Please, input a valid email address"); | ||
event.preventDefault(); | ||
} | ||
}) | ||
}); | ||
</script> | ||
|
||
<h1>Reference correction</h1> | ||
|
||
<div id="detailedrecordshortreminder"> | ||
<a class = "titlelink" href="<BFE_SERVER_INFO var="recurl">"> | ||
<BFE_INSPIRE_TITLE_BRIEF prefix="" suffix="" default="" escape="" highlight="no" brief="yes" /> | ||
</a> | ||
<br /> | ||
<BFE_INSPIRE_AUTHORS prefix="" suffix="" extension=" et al." limit="3" print_links="yes" separator="; " print_affiliations="no" highlight="no" interactive="no" /> | ||
<BFE_INSPIRE_PUBLI_INFO prefix="<br />Published in <b>" suffix="</b>" /><br /> | ||
<BFE_INSPIRE_ARXIV prefix="<a href=http://www.arxiv.org/pdf/" suffix=" target=blank />PDF</a> from arXiv " default="" escape="" | ||
category="yes" links="no" mirrors="no"/> | ||
</div> | ||
<br/> | ||
|
||
<form method="POST" action="/reference_update.py/reference_correction" id="ref-form"> | ||
<input type="hidden" name="record_id" id="record_id" value=<BFE_FIELD tag="001"/> /> | ||
|
||
<div id="ref-questions"> | ||
<label>What's wrong with the current reference list?</label> | ||
<br/> | ||
<input type = "radio" name="problem" id="arxiv" value="arxiv" class="radio" checked="checked" /> | ||
<label for="arxiv">A revised arXiv version exists with an updated reference list</label> | ||
<br/> | ||
<input type = "radio" name="problem" id="published" value="published" class="radio" /> | ||
<label for="published">The published version has an updated reference list</label> | ||
<br/> | ||
<input type = "radio" name="problem" id="wrong" value="wrong" class="radio" /> | ||
<label for="wrong">Some references have not been correctly identified</label> | ||
<br/> | ||
<br/> | ||
</div> | ||
<div id="ref-extra-comments"> | ||
<br/> | ||
Your email address <span class="tiny">(we will notify you as soon as the references have been updated)</span><br/> | ||
<input type="text" name="email" id="email" size="50" placeholder="youremail@example.com"><span><strong> Required</strong></span> | ||
<div id="email-required"> | ||
</div> | ||
<br/><br/> | ||
Add extra comments to help us identifying the correct references: | ||
<br/> | ||
<textarea name="comments" cols="80" rows="5"> | ||
</textarea> | ||
<br/> | ||
<br/> | ||
</div> | ||
<input type="submit" class="formbutton" value="Next"> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<style> | ||
.tiny { | ||
font-size: 85%; | ||
color: grey; | ||
} | ||
|
||
#ref-form { | ||
font-size: 80%; | ||
} | ||
|
||
#email-required { | ||
color: red; | ||
font-style: italic; | ||
} | ||
|
||
.tooltip { | ||
display: inline; | ||
position: relative; | ||
} | ||
|
||
.tooltip:hover:after{ | ||
background: #333; | ||
background: rgba(0,0,0,.8); | ||
border-radius: 5px; | ||
bottom: 26px; | ||
color: #fff; | ||
left: 20%; | ||
padding: 5px 15px; | ||
position: absolute; | ||
z-index: 98; | ||
width: 220px; | ||
} | ||
|
||
.tooltip:hover:before{ | ||
border: solid; | ||
border-color: #333 transparent; | ||
border-width: 6px 6px 0 6px; | ||
bottom: 20px; | ||
content: ""; | ||
left: 50%; | ||
position: absolute; | ||
z-index: 99; | ||
} | ||
|
||
.tooltip_1:hover:after { | ||
content: "Copy all the content present in the reference section as it appears in the original source"; | ||
} | ||
|
||
.tooltip_2:hover:after { | ||
content: "Accessible refers to not needing a subscription to access the content"; | ||
} | ||
|
||
.aligned-image { | ||
vertical-align: top; | ||
} | ||
</style> | ||
|
||
<script> | ||
$().ready(function() { | ||
$("#ref-form").on("submit", function(event) { | ||
/* Snippet from http://stackoverflow.com/questions/4964691/super-simple-email-validation-with-javascript*/ | ||
var email = $("#email").val(); | ||
if ( /(.+)@(.+){2,}\.(.+){2,}/.test(email) ){ | ||
return; | ||
} else { | ||
$("#email-required").html("Please, input a valid email address"); | ||
event.preventDefault(); | ||
} | ||
}) | ||
}); | ||
</script> | ||
|
||
<h1>Add references to record</h1> | ||
|
||
<div id="detailedrecordshortreminder"> | ||
<a class = "titlelink" href="<BFE_SERVER_INFO var="recurl">"> | ||
<BFE_INSPIRE_TITLE_BRIEF prefix="" suffix="" default="" escape="" highlight="no" brief="yes" /> | ||
</a> | ||
<br /> | ||
<BFE_INSPIRE_AUTHORS prefix="" suffix="" extension=" et al." limit="3" print_links="yes" separator="; " print_affiliations="no" highlight="no" interactive="no" /> | ||
<BFE_INSPIRE_PUBLI_INFO prefix="<br />Published in <b>" suffix="</b>" /><br /> | ||
<BFE_INSPIRE_ARXIV prefix="<a href=http://www.arxiv.org/pdf/" suffix=" target=blank />PDF</a> from arXiv " default="" escape="" | ||
category="yes" links="no" mirrors="no"/> | ||
</div> | ||
<br/> | ||
|
||
<form method="POST" action="/reference_update.py/reference_add" id="ref-form"> | ||
Please paste the reference list in the following text area: | ||
<br /> | ||
<input type="hidden" name="record_id" id="record_id" value=<BFE_FIELD tag="001"/> /> | ||
<textarea name="references" cols="80" rows="15"> | ||
</textarea> | ||
|
||
<br/><br/> | ||
If available, please provide us with an accessible URL for the pdf: | ||
<br /> | ||
<input type="text" name="url" size="50" placeholder="http://www.url.com/document.pdf"> | ||
<br/> | ||
<br/> | ||
<br/> | ||
Your email address <span class="tiny">(we will notify you as soon as the references have been updated)</span><br/> | ||
<input type="text" name="email" id="email" size="50" placeholder="youremail@example.com"><span><strong> Required</strong></span> | ||
<div id="email-required"> | ||
</div> | ||
<br/> | ||
Add extra comments to help us identifying the correct references: | ||
<br/> | ||
|
||
<textarea name="comments" cols="80" rows="5"></textarea> | ||
<br/> | ||
<br/> | ||
<input type="submit" value="Submit" class="formbutton"> | ||
|
||
</form> |
Oops, something went wrong.