Skip to content

Commit

Permalink
Merge pull request #14 from bloomberg/merge-branch
Browse files Browse the repository at this point in the history
Merge branch
  • Loading branch information
dchhabda committed May 25, 2018
2 parents fc59eaf + 3da1615 commit 8e7e616
Show file tree
Hide file tree
Showing 21 changed files with 364 additions and 64 deletions.
31 changes: 31 additions & 0 deletions templates/account/email/exportdata.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{% extends "account/email/base.html" %}

{% block subject %}
Your personal data files
{% endblock %}

{% block subtitle %}
Hi {{user.fullname}},
{% endblock %}

{% block body %}
<p>You have recently requested to export all the data that we have from you in our server.</p>

{% if personal_data_link %}
<p>In the following link, you will be able to download ZIP file that contains your personal data (the link will be only valid for {{config.TTL_ZIP_SEC_FILES}} days).</p>

<ul>
<li>Personal Data: {{personal_data_link}}</li>
</ul>
{% else %}
<p>Attached you will find a ZIP file that contains your personal data.</p>
{% endif %}

<p>Within the ZIP file you will find your data in JSON format. You can open those files with any text editor, as this format is an open standard.</p>

<p>If you want to get new updated versions of this file, just export again your data.</p>

<p>All the best,</p>

<p>{{ config.BRAND }} Team
{% endblock %}
19 changes: 19 additions & 0 deletions templates/account/email/exportdata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Hi {{user.fullname}},

You have recently requested to export all the data that we have from you in our server.

{% if personal_data_link %}
In the following links, you will be able to download ZIP files that contains your personal data (the links will be only valid for {{config.TTL_ZIP_SEC_FILES}} days).

Personal Data: {{personal_data_link}}
{% else %}
Attached you will find a ZIP file that contains your personal data.
{% endif %}

Within the ZIP file you will find your data in JSON format. You can open those files with any text editor, as this format is an open standard.

If you want to get new updated versions of the file, just export again your data.

All the best,

{{ config.BRAND }} Team
1 change: 1 addition & 0 deletions templates/account/email/newaccount_invite.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ <h1>Account Registration</h1>
{% endif %}
<br>
<p>Reference manual for {{ config.BRAND }} platform is available at <a href={{user_manual_url}}>{{user_manual_label}}</a></p>
<p>For more information about the processing of your personal data by {{ config.PARENT_BRAND or config.BRAND }}, please review our <a href="{{ config.PRIVACY_POLICY_PAGE }}">privacy policy</a>.</p>
{% endblock %}
60 changes: 48 additions & 12 deletions templates/account/public_profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,56 @@ <h2><i class="fa fa-trophy"></i> {{ _('Rank')}}: {{user.rank}}</h2>
</div>
{% endif %}
</div>
</div>
{% if config.upref_mdata %}
<div class="row">
<div class="col-md-offset-2 col-md-8">
{% if current_user.admin or current_user.subadmin%}
<div class="col-md-offset-15 col-md-10">
{{ user_pref_metadata.render_upref_mdata(user, form, can_update, input_form) }}
</div>
{% endif %}
</div>
</div>
{% endif %}
</div>
{% if config.upref_mdata %}
<div class="row">
<div class="col-md-offset-2 col-md-8">
{% if current_user.admin or current_user.subadmin%}
<div class="col-md-offset-15 col-md-10">
{{ user_pref_metadata.render_upref_mdata(user, form, can_update, input_form) }}
</div>
{% endif %}
</div>
</div>
{% endif %}
<div class="row">
<div class="col-md-offset-2 col-md-8">
{% if current_user.admin %}
<section class="account delete">
<h2>{{_('Export user data')}}</h2>
<p>
{{ _('You will get an email when the data is available to download.') }}
</p>
<div class="form-group">
<a class="btn btn-primary" style="margin-top:10px;" href="{{url_for('account.start_export', name=user.name)}}">{{_('Export user data')}}</a>
</div>
</section>
<section class="account delete">
<h2>{{_('Delete this account')}}</h2>
<div class="alert alert-danger">
<strong>{{ _('Danger Zone!') }}</strong> {{ _('By deleting this account, all the personal data will be removed from the server and third party services. This operation cannot be undone!') }}
</div>
<div class="form-group">
<input onkeyup="checkEmail(this.value)" class="form-control" id="delete" placeholder="Type your email to confirm that you want to delete it.">
<a id="deleteTrue" class="btn btn-primary" style="margin-top:10px; display:none;" href="{{url_for('account.delete', name=user.name)}}">{{_('Delete')}}</a>
</div>
</section>
{% endif %}
</div>
</div>
</div>
</section>
{% if current_user.admin %}
<script>
function checkEmail (txt) {
if (txt === '{{ user.email_addr }}') {
document.getElementById('deleteTrue').style.display='block';
} else {
document.getElementById('deleteTrue').style.display='none';
}
}
</script>
{% endif %}
{% if projects_created %}
{{render_grid_projects(projects_created, "Projects Owned", upload_method, current_user, id="created-projects", show_ownership=True)}}
{% endif %}
Expand Down
78 changes: 76 additions & 2 deletions templates/account/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,18 @@
<div class="col-md-offset-2 col-md-8">
<h1>{{ _('Create an account') }}</h1>

{{ render_form(form, action_url=url_for('account.register'), btn_class="btn btn-primary btn-block" )}}
<div id="ageCheck" class="form-inline">
<div class="form-group">
<p>{{_('To create an account you must be 16+ years old. Please enter your date of birth')}}</p>
<input class="form-control" id="day" placeholder="DD">
<input class="form-control" id="month" placeholder="MM">
<input class="form-control" id="year" placeholder="YYYY">
</div>
<button onclick="checkAge()" style="margin-top:15px;" class="btn btn-primary">Check age</button>
</div>

{{ render_form(form, form_id="register", action_url=url_for('account.register'), btn_class="btn btn-primary btn-block" )}}

<p class="text-center text-sm" style="margin-top:5px;">
<span class="label label-warning"><i class="fa fa-bullhorn"></i> {{ _('Note') }}</span>
{{ _('By click the') }}
Expand All @@ -17,10 +28,73 @@ <h1>{{ _('Create an account') }}</h1>
<a target="blank" href={{terms_of_use | safe}}>{{ _('terms of use') }} </a>{{ _('and') }}
<a href={{data_use | safe}}>{{ _('data') }}</a>.
</p>

</div>
</div>
</div>
</section>
<script src="{{url_for('static', filename='js/forms.js')}}" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.22.1/moment.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/tingle/0.13.2/tingle.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/tingle/0.13.2/tingle.min.js"></script>
<script>
var modal = new tingle.modal({
footer: true,
stickyFooter: false,
closeMethods: ['overlay', 'button', 'escape'],
closeLabel: "Close",
cssClass: ['custom-class-1', 'custom-class-2'],
onOpen: function() {
console.log('modal open');
},
onClose: function() {
console.log('modal closed');
window.location.href = '/';
},
beforeClose: function() {
// here's goes some logic
// e.g. save content before closing the modal
return true; // close the modal
return false; // nothing happens
}
});

// set content
modal.setContent("<h1>You must be 16+ years old to create an account</h1><p>You cannot create an account in this server unless you are 16+ years old. However, you can still participate as an anonymous user as you don't need an account for doing so.</p>");

// add a button
modal.addFooterBtn('OK', 'tingle-btn tingle-btn--primary', function() {
// here goes some logic
modal.close();
});

// add another button
// modal.addFooterBtn('Dangerous action !', 'tingle-btn tingle-btn--danger', function() {
// // here goes some logic
// modal.close();
// });

function checkAge () {
var day = document.getElementById('day').value;
var month = document.getElementById('month').value;
var year = document.getElementById('year').value;
var birthday = moment(new Date(year, month, day));
var yearsOld = moment().diff(birthday, 'year');
console.log(yearsOld)
if (yearsOld >= 16) {
document.getElementById('register').style.display='block';
document.getElementById('ageCheck').style.display='none';
localStorage.setItem('ageCheck', true);
} else {
modal.open();
}
}
</script>
<style>
#register {
display: block;
}
#ageCheck {
display: none;
}
</style>
{% endblock %}
59 changes: 37 additions & 22 deletions templates/account/signin.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,45 @@ <h3>{{_('Sign in with your {} account').format(config.BRAND)}}</h3>
<a href="{{ url_for('account.forgot_password') }}" class="btn btn-success">{{ _('Forgot Password') }}</a>
</p>
<!--
<p class="text-center">{{_('Not registered?')}} <a href="{{ url_for('account.register') }}">{{_('Sign up for free now')}}</a><br/>{{_('sign in/sign up through')}}</p>
<p class="text-center">{{_('Not registered?')}} <a href="{{ url_for('account.register') }}">{{_('Sign up for free now')}}</a></p>
{% if next is not none%}
{% if auth.twitter %}
<a href="{{ url_for('twitter.login', next=next) }}" class="btn btn-info btn-ssnn"><i class="fa-twitter"></i> {{ _('Twitter') }}</a>
{% endif %}
{% if auth.facebook %}
<a href="{{ url_for('facebook.login') }}" class="btn btn-primary btn-ssnn"><i class="fa fa-facebook"></i> {{ _('Facebook') }}</a>
{% endif %}
{% if auth.google %}
<a href="{{ url_for('google.login') }}" class="btn btn-warning btn-ssnn"><i class="fa fa-google-plus"></i> {{ _('Google') }}</a>
{% endif %}
{% else %}
{% if auth.twitter %}
<a href="{{ url_for('twitter.login') }}" class="btn btn-info btn-ssnn"><i class="fa fa-twitter"></i> {{ _('Twitter') }}</a>
{% endif %}
{% if auth.facebook %}
<a href="{{ url_for('facebook.login') }}" class="btn btn-primary btn-ssnn"><i class="fa fa-facebook"></i> {{ _('Facebook') }}</a>
{% endif %}
{% if auth.google %}
<a href="{{ url_for('google.login') }}" class="btn btn-warning btn-ssnn"><i class="fa fa-google-plus"></i> {{ _('Google') }}</a>
{% endif %}
{% endif %}
<div id="ssnn" style="display: none;">
{% if next is not none %}
{% if auth.twitter %}
<a href="{{ url_for('twitter.login', next=next) }}" class="btn btn-info btn-ssnn"><i class="fa-twitter"></i> {{ _('Twitter') }}</a>
{% endif %}
{% if auth.facebook %}
<a href="{{ url_for('facebook.login') }}" class="btn btn-primary btn-ssnn"><i class="fa fa-facebook"></i> {{ _('Facebook') }}</a>
{% endif %}
{% if auth.google %}
<a href="{{ url_for('google.login') }}" class="btn btn-warning btn-ssnn"><i class="fa fa-google-plus"></i> {{ _('Google') }}</a>
{% endif %}
{% else %}
{% if auth.twitter %}
<a href="{{ url_for('twitter.login') }}" class="btn btn-info btn-ssnn"><i class="fa fa-twitter"></i> {{ _('Twitter') }}</a>
{% endif %}
{% if auth.facebook %}
<a href="{{ url_for('facebook.login') }}" class="btn btn-primary btn-ssnn"><i class="fa fa-facebook"></i> {{ _('Facebook') }}</a>
{% endif %}
{% if auth.google %}
<a href="{{ url_for('google.login') }}" class="btn btn-warning btn-ssnn"><i class="fa fa-google-plus"></i> {{ _('Google') }}</a>
{% endif %}
{% endif %}
</div>
<p>
<span class="label label-warning"><i class="fa fa-bullhorn"></i> {{ _('Note') }}</span>
{{ _('By click the') }} <strong>{{ _('Sign in button') }}</strong> {{ _('below you are agreeing to
the') }} <a href={{url_for('help.tos')}}>{{ _('terms of use') }}</a> {{ _('and') }}
<a href={{data_use | safe}}>{{ _('data') }}</a>.
</p>
-->
</div>
</section>
<script>
if (localStorage.getItem('ageCheck')) {
document.getElementById('ssnn').style.display = 'block';
}
</script>
{% endblock %}
9 changes: 5 additions & 4 deletions templates/account/user_pref_metadata.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@
{% if form.data.admin %}
<h5><small>Submitted by: @{{form.data.admin}} {{form.data.time_stamp}}</small></h5>
{% endif %}
{% else %}
<div class="text-center", id="no-info-text">
<h4><b>There is no user preference/metadata information to display</b></h4>
</div>
{% endif %}
{% if form.data and not form.data.languages and not form.data.locations and not form.data.work_hours_from and not form.data.work_hours_to and not form.data.user_type %}
<div class="text-center", id="no-info-text">
<h4><b>There is no user preference/metadata information to display</b></h4>
</div>
{% endif %}
{% if can_update %}
<div class="text-center">
Expand Down
12 changes: 6 additions & 6 deletions templates/help/api.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ <h2>Projects API end point</h2>
<span class="label labe-warning"><i class="icon-bullhorn"></i> Note</span>
GET actions are limited to only 20 items by default,
you can use <em>limit</em> and <em>offset</em> to tune the number of results.
For further information read the <a href="http://docs.pybossa.com/api/intro/">documentation</a>.
For further information read the <a href="https://docs.pybossa.com/api/intro/">documentation</a>.
</p>
<p>You can also do <strong>queries using the API</strong>. For example, search for a specific project:</p>
<ul>
<li><a href="{{url_for('api.api_project', short_name='flickrperson')}}">{{url_for('api.api_project', short_name='flickrperson', _external=True)}}</a></li>
</ul>
<p>
For more information about the API please, see the <a href="http://docs.pybossa.com/api/intro/">documentation</a> and the <a href="http://docs.pybossa.com/api/crud/">step by step tutorial</a> that explores the usage of the API.
For more information about the API please, see the <a href="https://docs.pybossa.com/api/intro/">documentation</a> and the <a href="https://docs.pybossa.com/api/crud/">step by step tutorial</a> that explores the usage of the API.
</p>
<hr>
<h2>Tasks API end point</h2>
Expand All @@ -54,7 +54,7 @@ <h2>Tasks API end point</h2>
<span class="label labe-warning"><i class="icon-bullhorn"></i> Note</span>
GET actions are limited to only 20 items by default,
you can use <em>limit</em> and <em>offset</em> to tune the number of results.
For further information read the <a href="http://docs.pybossa.com/api/intro/">documentation</a>.
For further information read the <a href="https://docs.pybossa.com/api/intro/">documentation</a>.
</p>
<p>You can also do <strong>queries using the API</strong>. For example, get the tasks for a given project using the project id:</p>
<ul>
Expand All @@ -67,7 +67,7 @@ <h2>Tasks API end point</h2>
<li><a href="{{url_for('api.api_task', project_id=project_id, state='completed')}}">{{url_for('api.api_task', project_id=project_id, state='completed', _external=True)}}</a></li>
</ul>
<p>
For more information about the API please, see the <a href="http://docs.pybossa.com/api/intro/">documentation</a> and the <a href="http://docs.pybossa.com/api/crud/">step by step tutorial</a> that explores the usage of the API.
For more information about the API please, see the <a href="https://docs.pybossa.com/api/intro/">documentation</a> and the <a href="https://docs.pybossa.com/api/crud/">step by step tutorial</a> that explores the usage of the API.
</p>
<hr>
<h2>Task Runs API end point</h2>
Expand All @@ -82,14 +82,14 @@ <h2>Task Runs API end point</h2>
<span class="label labe-warning"><i class="icon-bullhorn"></i> Note</span>
GET actions are limited to only 20 items by default,
you can use <em>limit</em> and <em>offset</em> to tune the number of results.
For further information read the <a href="http://docs.pybossa.com/api/intro/">documentation</a>.
For further information read the <a href="https://docs.pybossa.com/api/intro/">documentation</a>.
</p>
<p>You can also do <strong>queries using the API</strong>. For example, get the task runs -in other words the answers for a given task- for a given project using the project id:</p>
<ul>
<li><a href="{{url_for('api.api_taskrun', project_id=project_id)}}">{{url_for('api.api_taskrun', project_id=project_id, _external=True)}}</a></li>
</ul>
<p>
For more information about the API please, see the <a href="http://docs.pybossa.com/api/intro/">documentation</a> and the <a href="http://docs.pybossa.com/api/crud/">step by step tutorial</a> that explores the usage of the API.
For more information about the API please, see the <a href="https://docs.pybossa.com/api/intro/">documentation</a> and the <a href="https://docs.pybossa.com/api/crud/">step by step tutorial</a> that explores the usage of the API.
</p>

</div>
Expand Down
22 changes: 22 additions & 0 deletions templates/projects/importers/iiif.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% extends "projects/base.html" %}
{% set active_page = "projects" %}
{% set active_project = project.short_name %}
{% set active_link = 'tasks' %}
{% set section = _('Import tasks') %}

{% from "_formhelpers.html" import render_form %}
{% block projectcontent %}
{{ helper.render_loading(loading_text) }}
<h3>{{_('From a IIIF manifest')}}</h3>
<span class="help-inline">{{_('For more information, please look at')}} <a href="http://docs.pybossa.com/user/overview/#importing-the-tasks-from-a-iiif-manifest" target="_blank">{{_('the documentation')}}.</a></span>
{{ render_form(form, action_url=url_for(target, short_name=project.short_name), action_text=_('Import'), btn_class="btn btn-primary") }}
{% endblock %}

{% block extrajs %}
<script>
$("#submit").off('click').on('click', function(){
var msg = "{{_('Importing data...')}}";
pybossaNotify(msg, true, "loading");
});
</script>
{% endblock %}
Loading

0 comments on commit 8e7e616

Please sign in to comment.