-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #142 from NickolausDS/v2-templates
feat: Add new v2 portal templates
- Loading branch information
Showing
27 changed files
with
965 additions
and
2 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
globus_portal_framework/templates/globus-portal-framework/v2/allowed-groups.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,55 @@ | ||
{%extends "globus-portal-framework/v2/base.html"%} | ||
|
||
{% load static %} | ||
{% load index_template %} | ||
|
||
{%block title%}Request Groups Access{%endblock%} | ||
|
||
{%block body%} | ||
|
||
<div class="container"> | ||
|
||
<div class="mt-4"> | ||
{% index_template 'components/messages.html' as it_mess %} | ||
{% include it_mess %} | ||
</div> | ||
|
||
<div class="card"> | ||
<div class="card-header"> | ||
You may request access to the following groups | ||
</div> | ||
<div class="card-body"> | ||
<ul> | ||
{% block allowed_groups_list %} | ||
{% for group in allowed_groups|dictsort:'name' %} | ||
<li> | ||
{{group.name}} | ||
{% if group.is_member == True %} | ||
{% block is_member_of_group %} | ||
<a class="btn btn-success py-0" target="_blank" | ||
href="https://app.globus.org/groups/{{group.uuid}}/about">You are a member</a> | ||
{% endblock %} | ||
{% else %} | ||
{% block is_not_member_of_group %} | ||
<a class="btn btn-primary py-0" target="_blank" | ||
href="https://app.globus.org/groups/{{group.uuid}}/about">Request Access</a> | ||
{% endblock %} | ||
{% endif %} | ||
</li> | ||
{% empty %} | ||
{% block no_group_configured %} | ||
<li>No allowed groups configured, this portal does not restrict which users can login.</li> | ||
{% endblock %} | ||
{% endfor %} | ||
{% endblock %} | ||
</ul> | ||
{% if not request.user.is_authenticated %} | ||
<p class="small"> | ||
If you are already a member of a group above, you can <a href="{% url 'social:begin' 'globus' %}?next=/">Login Now</a> | ||
</p> | ||
{% endif %} | ||
</div> | ||
</div> | ||
|
||
</div> | ||
{% endblock %} |
65 changes: 65 additions & 0 deletions
65
globus_portal_framework/templates/globus-portal-framework/v2/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,65 @@ | ||
{% load static index_template is_active %} | ||
|
||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<!-- Required meta tags --> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
|
||
{% block base_styling %} | ||
<link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap.min.css' %}" /> | ||
<script type="text/javascript" src="{% static 'js/fontawesome-all.min.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'js/jquery.min.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'js/popper.min.js' %}"></script> | ||
<script type="text/javascript" src="{% static 'bootstrap/js/bootstrap.min.js' %}"></script> | ||
{% endblock %} | ||
|
||
{% block search_head %}{% endblock %} | ||
|
||
{# Extras #} | ||
{%block headextras%} | ||
{% index_template 'globus-portal-framework/v2/components/base-head-extras.html' as bhe %} | ||
{% include bhe %} | ||
{%endblock%} | ||
|
||
<title>{%block title%}{%endblock%}</title> | ||
|
||
</head> | ||
<body> | ||
|
||
{% block base_nav %} | ||
{% index_template 'globus-portal-framework/v2/components/base-nav.html' as base_nav %} | ||
{% include base_nav %} | ||
{% endblock %} | ||
|
||
{% block breadcrumbs %} | ||
<nav aria-label="breadcrumb"> | ||
<ol class="breadcrumb"> | ||
{% block breadcrumb_items %} | ||
<li class="breadcrumb-item {% is_active request 'index-selection' %}"> | ||
<a class="h5" href="{% url 'index-selection' %}">{{globus_portal_framework.project_title}}</a> | ||
</li> | ||
{% endblock %} | ||
</ol> | ||
</nav> | ||
{% endblock %} | ||
|
||
{% block main_nav %}{% endblock %} | ||
|
||
{%block base_messages %} | ||
<div class="container my-3"> | ||
{% index_template 'globus-portal-framework/v2/components/messages.html' as it_messages %} | ||
{% include it_messages %} | ||
</div> | ||
{%endblock%} | ||
|
||
<!-- Page body --> | ||
{%block body%} | ||
{%endblock%} | ||
|
||
<!-- Page footer --> | ||
{% index_template 'globus-portal-framework/v2/components/footer.html' as it_footer %} | ||
{% include it_footer %} | ||
</body> | ||
</html> |
4 changes: 4 additions & 0 deletions
4
...us_portal_framework/templates/globus-portal-framework/v2/components/base-head-extras.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,4 @@ | ||
{% comment %} | ||
If you have anything else you would like to include in the html <head></head> | ||
section, you can specify it here. | ||
{% endcomment %} |
35 changes: 35 additions & 0 deletions
35
globus_portal_framework/templates/globus-portal-framework/v2/components/base-nav.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,35 @@ | ||
{% load static %} | ||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark"> | ||
<a class="navbar-brand" href="{% block project_url %}{{ project_url|default:'/' }}{% endblock %}"> | ||
{% block project_title %} | ||
{% if globus_portal_framework.index_data.tagline %} | ||
{{globus_portal_framework.index_data.name|default:'globus_portal_framework.index'}}: {{globus_portal_framework.index_data.tagline}} | ||
{% else %} | ||
{{globus_portal_framework.project_title}} | ||
{% endif %} | ||
{% endblock %} | ||
</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarSupportedContent"> | ||
<ul class="navbar-nav mr-auto"></ul> | ||
<ul class="navbar-nav my-lg-0"> | ||
{%if globus_portal_framework.auth_enabled and request.user.is_authenticated %} | ||
<li> | ||
<a class="nav-link" href="{% url 'logout' %}?next=/">Logout</a> | ||
</li> | ||
<li> | ||
<a class="nav-link" href="/">{{request.user.username }}</a> | ||
</li> | ||
{% elif globus_portal_framework.auth_enabled %} | ||
<li> | ||
<a class="nav-link btn btn-dark" href="{% url 'social:begin' 'globus' %}?next={{ request.get_full_path|urlencode }}"> | ||
<img src="{% static 'images/globus.png' %}" height="32px" width="32px" style="border-radius: 4px"> | ||
Login | ||
</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
</div> | ||
</nav> |
19 changes: 19 additions & 0 deletions
19
...s_portal_framework/templates/globus-portal-framework/v2/components/copy-to-clipboard.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,19 @@ | ||
<div class="collapse my-3" id="collapseExample"> | ||
<div class="card card-body"> | ||
<h5 class="text-center">Copy to Clipboard</h5> | ||
<div id="copy-area" class="alert alert-info" role="alert"> | ||
<div class="row"> | ||
<div class="pt-2 col-md-11 text-center"> | ||
<a id="get-link-url" href="{{copy_to_clipboard_link}}">{{copy_to_clipboard_link}}</a> | ||
</div> | ||
<div class="col-md-1"> | ||
<button id="copy-button" class="btn btn-primary btn-lg" | ||
onclick="copyToClipboard('get-link-url', 'copy-area', '#copy-button');" | ||
data-toggle="tooltip" data-placement="top" title="Copied!"> | ||
<i class="fas fa-clipboard"></i> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> |
54 changes: 54 additions & 0 deletions
54
globus_portal_framework/templates/globus-portal-framework/v2/components/dc-metadata.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,54 @@ | ||
<table class="table table-striped table-bordered"> | ||
<tbody> | ||
{% block detail_overview_datacite %} | ||
<tr> | ||
<td>Contributors</td> | ||
<td> | ||
{% for contributor in dc.contributors %} | ||
{{contributor.contributorName}} <br> | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Dates</td> | ||
<td> | ||
{% for d in dc.dates %} | ||
{{d.dateType}}: {{date}} <br> | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Formats</td> | ||
<td> | ||
{% for format in dc.formats %} | ||
{{format}}<br> | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Publication Year</td> | ||
<td>{{dc.publicationYear}}</td> | ||
</tr> | ||
<tr> | ||
<td>Publisher</td> | ||
<td>{{dc.publisher}}</td> | ||
</tr> | ||
<tr> | ||
<td>Resource Type</td> | ||
<td>{{dc.resourceType.resourceType}}</td> | ||
</tr> | ||
<tr> | ||
<td>Subjects</td> | ||
<td> | ||
{% for sub in dc.subjects %} | ||
{{sub.subject}}<br> | ||
{% endfor %} | ||
</td> | ||
</tr> | ||
<tr> | ||
<td>Version</td> | ||
<td>{{dc.version}}</td> | ||
</tr> | ||
{% endblock %} | ||
</tbody> | ||
</table> |
13 changes: 13 additions & 0 deletions
13
...al_framework/templates/globus-portal-framework/v2/components/detail-general-metadata.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 @@ | ||
<table class="table table-striped table-bordered"> | ||
<tbody> | ||
{% block project_metadata %} | ||
|
||
{% for field in detail_general_metadata %} | ||
<tr> | ||
<td>{{field.name}}</td> | ||
<td>{{field.value}}</td> | ||
</tr> | ||
{% endfor %} | ||
{% endblock %} | ||
</tbody> | ||
</table> |
61 changes: 61 additions & 0 deletions
61
globus_portal_framework/templates/globus-portal-framework/v2/components/detail-nav.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,61 @@ | ||
{% comment %} | ||
|
||
Requires the following fields: | ||
* https_url | ||
* title | ||
* globus_app_link | ||
{% endcomment %} | ||
|
||
<div class="card-header"> | ||
<nav class="navbar"> | ||
<a class="navbar-brand">{{title|default:'Result'}}</a> | ||
<ul class="nav nav-pills justify-content-end"> | ||
<li class="nav-item mx-1"> | ||
{% block detail_nav_transfer_sync_button %} | ||
<a | ||
{% if globus_app_link %} | ||
class="btn btn-primary nav-link active" target="_blank" href="{{globus_app_link}}" | ||
{% else %} | ||
class="btn btn-primary nav-link disabled" href="#" | ||
{% endif %} | ||
> | ||
<i class="fas fa-exchange-alt"></i> | ||
Transfer/Sync | ||
</a> | ||
{% endblock %} | ||
</li> | ||
<li class="nav-item mx-1"> | ||
{% block detail_nav_download_via_https_button %} | ||
<a | ||
{% if https_url %} | ||
class="btn btn-primary nav-link active" target="_blank" href="{{https_url}}" | ||
{% else %} | ||
class="btn btn-light nav-link disabled" href="#" | ||
{% endif %} | ||
|
||
> | ||
<i class="fas fa-cloud-download-alt"></i> | ||
Download via HTTPS | ||
</a> | ||
{% endblock %} | ||
</li> | ||
<li class="nav-item mx-1"> | ||
{% block detail_nav_get_link_button %} | ||
<a | ||
{% if https_url %} | ||
class="btn btn-primary nav-link active" data-toggle="collapse" href="#collapseExample" | ||
target="_blank" role="button" aria-expanded="false" aria-controls="collapseExample" | ||
{% else %} | ||
class="btn btn-light nav-link disabled" href="#" | ||
{% endif %} | ||
> | ||
<i class="fas fa-link"></i> | ||
Get link | ||
</a> | ||
{% endblock %} | ||
</li> | ||
{% block extra_nav_items %} | ||
{% endblock %} | ||
</ul> | ||
</nav> | ||
</div> |
File renamed without changes.
File renamed without changes.
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
39 changes: 39 additions & 0 deletions
39
globus_portal_framework/templates/globus-portal-framework/v2/components/search-facets.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,39 @@ | ||
{# This template can be used in place of the standard DGPF components/search-facets.html template #} | ||
{% for facet in search.facets %} | ||
<div class="card mb-3"> | ||
<div class="card-header"> | ||
{{facet.name}} | ||
</div> | ||
<div class="card-body my-0 py-0"> | ||
<ul class="list-group list-group-flush"> | ||
{% for field in facet.buckets %} | ||
<li class="list-group-item py-1"> | ||
<input type="checkbox" class="facet-checkbox mr-1" | ||
name="{{field.search_filter_query_key}}" | ||
value="{{field.value}}" | ||
{# Reset page to 1 if user facets on a paginated search #} | ||
onchange="customSearch(1);" autocomplete="off" | ||
{% if field.checked %} | ||
checked | ||
{% endif %} | ||
> | ||
{% block facet_value %} | ||
{% if field.filter_type == 'year' %} | ||
{{field.datetime|date:'Y'}} | ||
{% elif field.filter_type == 'month' %} | ||
{{field.datetime|date:'F Y'}} | ||
{% elif field.filter_type == 'day' %} | ||
{{field.datetime|date:'M d Y'}} | ||
{% elif field.filter_type in 'hour minute second' %} | ||
{{field.datetime|date:'M d Y H:i:s T'}} | ||
{% else %} | ||
{{field.value|default:'No Value'}} | ||
{% endif %} | ||
{% endblock %} | ||
<span class="badge badge-secondary" style="float: right">{{field.count}}</span> | ||
</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
</div> | ||
{% endfor %} |
10 changes: 10 additions & 0 deletions
10
globus_portal_framework/templates/globus-portal-framework/v2/components/search-nav.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,10 @@ | ||
<nav> | ||
<ul class="nav nav-tabs navbar-expand-lg"> | ||
<li class="ml-5 nav-item"> | ||
<a class="nav-link h5" href="{% url 'search-about' globus_portal_framework.index %}">About {{project_title}}</a> | ||
</li> | ||
<li class="nav-item"> | ||
<a class="nav-link h5" href="{% url 'search' globus_portal_framework.index %}">Search</a> | ||
</li> | ||
</ul> | ||
</nav> |
Oops, something went wrong.