Skip to content

Commit

Permalink
add irods access ticket tour help (#1583)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Aug 14, 2023
1 parent e7fcd67 commit f25d752
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 8 deletions.
114 changes: 107 additions & 7 deletions samplesheets/templates/samplesheets/irods_access_tickets.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,18 @@
{% endblock css %}

{% block projectroles_extend %}

{% has_perm 'samplesheets.view_sheet' request.user project as can_view_ticket %}

<div class="row sodar-subtitle-container">
<h3>iRODS Access Tickets</h3>
<div class="ml-auto">
<a href="{% url 'samplesheets:project_sheets' project=project.sodar_uuid %}"
class="btn btn-secondary mr-1" role="button">
class="btn btn-secondary mr-1" role="button" id="sodar-ss-btn-back">
<i class="iconify" data-icon="mdi:arrow-left-circle"></i> Project Sheets
</a>
<a href="{% url 'samplesheets:irods_ticket_create' project=project.sodar_uuid %}"
class="btn btn-primary" role="button">
class="btn btn-primary" role="button" id="sodar-ss-btn-ticket-create">
<i class="iconify" data-icon="mdi:plus-thick"></i> Create Ticket
</a>
</div>
Expand Down Expand Up @@ -116,7 +117,9 @@ <h3>iRODS Access Tickets</h3>
<i class="iconify" data-icon="mdi:clipboard-text-multiple"></i>
</button>
</td>
<td class="nowrap {% if not ticket.is_active %}text-strikethrough{% endif %} sodar-ss-ticket-item-str">
<td class="nowrap
{% if not ticket.is_active %}text-strikethrough{% endif %}
sodar-ss-ticket-item-str">
<code>{{ ticket.ticket }}</code>
</td>
{% if ticket.user %}
Expand All @@ -127,7 +130,9 @@ <h3>iRODS Access Tickets</h3>
<td class="text-muted">N/A</td>
{% endif %}
<td class="nowrap">{{ ticket.get_date_created }}</td>
<td class="nowrap {% if not ticket.date_expires %}text-muted{% elif not ticket.is_active %}text-danger{% endif %} sodar-ss-ticket-item-expiry">
<td class="nowrap
{% if not ticket.date_expires %}text-muted{% elif not ticket.is_active %}text-danger{% endif %}
sodar-ss-ticket-item-expiry">
{% if not ticket.is_active %}
Expired
{% elif ticket.date_expires %}
Expand All @@ -137,7 +142,8 @@ <h3>iRODS Access Tickets</h3>
{% endif %}
</td>
<td class="text-right">
<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown"
<button class="btn btn-secondary dropdown-toggle
sodar-list-dropdown sodar-ss-ticket-dropdown"
type="button" data-toggle="dropdown" aria-expanded="false">
<i class="iconify" data-icon="mdi:cog"></i>
</button>
Expand Down Expand Up @@ -174,7 +180,101 @@ <h3>iRODS Access Tickets</h3>
{{ block.super }}
{# Tour content #}
<script type="text/javascript">
tourEnabled = false;
// TODO: Tour
tourEnabled = true;

tour.addStep('irods_ticket', {
title: 'iRODS Access Tickets',
text: 'In this view you can manage access tickets for iRODS ' +
'collections in the project sample data repository. These ' +
'tickets grant read-only access to collections without the ' +
'need for logging in to iRODS. This is usable when e.g. ' +
'integrating data from SODAR to external software.',
advanceOn: '.docs-link click',
showCancelLink: true
});

tour.addStep('irods_ticket_warning', {
title: 'iRODS Access Warning',
text: 'WARNING: Anyone with the URL and network access to your iRODS ' +
'server can access thes collections regardless of their ' +
'project roles. Care should be taken in what is shared ' +
'publicly and to whom tickets are provided.',
advanceOn: '.docs-link click',
showCancelLink: true
});

if ($('#sodar-ss-version-list').length) {
tour.addStep('irods_ticket_list', {
title: 'iRODS Access Ticket List',
text: 'This list displays the iRODS access tickets created for this ' +
'project.',
attachTo: '#sodar-ss-version-list top',
advanceOn: '.docs-link click',
showCancelLink: true
});
}

if ($('.sodar-ss-ticket-item-title').length) {
tour.addStep('irods_ticket_title', {
title: 'iRODS Access Ticket Title',
text: 'The title of the ticket is displayed here. It consists of the ' +
'collection the ticket targets along with an optional string ' +
'identified or the ticket creation timestamp. The title links ' +
'to the anonymous ticket URL via WebDAV. The column also ' +
'includes a link for copying the URL into the clipboard.',
attachTo: '.sodar-ss-ticket-item-title top',
advanceOn: '.docs-link click',
showCancelLink: true
});
}

if ($('.sodar-ss-ticket-item-str').length) {
tour.addStep('irods_ticket_str', {
title: 'iRODS Access Ticket String',
text: 'The access ticket string is displayed here.',
attachTo: '.sodar-ss-ticket-item-str top',
advanceOn: '.docs-link click',
showCancelLink: true
});
}

if ($('.sodar-ss-ticket-item-expiry').length) {
tour.addStep('irods_ticket_expiry', {
title: 'iRODS Access Ticket Expiration',
text: 'The expiration date is displayed here.',
attachTo: '.sodar-ss-ticket-item-expiry top',
advanceOn: '.docs-link click',
showCancelLink: true
});
}

if ($('.sodar-ss-ticket-dropdown').length) {
tour.addStep('irods_ticket_dropdown', {
title: 'iRODS Access Ticket Dropdown',
text: 'From the dropdown associated with a ticket, you can update ' +
'or delete it.',
attachTo: '.sodar-ss-ticket-dropdown left',
advanceOn: '.docs-link click',
showCancelLink: true
});
}

tour.addStep('irods_ticket_create', {
title: 'iRODS Access Ticket Creation',
text: 'Click on this button to create a new access ticket. You will ' +
'be taken to a form where you can set the ticket collection ' +
'and optional expiration date.',
attachTo: '#sodar-ss-btn-ticket-create left',
advanceOn: '.docs-link click',
showCancelLink: true
});

tour.addStep('sheets_btn_back', {
title: 'Back to Project Sample Sheets',
text: 'Click on this button to return to the project sample sheets.',
attachTo: '#sodar-ss-btn-back left',
advanceOn: '.docs-link click',
showCancelLink: true
});
</script>
{% endblock javascript %}
1 change: 0 additions & 1 deletion samplesheets/templates/samplesheets/irods_requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ <h3>iRODS Delete Requests</h3>

{% block javascript %}
{{ block.super }}

<script type="text/javascript" src="{% static 'samplesheets/js/irods_request.js' %}"></script>

{# Tour content #}
Expand Down

0 comments on commit f25d752

Please sign in to comment.