-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
42d2437
commit 252dc86
Showing
8 changed files
with
217 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
invenio_oauthclient/templates/semantic-ui/invenio_oauthclient/_macros.html
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,43 @@ | ||
{# -*- coding: utf-8 -*- | ||
|
||
This file is part of Invenio. | ||
Copyright (C) 2015-2020 CERN. | ||
|
||
Invenio is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
#} | ||
|
||
{% macro render_field(field, icon="", placeholder='', autofocus=False) %} | ||
<div class="field {% if field.errors %} error{% endif %}"> | ||
{%- set extras = dict(autofocus="") if autofocus else dict() %} | ||
{{field(class_="form-control", placeholder=placeholder or _(field.label.text | string), **extras)}} | ||
{%- if icon %} | ||
<i class="{{icon}}" aria-hidden="true" ></i> | ||
{%- endif%} | ||
</div> | ||
{% endmacro %} | ||
|
||
|
||
{% macro form_errors(form) %} | ||
{%- if form.errors %} | ||
<div class="ui negative message" role="alert"> | ||
{%- for field, errors in form.errors.items() %} | ||
{%- for error in errors %} | ||
<p>{{error}}</p> | ||
{%- endfor %} | ||
{%- endfor %} | ||
</div> | ||
{%- endif %} | ||
{% endmacro %} | ||
|
||
|
||
{% macro oauth_button(name, next=None) %} | ||
<div class="field"> | ||
<a class="fluid ui basic button large" | ||
href="{{url_for('invenio_oauthclient.login', remote_app=name, next=next or request.referrer)}}"> | ||
<i class="{{ name|lower() }} icon"></i> {{ | ||
_('Sign in with %(title)s', title=config.OAUTHCLIENT_REMOTE_APPS[name]['title']) | ||
}} | ||
</a> | ||
</div> | ||
{% endmacro %} |
17 changes: 17 additions & 0 deletions
17
invenio_oauthclient/templates/semantic-ui/invenio_oauthclient/base.html
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,17 @@ | ||
{# -*- coding: utf-8 -*- | ||
|
||
This file is part of Invenio. | ||
Copyright (C) 2015-2020 CERN. | ||
|
||
Invenio is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
#} | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
</head> | ||
<body> | ||
{%- block page_body %}{%- endblock page_body %} | ||
</body> | ||
</html> |
13 changes: 13 additions & 0 deletions
13
invenio_oauthclient/templates/semantic-ui/invenio_oauthclient/base_cover.html
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,13 @@ | ||
{# -*- coding: utf-8 -*- | ||
|
||
This file is part of Invenio. | ||
Copyright (C) 2015-2020 CERN. | ||
|
||
Invenio is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
#} | ||
{%- extends config.OAUTHCLIENT_BASE_TEMPLATE %} | ||
|
||
{%- block page_body %} | ||
{%- block panel %}{%- endblock panel %} | ||
{%- endblock page_body %} |
27 changes: 27 additions & 0 deletions
27
invenio_oauthclient/templates/semantic-ui/invenio_oauthclient/login_user.html
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,27 @@ | ||
{# -*- coding: utf-8 -*- | ||
|
||
This file is part of Invenio. | ||
Copyright (C) 2015-2020 CERN. | ||
|
||
Invenio is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
#} | ||
{%- extends config.OAUTHCLIENT_LOGIN_USER_TEMPLATE_PARENT %} | ||
|
||
{%- from "invenio_oauthclient/_macros.html" import oauth_button %} | ||
|
||
|
||
{%- block form_outer %} | ||
{% if config.OAUTHCLIENT_REMOTE_APPS %} | ||
<div class="ui form"> | ||
{% for name in config.OAUTHCLIENT_REMOTE_APPS.keys() %} | ||
{{ oauth_button(name, next=request.args.get('next')) }} | ||
{% endfor %} | ||
</div> | ||
|
||
<div class="ui horizontal divider"> | ||
Or | ||
</div> | ||
{% endif %} | ||
{{ super () }} | ||
{% endblock %} |
14 changes: 14 additions & 0 deletions
14
invenio_oauthclient/templates/semantic-ui/invenio_oauthclient/rejected.html
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,14 @@ | ||
{# -*- coding: utf-8 -*- | ||
|
||
This file is part of Invenio. | ||
Copyright (C) 2015-2020 CERN. | ||
|
||
Invenio is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
#} | ||
|
||
{%- extends config.OAUTHCLIENT_COVER_TEMPLATE %} | ||
|
||
{% block page_body %} | ||
{{ _('Rejected'} }} | ||
{% endblock %} |
13 changes: 13 additions & 0 deletions
13
invenio_oauthclient/templates/semantic-ui/invenio_oauthclient/settings/base.html
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,13 @@ | ||
{# -*- coding: utf-8 -*- | ||
|
||
This file is part of Invenio. | ||
Copyright (C) 2015-2018 CERN. | ||
|
||
Invenio is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
#} | ||
{%- extends "invenio_oauthclient/base.html" %} | ||
|
||
{%- block page_body %} | ||
{%- block settings_body %}{%- endblock settings_body %} | ||
{%- endblock page_body %} |
44 changes: 44 additions & 0 deletions
44
invenio_oauthclient/templates/semantic-ui/invenio_oauthclient/settings/index.html
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,44 @@ | ||
{# -*- coding: utf-8 -*- | ||
|
||
This file is part of Invenio. | ||
Copyright (C) 2015-2018 CERN. | ||
|
||
Invenio is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
#} | ||
|
||
{%- extends config.OAUTHCLIENT_SETTINGS_TEMPLATE %} | ||
|
||
{% from "invenio_oauthclient/_macros.html" import render_field, form_errors %} | ||
|
||
{% set panel_title = _("Linked accounts") %} | ||
{% set panel_icon = "linkify icon" %} | ||
|
||
{% block settings_body %} | ||
<div class="ui segment"> | ||
{% block oauth_body_text %} | ||
<p>{{ _('Tired of entering password for %(sitename)s every time you sign in? Set up single sign-on with one or more of the services below:', | ||
sitename=config.THEME_SITENAME) }}</p> | ||
{% endblock oauth_body_text %} | ||
</div> | ||
<div class="ui celled list"> | ||
{%- for s in services %} | ||
<div class="item"> | ||
<div class="ui basic segment"> | ||
{% block oauth_controls scoped %} | ||
<div class="right floated content"> | ||
{%- if s.account -%} | ||
<a href="{{url_for('invenio_oauthclient.disconnect', remote_app=s.appid)}}" class="ui compact basic button mini"><i class="times circle outline icon"></i> {{ _('Disconnect') }}</a> | ||
{%- else -%} | ||
<a href="{{url_for('invenio_oauthclient.login', remote_app=s.appid)}}" class="ui compact basic button mini"><i class="linkify icon"></i> {{ _('Connect') }}</a> | ||
{%- endif -%} | ||
</div> | ||
{% endblock oauth_controls %} | ||
<div>{% if s.icon %}<i class="{{s.icon}}"></i>{% endif %} {{s.title}} {% if s.account %}<i class="check icon green"></i>{% endif %}</div> | ||
<small>{{s.description}}</small> | ||
|
||
</div> | ||
</div> | ||
{%- endfor %} | ||
</div> | ||
{% endblock %} |
46 changes: 46 additions & 0 deletions
46
invenio_oauthclient/templates/semantic-ui/invenio_oauthclient/signup.html
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,46 @@ | ||
{# -*- coding: utf-8 -*- | ||
|
||
This file is part of Invenio. | ||
Copyright (C) 2015-2020 CERN. | ||
|
||
Invenio is free software; you can redistribute it and/or modify it | ||
under the terms of the MIT License; see LICENSE file for more details. | ||
#} | ||
|
||
{%- extends config.OAUTHCLIENT_SETTINGS_TEMPLATE %} | ||
|
||
{% from "invenio_oauthclient/_macros.html" import render_field, form_errors %} | ||
|
||
{% block page_body %} | ||
<div class="ui centered grid"> | ||
<div class="row"> | ||
{%- block signup_panel %} | ||
<div> | ||
{%- block signup_header %} | ||
<div class="ui center aligned header"> | ||
<div class="content"> | ||
{%- block signup_app_icon %} | ||
{% if app_icon -%} | ||
<i class="{{app_icon}}"></i> | ||
{% endif %} | ||
{%- endblock %} | ||
{{ _('Sign-up with %(title)s!', title=app_title) }} | ||
<div class="sub header"> | ||
{{ _('Fill in your details to complete your registration. You only have to do this once.') }} | ||
</div> | ||
</div> | ||
<hr /> | ||
</div> | ||
{% endblock %} | ||
{%- block signup_form %} | ||
<form name="edit" method="post" role="form"> | ||
{%- for field in form %} | ||
{{ render_field(field) }} | ||
{%- endfor %} | ||
</form> | ||
{%- endblock %} | ||
</div> | ||
{%- endblock %} | ||
</div> | ||
</div> | ||
{% endblock %} |