Skip to content

Commit

Permalink
Merge pull request #189 from Scifabric/remove-flask-oauth
Browse files Browse the repository at this point in the history
chore!: remove unused importers.
  • Loading branch information
teleyinex authored Feb 20, 2021
2 parents cea6ae8 + 2219497 commit 6276d13
Show file tree
Hide file tree
Showing 32 changed files with 57 additions and 99 deletions.
21 changes: 4 additions & 17 deletions templates/account/_helpers.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,16 @@

{% macro render_twitter_btn(project) %}
<a href="https://twitter.com/share" class="twitter-share-button"
data-text="{{ _('I\'ve done') }} {{project.c}} {{ _('tasks for the @PyBossa project:') }} {{project.name}}. {{ _('Do you want to help?') }} {{url_for('project.details',short_name=project.short_name,_external=True)}}"
data-text="{{ _('I\'ve done') }} {{project.c}} {{ _('tasks for the @PYBOSSA project:') }} {{project.name}}. {{ _('Do you want to help?') }} {{url_for('project.details',short_name=project.short_name,_external=True)}}"
data-count="none">{{ _('Tweet') }}</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
{% endmacro %}

{% macro render_googlePlus_btn(project) %}
<!-- Place this tag in your head or just before your close body tag. -->
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{parsetags: 'explicit'}
</script>

<!-- Place this tag where you want the +1 button to render. -->
<div class="g-plusone" data-size="medium" data-annotation="none" data-href="{{url_for('project.details',short_name=project.short_name,_external=True)}}"></div>

<!-- Place this render call where appropriate. -->
<script type="text/javascript">gapi.plusone.go();</script>
{% endmacro %}


{% macro render_user_profile(user, upload_method, settings, private=True) %}
<p><strong><i class="fa fa-user"></i> {{ _('Nick')}}:</strong> {{ user.name }}</p>
{% if private %}
<p><strong><i class="fa fa-envelope"></i> {{_('E-mail')}}:</strong> {{user.email_addr }}
<p><strong><i class="fa fa-envelope"></i> {{_('E-mail')}}:</strong> {{user.email_addr }}
{% if (user.valid_email == False) %}
{% if (user.confirmation_email_sent == False) %}
<a href="{{ url_for('account.confirm_email')}}" class="btn btn-warning btn-xs">Validate email</a>
Expand Down Expand Up @@ -78,7 +65,7 @@
{%- macro render_user_avatar_src(user, upload_method) %}
{%- if user.info.avatar %}
{%- if upload_method == 'rackspace'%}
{{ url_for('rackspace', filename=user.info.avatar, container=user.info.container)}}
{{ url_for('rackspace', filename=user.info.avatar, container=user.info.container)}}
{%- else %}
{{url_for('uploads.uploaded_file', filename=(user.info.container + '/' + user.info.avatar))}}
{% endif -%}
Expand Down Expand Up @@ -117,7 +104,7 @@
{% else %}
<li class="active">
<a href="#">{{ page }}</a>
</li>
</li>
{% endif %}
{% endif %}
{%- endfor %}
Expand Down
5 changes: 2 additions & 3 deletions templates/account/email/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ <h1 style="line-height:75px; padding-left:100px;">{% block subject %}{% endblock
</div>
<footer>
<div style="text-align:center;">
<p>Powered by <a href="http://pybossa.com">PyBossa</a></p>
<p>Follow us: <a href="http://twitter.com/pybossa">Twitter</a>, <a
href="https://plus.google.com/115359083217638640334/posts">Google+</a></p>
<p>Powered by <a href="http://pybossa.com">PYBOSSA</a></p>
<p>Follow us: <a href="http://twitter.com/pybossa">Twitter</a></p>
</div>
</footer>
</body>
Expand Down
4 changes: 2 additions & 2 deletions templates/account/email/blogupdate.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
***
***
[UNSUBSCRIBE]({{ url_for('account.update_profile', name=user_name, _external=True)}})
Powered by [PyBossa](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa), [Google+](https://plus.google.com/115359083217638640334/posts)
Powered by [PYBOSSA](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa)
4 changes: 2 additions & 2 deletions templates/account/email/deleteNotify.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ Regards,

***
[UNSUBSCRIBE]({{ url_for('account.update_profile', name=user['name'], _external=True)}})
Powered by [PyBossa](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa), [Google+](https://plus.google.com/115359083217638640334/posts)
Powered by [PYBOSSA](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa)
2 changes: 1 addition & 1 deletion templates/account/email/forgot_password.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "account/email/base.html" %}

{% block subject %}
PyBossa: {{ _('Recover your lost password') }}
PYBOSSA: {{ _('Recover your lost password') }}
{% endblock %}

{% block subtitle %}
Expand Down
4 changes: 2 additions & 2 deletions templates/account/email/forgot_password.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Regards,
{{ config.BRAND }} Team

***
Powered by: [PyBossa](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa), [Google+](https://plus.google.com/115359083217638640334/posts)
Powered by: [PYBOSSA](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa)
4 changes: 2 additions & 2 deletions templates/account/email/forgot_password_openid.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ Regards,
{{ config.BRAND }} Team

***
Powered by [PyBossa](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa), [Google+](https://plus.google.com/115359083217638640334/posts)
Powered by [PYBOSSA](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa)
4 changes: 2 additions & 2 deletions templates/account/email/inactive.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Cheers!

***
[UNSUBSCRIBE]({{ url_for('account.update_profile', name=user['name'], _external=True)}})
Powered by [PyBossa](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa), [Google+](https://plus.google.com/115359083217638640334/posts)
Powered by [PYBOSSA](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa)
4 changes: 2 additions & 2 deletions templates/account/email/inactive_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ All the best,
{{ BRAND }} team

***
Powered by [PyBossa](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa), [Google+](https://plus.google.com/115359083217638640334/posts)
Powered by [PYBOSSA](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa)
4 changes: 2 additions & 2 deletions templates/account/email/noncontributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Cheers!

***
[UNSUBSCRIBE]({{ url_for('account.update_profile', name=user['name'], _external=True)}})
Powered by [PyBossa](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa), [Google+](https://plus.google.com/115359083217638640334/posts)
Powered by [PYBOSSA](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa)
4 changes: 2 additions & 2 deletions templates/account/email/validate_account.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ Regards,
{{ config.BRAND }} Team

***
Powered by [PyBossa](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa), [Google+](https://plus.google.com/115359083217638640334/posts)
Powered by [PYBOSSA](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa)
4 changes: 2 additions & 2 deletions templates/account/email/validate_email.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ Regards,
{{ config.BRAND }} Team

***
Powered by [PyBossa](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa), [Google+](https://plus.google.com/115359083217638640334/posts)
Powered by [PYBOSSA](http://pybossa.com)
Follow us: [Twitter](http://twitter.com/pybossa)
2 changes: 1 addition & 1 deletion templates/account/email/weeklystats.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ <h3>Most active day of the week: {{active_day[0]}} with {{active_day[1]}} answer

<p><em>{{text | join }}| truncate(100) }}</em></p>

<p><a href="https://twitter.com/intent/tweet?text={{text | join | truncate(100) | urlencode}}&url={{url_for('project.details', short_name=project.short_name, _external=True)|urlencode}}&hashtags=crowdsourcing&via=PyBossa">Tweet it!</a></p>
<p><a href="https://twitter.com/intent/tweet?text={{text | join | truncate(100) | urlencode}}&url={{url_for('project.details', short_name=project.short_name, _external=True)|urlencode}}&hashtags=crowdsourcing&via=PYBOSSA">Tweet it!</a></p>

<h3>Top 5 registered crafters</h3>
<ol>
Expand Down
24 changes: 0 additions & 24 deletions templates/account/signin.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,6 @@ <h1>{{_('Sign in')}}</h1>
<a href="{{ url_for('account.forgot_password') }}">{{ _('Forgot Password') }}</a>
</p>
<p class="text-center">{{_('Not registered?')}} <a href="{{ url_for('account.register') }}">{{_('Sign up for free now')}}</a></p>

<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>
Expand Down
12 changes: 6 additions & 6 deletions templates/projects/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@
{% block projectcontent %}
<div class="row">
<div id="import_tasks" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Project details'), explanation=_('Edit the name, description, etc.'), link=url_for('project.update', short_name=project.short_name), link_action_text=_('Edit'), icon='info-circle')}}
{{ render_project_card_option(project, upload_method, title=_('Project details'), explanation=_('Edit the name, description, etc.'), link=url_for('project.update', short_name=project.short_name), link_action_text=_('Edit'), icon='info-circle', published=published)}}
</div>
<div id="export_tasks" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Task Settings'), explanation=_('Change the task settings: redundancy, priority, etc.'), link=url_for('project.task_settings', short_name=project.short_name), link_action_text=_('Settings'), icon='cog')}}
{{ render_project_card_option(project, upload_method, title=_('Task Settings'), explanation=_('Change the task settings: redundancy, priority, etc.'), link=url_for('project.task_settings', short_name=project.short_name), link_action_text=_('Settings'), icon='cog', published=published)}}
</div>
</div>

<div class="row">
<div id="import_tasks" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Delete the project'), explanation=_('Delete the project, tasks, task runs and answers.'), link=url_for('project.delete', short_name=project.short_name), link_action_text=_('Delete'), icon='trash')}}
{{ render_project_card_option(project, upload_method, title=_('Delete the project'), explanation=_('Delete the project, tasks, task runs and answers.'), link=url_for('project.delete', short_name=project.short_name), link_action_text=_('Delete'), icon='trash', published=published)}}
</div>
<div id="export_tasks" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Blog'), explanation=_('Write a blog post about your project.'), link=url_for('project.new_blogpost', short_name=project.short_name), link_action_text=_('Write'), icon='pencil')}}
{{ render_project_card_option(project, upload_method, title=_('Blog'), explanation=_('Write a blog post about your project.'), link=url_for('project.new_blogpost', short_name=project.short_name), link_action_text=_('Write'), icon='pencil', published=published)}}
</div>
</div>

{% if current_user.admin or current_user.id in project.owners_ids %}
<div class="row">
<div id="import_tasks" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Manage Co-owners'), explanation=_('Add/Remove Co-owners.'), link=url_for('project.coowners', short_name=project.short_name), link_action_text=_('Co-owners'), icon='user')}}
{{ render_project_card_option(project, upload_method, title=_('Manage Co-owners'), explanation=_('Add/Remove Co-owners.'), link=url_for('project.coowners', short_name=project.short_name), link_action_text=_('Co-owners'), icon='user', published=published)}}
</div>
<div id="export_project" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Export Project Report'), explanation=_('Export project report'), link=url_for('project.export_project_report', short_name=project.short_name, type='project', format='csv'), link_action_text=_('CSV'), icon='cloud-download')}}
{{ render_project_card_option(project, upload_method, title=_('Export Project Report'), explanation=_('Export project report'), link=url_for('project.export_project_report', short_name=project.short_name, type='project', format='csv'), link_action_text=_('CSV'), icon='cloud-download', published=published)}}
</div>
</div>
{% endif %}
Expand Down
8 changes: 4 additions & 4 deletions templates/projects/task_settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
{% block projectcontent %}
<div class="row">
<div id="task_scheduler" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Task Scheduler'), explanation=_('Change how the tasks are delivered to volunteers'), link=url_for('project.task_scheduler', short_name=project.short_name), link_action_text=_('Scheduler'), icon='cog')}}
{{ render_project_card_option(project, upload_method, title=_('Task Scheduler'), explanation=_('Change how the tasks are delivered to volunteers'), link=url_for('project.task_scheduler', short_name=project.short_name), link_action_text=_('Scheduler'), icon='cog', published=published)}}
</div>
<div id="task_priority" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Task Priority'), explanation=_('Change the priority of the tasks'), link=url_for('project.task_priority', short_name=project.short_name), link_action_text=_('Scheduler'), icon='sort-numeric-asc')}}
{{ render_project_card_option(project, upload_method, title=_('Task Priority'), explanation=_('Change the priority of the tasks'), link=url_for('project.task_priority', short_name=project.short_name), link_action_text=_('Scheduler'), icon='sort-numeric-asc', published=published)}}
</div>
</div>
<div class="row">
<div id="task_delete" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Delete Tasks'), explanation=_('Delete all the tasks and associated answers'), link=url_for('project.delete_tasks', short_name=project.short_name), link_action_text=_('Delete'), icon='trash')}}
{{ render_project_card_option(project, upload_method, title=_('Delete Tasks'), explanation=_('Delete all the tasks and associated answers'), link=url_for('project.delete_tasks', short_name=project.short_name), link_action_text=_('Delete'), icon='trash', published=published)}}
</div>
<div id="task_redundancy" class="col-md-6">
{{ render_project_card_option(project, upload_method, title=_('Tasks Redundancy'), explanation=_('Change the redundancy level for the tasks'), link=url_for('project.task_n_answers', short_name=project.short_name), link_action_text=_('Redundancy'), icon='repeat')}}
{{ render_project_card_option(project, upload_method, title=_('Tasks Redundancy'), explanation=_('Change the redundancy level for the tasks'), link=url_for('project.task_n_answers', short_name=project.short_name), link_action_text=_('Redundancy'), icon='repeat', published=published)}}
</div>
</div>
{% endblock %}
Loading

0 comments on commit 6276d13

Please sign in to comment.