-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
templates: add semantic ui #207
Merged
zzacharo
merged 1 commit into
inveniosoftware:master
from
KonstantinaStoikou:semantic-ui
Jun 22, 2020
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 %} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as for @kprzerwa were you able how the errors are rendered?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't render form_errors because it is used only in the
signup.html
and to view that file I need to setup the Github authorization.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not super fast to do, clue how to solve in:
inveniosoftware/invenio-accounts#325
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created dedicate issue: #209