Skip to content

Commit

Permalink
Merge pull request #259 from SarahBA/master
Browse files Browse the repository at this point in the history
Adding a link for "Request Restricted Data"
  • Loading branch information
emanueldima committed Apr 16, 2014
2 parents 1649204 + 7be6455 commit 7c7a6ea
Show file tree
Hide file tree
Showing 5 changed files with 455 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ dbmigrator
inveniomigrate
recomp.sh
*.swp
.DS_Store
.DS_Storei
9 changes: 5 additions & 4 deletions invenio/templates/record.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,17 @@
</div>
</div>
</div>
<table>
<table>
<tr>
<td><a href={{recid}}/comments>Comments & Reviews</a></td>
<td width="70%">&nbsp;</td>
<td width="70%">&nbsp;</td>
<td align="right"><a href="/abuse/{{ recid }}">Report abuse</a></td>
</tr>
</table>
</table>
{% endif%}
{% if has_private_files %}
<p><i class="icon-lock"></i>This record contains private files, which are not listed here.</p>
<p><i class="icon-lock"></i>This record contains private files, which are not listed here.</p>
<br><p><a href="/reqdata/{{ recid }}">Request Data</a></p>
{% endif%}
{% block record_tabs %}
{%- for tab in tabs|sort(attribute='order') -%}
Expand Down
289 changes: 289 additions & 0 deletions simplestore/etc/templates/request_data.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,289 @@
{% extends "page.html" %}
{% block header %}
{{ super() }}
{% css 'css/simplestore-style.css', '50-simplestore' %}
{% css 'css/font-awesome.min.css', '50-simplestore' %}
{% css 'css/bootstrap-switch.css', '50-simplestore' %}
{% css 'css/jquery-ui.css', '50-simplestore' %}
{% css 'css/view.css','50-simplestore' %}
<!-- Note there is also js at the bottom of the template. Sigh. -->
{% js 'js/bootstrap-switch.js', '50-simplestore' %}
{% js 'js/jquery-ui-1.10.3.custom.min.js', '50-simplestore' %}
{% js 'js/view.js','50-simplestore' %}
{% endblock %}
{% block body %}
<div id="form_container">
{% if warning_msg: %}
<font color="red"><h5> {{ warning_msg }} </h5></font>
{% endif %}
<form id="form_774353" class="appnitro" method="post" action="/reqdata/submit">
<div class="form_description">
<h2>Send a Request For Data Owner</h2>
</div>
<ul >

<label class="description" for="element_9">Full link to record </label>
<span>
<input id="element_9_1" name= "element_9_1" class="element text" maxlength="255" size="8" value="{{ full_link }}"/>
</span>
</li> <li id="li_7" >
<label class="description" for="element_7">Write your message: </label>
<div>
<textarea id="element_7" name="element_7" class="element textarea medium"></textarea>
</div>
</li> <li id="li_3" >
<label class="description" for="element_3">Your name </label>
<span>
<input id="element_3_1" name= "element_3_1" class="element text" maxlength="255" size="8" value=""/>
<label>First</label>
</span>
<span>
<input id="element_3_2" name= "element_3_2" class="element text" maxlength="255" size="14" value=""/>
<label>Last</label>
</span>
</li> <li id="li_5" >
<label class="description" for="element_5">Your affiliation </label>
<div>
<input id="element_5" name="element_5" class="element text large" type="text" maxlength="255" value=""/>
</div>
</li> <li id="li_6" >
<label class="description" for="element_6">Your Email </label>
<div>
<input id="element_6" name="element_6" class="element text large" type="text" maxlength="255" value=""/>
</div>
</li> <li id="li_2" >
<label class="description" for="element_2">Your address </label>

<div class="left">
<input id="element_2_3" name="element_2_3" class="element text medium" value="" type="text">
<label for="element_2_3">City</label>
</div>

<div class="right">
<select class="element select medium" id="element_2_6" name="element_2_6">
<option value="" selected="selected"></option>
<option value="Afghanistan" >Afghanistan</option>
<option value="Albania" >Albania</option>
<option value="Algeria" >Algeria</option>
<option value="Andorra" >Andorra</option>
<option value="Antigua and Barbuda" >Antigua and Barbuda</option>
<option value="Argentina" >Argentina</option>
<option value="Armenia" >Armenia</option>
<option value="Australia" >Australia</option>
<option value="Austria" >Austria</option>
<option value="Azerbaijan" >Azerbaijan</option>
<option value="Bahamas" >Bahamas</option>
<option value="Bahrain" >Bahrain</option>
<option value="Bangladesh" >Bangladesh</option>
<option value="Barbados" >Barbados</option>
<option value="Belarus" >Belarus</option>
<option value="Belgium" >Belgium</option>
<option value="Belize" >Belize</option>
<option value="Benin" >Benin</option>
<option value="Bhutan" >Bhutan</option>
<option value="Bolivia" >Bolivia</option>
<option value="Bosnia and Herzegovina" >Bosnia and Herzegovina</option>
<option value="Botswana" >Botswana</option>
<option value="Brazil" >Brazil</option>
<option value="Brunei" >Brunei</option>
<option value="Bulgaria" >Bulgaria</option>
<option value="Burkina Faso" >Burkina Faso</option>
<option value="Burundi" >Burundi</option>
<option value="Cambodia" >Cambodia</option>
<option value="Cameroon" >Cameroon</option>
<option value="Canada" >Canada</option>
<option value="Cape Verde" >Cape Verde</option>
<option value="Central African Republic" >Central African Republic</option>
<option value="Chad" >Chad</option>
<option value="Chile" >Chile</option>
<option value="China" >China</option>
<option value="Colombia" >Colombia</option>
<option value="Comoros" >Comoros</option>
<option value="Congo" >Congo</option>
<option value="Costa Rica" >Costa Rica</option>
<option value="Côte d'Ivoire" >Côte d'Ivoire</option>
<option value="Croatia" >Croatia</option>
<option value="Cuba" >Cuba</option>
<option value="Cyprus" >Cyprus</option>
<option value="Czech Republic" >Czech Republic</option>
<option value="Denmark" >Denmark</option>
<option value="Djibouti" >Djibouti</option>
<option value="Dominica" >Dominica</option>
<option value="Dominican Republic" >Dominican Republic</option>
<option value="East Timor" >East Timor</option>
<option value="Ecuador" >Ecuador</option>
<option value="Egypt" >Egypt</option>
<option value="El Salvador" >El Salvador</option>
<option value="Equatorial Guinea" >Equatorial Guinea</option>
<option value="Eritrea" >Eritrea</option>
<option value="Estonia" >Estonia</option>
<option value="Ethiopia" >Ethiopia</option>
<option value="Fiji" >Fiji</option>
<option value="Finland" >Finland</option>
<option value="France" >France</option>
<option value="Gabon" >Gabon</option>
<option value="Gambia" >Gambia</option>
<option value="Georgia" >Georgia</option>
<option value="Germany" >Germany</option>
<option value="Ghana" >Ghana</option>
<option value="Greece" >Greece</option>
<option value="Grenada" >Grenada</option>
<option value="Guatemala" >Guatemala</option>
<option value="Guinea" >Guinea</option>
<option value="Guinea-Bissau" >Guinea-Bissau</option>
<option value="Guyana" >Guyana</option>
<option value="Haiti" >Haiti</option>
<option value="Honduras" >Honduras</option>
<option value="Hong Kong" >Hong Kong</option>
<option value="Hungary" >Hungary</option>
<option value="Iceland" >Iceland</option>
<option value="India" >India</option>
<option value="Indonesia" >Indonesia</option>
<option value="Iran" >Iran</option>
<option value="Iraq" >Iraq</option>
<option value="Ireland" >Ireland</option>
<option value="Israel" >Israel</option>
<option value="Italy" >Italy</option>
<option value="Jamaica" >Jamaica</option>
<option value="Japan" >Japan</option>
<option value="Jordan" >Jordan</option>
<option value="Kazakhstan" >Kazakhstan</option>
<option value="Kenya" >Kenya</option>
<option value="Kiribati" >Kiribati</option>
<option value="North Korea" >North Korea</option>
<option value="South Korea" >South Korea</option>
<option value="Kuwait" >Kuwait</option>
<option value="Kyrgyzstan" >Kyrgyzstan</option>
<option value="Laos" >Laos</option>
<option value="Latvia" >Latvia</option>
<option value="Lebanon" >Lebanon</option>
<option value="Lesotho" >Lesotho</option>
<option value="Liberia" >Liberia</option>
<option value="Libya" >Libya</option>
<option value="Liechtenstein" >Liechtenstein</option>
<option value="Lithuania" >Lithuania</option>
<option value="Luxembourg" >Luxembourg</option>
<option value="Macedonia" >Macedonia</option>
<option value="Madagascar" >Madagascar</option>
<option value="Malawi" >Malawi</option>
<option value="Malaysia" >Malaysia</option>
<option value="Maldives" >Maldives</option>
<option value="Mali" >Mali</option>
<option value="Malta" >Malta</option>
<option value="Marshall Islands" >Marshall Islands</option>
<option value="Mauritania" >Mauritania</option>
<option value="Mauritius" >Mauritius</option>
<option value="Mexico" >Mexico</option>
<option value="Micronesia" >Micronesia</option>
<option value="Moldova" >Moldova</option>
<option value="Monaco" >Monaco</option>
<option value="Mongolia" >Mongolia</option>
<option value="Montenegro" >Montenegro</option>
<option value="Morocco" >Morocco</option>
<option value="Mozambique" >Mozambique</option>
<option value="Myanmar" >Myanmar</option>
<option value="Namibia" >Namibia</option>
<option value="Nauru" >Nauru</option>
<option value="Nepal" >Nepal</option>
<option value="Netherlands" >Netherlands</option>
<option value="New Zealand" >New Zealand</option>
<option value="Nicaragua" >Nicaragua</option>
<option value="Niger" >Niger</option>
<option value="Nigeria" >Nigeria</option>
<option value="Norway" >Norway</option>
<option value="Oman" >Oman</option>
<option value="Pakistan" >Pakistan</option>
<option value="Palau" >Palau</option>
<option value="Panama" >Panama</option>
<option value="Papua New Guinea" >Papua New Guinea</option>
<option value="Paraguay" >Paraguay</option>
<option value="Peru" >Peru</option>
<option value="Philippines" >Philippines</option>
<option value="Poland" >Poland</option>
<option value="Portugal" >Portugal</option>
<option value="Puerto Rico" >Puerto Rico</option>
<option value="Qatar" >Qatar</option>
<option value="Romania" >Romania</option>
<option value="Russia" >Russia</option>
<option value="Rwanda" >Rwanda</option>
<option value="Saint Kitts and Nevis" >Saint Kitts and Nevis</option>
<option value="Saint Lucia" >Saint Lucia</option>
<option value="Saint Vincent and the Grenadines" >Saint Vincent and the Grenadines</option>
<option value="Samoa" >Samoa</option>
<option value="San Marino" >San Marino</option>
<option value="Sao Tome and Principe" >Sao Tome and Principe</option>
<option value="Saudi Arabia" >Saudi Arabia</option>
<option value="Senegal" >Senegal</option>
<option value="Serbia and Montenegro" >Serbia and Montenegro</option>
<option value="Seychelles" >Seychelles</option>
<option value="Sierra Leone" >Sierra Leone</option>
<option value="Singapore" >Singapore</option>
<option value="Slovakia" >Slovakia</option>
<option value="Slovenia" >Slovenia</option>
<option value="Solomon Islands" >Solomon Islands</option>
<option value="Somalia" >Somalia</option>
<option value="South Africa" >South Africa</option>
<option value="Spain" >Spain</option>
<option value="Sri Lanka" >Sri Lanka</option>
<option value="Sudan" >Sudan</option>
<option value="Suriname" >Suriname</option>
<option value="Swaziland" >Swaziland</option>
<option value="Sweden" >Sweden</option>
<option value="Switzerland" >Switzerland</option>
<option value="Syria" >Syria</option>
<option value="Taiwan" >Taiwan</option>
<option value="Tajikistan" >Tajikistan</option>
<option value="Tanzania" >Tanzania</option>
<option value="Thailand" >Thailand</option>
<option value="Togo" >Togo</option>
<option value="Tonga" >Tonga</option>
<option value="Trinidad and Tobago" >Trinidad and Tobago</option>
<option value="Tunisia" >Tunisia</option>
<option value="Turkey" >Turkey</option>
<option value="Turkmenistan" >Turkmenistan</option>
<option value="Tuvalu" >Tuvalu</option>
<option value="Uganda" >Uganda</option>
<option value="Ukraine" >Ukraine</option>
<option value="United Arab Emirates" >United Arab Emirates</option>
<option value="United Kingdom" >United Kingdom</option>
<option value="United States" >United States</option>
<option value="Uruguay" >Uruguay</option>
<option value="Uzbekistan" >Uzbekistan</option>
<option value="Vanuatu" >Vanuatu</option>
<option value="Vatican City" >Vatican City</option>
<option value="Venezuela" >Venezuela</option>
<option value="Vietnam" >Vietnam</option>
<option value="Yemen" >Yemen</option>
<option value="Zambia" >Zambia</option>
<option value="Zimbabwe" >Zimbabwe</option>

</select>
<label for="element_2_6">Country</label>
</div>
</li> <li id="li_4" >
<label class="description" for="element_4">Your phone number </label>
<div>
<input id="element_4" name="element_4" class="element text medium" type="text" maxlength="255" value=""/>
</div>
</li>
<script type="text/javascript"
src="http://api.recaptcha.net/challenge?k=6LefTu0SAAAAAC71iUJWSThHS4uweNKp40tBhLt7">
</script>

<noscript>
<iframe src="http://api.recaptcha.net/noscript?k=6LefTu0SAAAAAC71iUJWSThHS4uweNKp40tBhLt7"
height="300" width="500" frameborder="0"></iframe><br>
<textarea name="recaptcha_challenge_field" rows="3" cols="40">
</textarea>
<input type="hidden" name="recaptcha_response_field"
value="manual_challenge">
</noscript>
<li class="buttons">
<input type="hidden" name="form_id" value="774353" />

<input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />
</li>
</ul>
</form>
</div>
{% endblock body %}
39 changes: 39 additions & 0 deletions simplestore/lib/request_data_blueprint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-

## This file is part of SimpleStore.
## Copyright (C) 2013 EPCC, The University of Edinburgh.
##
## SimpleStore 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.
##
## SimpleStore 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 SimpleStore; if not, write to the Free Software Foundation, Inc.,
## 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.


from flask import request
from invenio.webinterface_handler_flask_utils import _, InvenioBlueprint
import invenio.request_data_form as reqdata

blueprint = InvenioBlueprint('request_data_form', __name__,
url_prefix='/reqdata'
)

@blueprint.route('/', methods=['GET'])
def request_data_form_noparams():
return reqdata.request_data_form(request,-1)

@blueprint.route('/<recid>',methods=['GET'])
def request_data_form(recid):
return reqdata.request_data_form(request,recid)

@blueprint.route('/submit',methods=['POST'])
def request_data_submit():
return reqdata.request_data_submit(request)
Loading

0 comments on commit 7c7a6ea

Please sign in to comment.