Skip to content

Commit

Permalink
update filesfolders tour help (#1102), refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mikkonie committed Aug 22, 2023
1 parent 3ce1422 commit cb0bdc9
Show file tree
Hide file tree
Showing 22 changed files with 210 additions and 207 deletions.
7 changes: 2 additions & 5 deletions filesfolders/templates/filesfolders/_details_card.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
padding-right: 0;
width: 20px;
}

.table#sodar-ff-details-table tr td:nth-child(2) {
padding-left: 4px;
}
Expand All @@ -21,21 +20,18 @@
display: none;
}
}

@media screen and (max-width: 900px) {
.table#sodar-ff-details-table tr th:nth-child(5),
.table#sodar-ff-details-table tr td:nth-child(6) {
display: none;
}
}

@media screen and (max-width: 750px) {
.table#sodar-ff-details-table tr th:nth-child(3),
.table#sodar-ff-details-table tr td:nth-child(4) {
display: none;
}
}

@media screen and (max-width: 500px) {
.table#sodar-ff-details-table tr th:nth-child(2),
.table#sodar-ff-details-table tr td:nth-child(3) {
Expand All @@ -45,7 +41,8 @@
</style>

{% if can_view_data %}
<table class="table table-striped sodar-card-table" id="sodar-ff-details-table">
<table class="table table-striped sodar-card-table"
id="sodar-ff-details-table">
<thead>
{% include 'filesfolders/_list_header.html' with details_card_mode=True %}
</thead>
Expand Down
26 changes: 0 additions & 26 deletions filesfolders/templates/filesfolders/_file_buttons.html

This file was deleted.

26 changes: 26 additions & 0 deletions filesfolders/templates/filesfolders/_file_dropdown.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{% load rules %}

{# Projectroles dependency #}
{% load projectroles_common_tags %}

{% has_perm 'filesfolders.update_data_own' request.user file.project as can_update_own %}
{% has_perm 'filesfolders.update_data_all' request.user file.project as can_update_all %}

<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown"
type="button" data-toggle="dropdown" aria-expanded="false">
<i class="iconify" data-icon="mdi:cog"></i>
</button>
<div class="dropdown-menu dropdown-menu-right sodar-ff-file-dropdown">
{% if can_update_all or file.owner == request.user and can_update_own %}
<a href="{% url 'filesfolders:file_update' item=file.sodar_uuid %}"
class="dropdown-item" >
<i class="iconify" data-icon="mdi:lead-pencil"></i> Update File
</a>
<a href="{% url 'filesfolders:file_delete' item=file.sodar_uuid %}"
class="dropdown-item text-danger">
<i class="iconify" data-icon="mdi:close-thick"></i> Delete File
</a>
{% get_history_dropdown obj=file project=file.project as history_item %}
{{ history_item|safe }}
{% endif %}
</div>
29 changes: 20 additions & 9 deletions filesfolders/templates/filesfolders/_file_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,25 @@
{% get_flag_classes item.flag as flag_classes %}
{% endif %}
{% if item|get_class == 'Folder' %}
<a href="{% url 'filesfolders:list' folder=item.sodar_uuid %}" class="{{ flag_classes }}">{{ item.name|force_wrap:24|safe }}</a>
<a href="{% url 'filesfolders:list' folder=item.sodar_uuid %}"
class="{{ flag_classes }}">
{{ item.name|force_wrap:24|safe }}
</a>
{% elif item|get_class == 'HyperLink' %}
<a href="{{ item.url }}" target="_blank" class="{{ flag_classes }}">{{ item.name|force_wrap:24|safe }}</a>
<a href="{{ item.url }}" target="_blank"class="{{ flag_classes }}">
{{ item.name|force_wrap:24|safe }}
</a>
{% elif item|get_class == 'File' %}
<a href="{% url 'filesfolders:file_serve' file=item.sodar_uuid file_name=item.name %}" class="{{ flag_classes }}">{{ item.name|force_wrap:24|safe }}</a>
<a href="{% url 'filesfolders:file_serve' file=item.sodar_uuid file_name=item.name %}"
class="{{ flag_classes }}">
{{ item.name|force_wrap:24|safe }}
</a>
{% if allow_public_links and item.public_url and can_share_link %}
<a title="Public Link" href="{% url 'filesfolders:file_public_link' file=item.sodar_uuid %}" id="sodar-ff-link-public-{{ item.sodar_uuid }}" data-toggle="tooltip" data-placement="top">
<a href="{% url 'filesfolders:file_public_link' file=item.sodar_uuid %}"
class="sodar-ff-link-public"
id="sodar-ff-link-public-{{ item.sodar_uuid }}"
title="Public Link"
data-toggle="tooltip" data-placement="top">
<i class="iconify" data-icon="mdi:link-variant"></i>
</a>
{% endif %}
Expand All @@ -48,17 +60,16 @@
<td>{% get_user_html item.owner as user_html %}{{ user_html|safe }}</td>
{# Date column #}
<td>{{ item.date_modified|date:'Y-m-d H:i' }}</td>

{% if not details_card_mode %}
{# Action button column #}
<td class="sodar-ff-action-column">
<td class="sodar-ff-item-dropdown">
{% if can_update_all or item.owner == request.user and can_update_own %}
{% if item|get_class == 'Folder' %}
{% include 'filesfolders/_folder_buttons.html' with item_uuid=item.uuid %}
{% include 'filesfolders/_folder_dropdown.html' with item_uuid=item.uuid %}
{% elif item|get_class == 'HyperLink' %}
{% include 'filesfolders/_hyperlink_buttons.html' with link=item %}
{% include 'filesfolders/_hyperlink_dropdown.html' with link=item %}
{% elif item|get_class == 'File' %}
{% include 'filesfolders/_file_buttons.html' with file=file %}
{% include 'filesfolders/_file_dropdown.html' with file=file %}
{% endif %}
{% endif %}
</td>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div class="btn-group ml-auto" id="sodar-ff-buttons-list">
<div class="ml-auto">
<button class="btn btn-primary dropdown-toggle"
id="sodar-ff-file-ops-btn"
type="button" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
File Operations
</button>
<div class="dropdown-menu dropdown-menu-right">

<div class="dropdown-menu dropdown-menu-right" id="sodar-ff-file-ops-dropdown">
{# Folder #}
<a class="dropdown-item"
{% if folder %}
Expand All @@ -15,7 +15,6 @@
{% endif %}
<i class="iconify" data-icon="mdi:folder-plus"></i> Add Folder
</a>

{# Hyperlink #}
<a class="dropdown-item"
{% if folder %}
Expand All @@ -25,7 +24,6 @@
{% endif %}
<i class="iconify" data-icon="mdi:link-plus"></i> Add Link
</a>

{# File #}
<a class="dropdown-item"
{% if folder %}
Expand All @@ -35,7 +33,6 @@
{% endif %}
<i class="iconify" data-icon="mdi:upload"></i> Upload File
</a>

{# Move Selected #}
<a class="dropdown-item"
href="javascript:{}"
Expand All @@ -45,7 +42,6 @@
return false;">
<i class="iconify" data-icon="mdi:arrow-right-thick"></i> Move Selected
</a>

{# Delete Selected #}
<a class="dropdown-item text-danger"
href="javascript:{}"
Expand Down
3 changes: 1 addition & 2 deletions filesfolders/templates/filesfolders/_flag_select.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@
</label>
{% endfor %}
<br /><small id="hint_id_flag" class="text-muted">{{ form.flag.help_text }}</small>

</div>
</div>
19 changes: 0 additions & 19 deletions filesfolders/templates/filesfolders/_folder_buttons.html

This file was deleted.

19 changes: 19 additions & 0 deletions filesfolders/templates/filesfolders/_folder_dropdown.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{# Projectroles dependency #}
{% load projectroles_common_tags %}

<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown"
type="button" data-toggle="dropdown" aria-expanded="false">
<i class="iconify" data-icon="mdi:cog"></i>
</button>
<div class="dropdown-menu dropdown-menu-right sodar-ff-folder-dropdown">
<a href="{% url 'filesfolders:folder_update' item=item.sodar_uuid %}"
class="dropdown-item" >
<i class="iconify" data-icon="mdi:lead-pencil"></i> Update Folder
</a>
<a href="{% url 'filesfolders:folder_delete' item=item.sodar_uuid %}"
class="dropdown-item text-danger">
<i class="iconify" data-icon="mdi:close-thick"></i> Delete Folder
</a>
{% get_history_dropdown obj=folder project=folder.project as history_item %}
{{ history_item|safe }}
</div>
19 changes: 0 additions & 19 deletions filesfolders/templates/filesfolders/_hyperlink_buttons.html

This file was deleted.

19 changes: 19 additions & 0 deletions filesfolders/templates/filesfolders/_hyperlink_dropdown.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{# Projectroles dependency #}
{% load projectroles_common_tags %}

<button class="btn btn-secondary dropdown-toggle sodar-list-dropdown"
type="button" data-toggle="dropdown" aria-expanded="false">
<i class="iconify" data-icon="mdi:cog"></i>
</button>
<div class="dropdown-menu dropdown-menu-right sodar-ff-hyperlink-dropdown">
<a href="{% url 'filesfolders:hyperlink_update' item=link.sodar_uuid %}"
class="dropdown-item">
<i class="iconify" data-icon="mdi:lead-pencil"></i> Update Link
</a>
<a href="{% url 'filesfolders:hyperlink_delete' item=link.sodar_uuid %}"
class="dropdown-item text-danger">
<i class="iconify" data-icon="mdi:close-thick"></i> Delete Link
</a>
{% get_history_dropdown obj=link project=link.project as history_item %}
{{ history_item|safe }}
</div>
4 changes: 2 additions & 2 deletions filesfolders/templates/filesfolders/_list_header.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<tr>
<th colspan="2">Name</th>
<th colspan="2" class="sodar-ff-header-item">Item</th>
<th class="text-right">Size</th>
<th>Description</th>
<th>Owner</th>
<th>Updated</th>
{% if not details_card_mode %}
<th></th>
<th id="sodar-ff-list-header-select">
<th id="sodar-ff-header-select">
{% if can_update_own or can_update_all %}
<input class="sodar-checkbox" type="checkbox"
onchange="checkAll(this)" name="check_all"
Expand Down
4 changes: 3 additions & 1 deletion filesfolders/templates/filesfolders/_search_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
{% autoescape off %}{{ item_display_name }}{% endautoescape %}
</a>
{% if item|get_class == 'File' and allow_public_links and item.public_url and can_share_link %}
<a title="Public Link" href="{% url 'filesfolders:file_public_link' file=item.sodar_uuid %}" id="sodar-ff-link-public-{{ item.sodar_uuid }}">
<a href="{% url 'filesfolders:file_public_link' file=item.sodar_uuid %}"
title="Public Link"
id="sodar-ff-link-public-{{ item.sodar_uuid }}">
<i class="iconify" data-icon="mdi:link-variant"></i>
</a>
{% endif %}
Expand Down
8 changes: 0 additions & 8 deletions filesfolders/templates/filesfolders/_search_results.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,12 @@
.table#sodar-ff-search-table thead tr th:nth-child(2) {
width: 75px !important;
}

.table#sodar-ff-search-table tbody tr td:nth-child(2) {
width: 75px !important;
}

.table#sodar-ff-search-table thead tr th:nth-child(4) {
width: 75px !important;
}

.table#sodar-ff-search-table tbody tr td:nth-child(4) {
width: 75px !important;
}
Expand All @@ -28,21 +25,18 @@
display: none;
}
}

@media screen and (max-width: 1100px) {
.table#sodar-ff-search-table tr th:nth-child(2),
.table#sodar-ff-search-table tr td:nth-child(2) {
display: none;
}
}

@media screen and (max-width: 900px) {
.table#sodar-ff-search-table tr th:nth-child(5),
.table#sodar-ff-search-table tr td:nth-child(5) {
display: none;
}
}

@media screen and (max-width: 600px) {
.table#sodar-ff-search-table tr th:nth-child(3),
.table#sodar-ff-search-table tr td:nth-child(3) {
Expand All @@ -52,7 +46,6 @@
</style>

{% if search_results.all.items|length > 0 %}

{% include 'projectroles/_search_header.html' with search_title=search_results.all.title result_count=search_results.all.items|length %}

<table class="table table-striped sodar-card-table sodar-search-table" id="sodar-ff-search-table">
Expand All @@ -75,5 +68,4 @@
</table>

{% include 'projectroles/_search_footer.html' %}

{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ <h3>
</div>
</div>
</form>

</div>

{% endblock projectroles_extend %}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ <h3>Confirm File Deletion</h3>
<div class="alert alert-warning" role="alert">
Do you really want to delete the file "{{ object.name }}"?
</div>

<form method="post">
{% csrf_token %}
<div class="row">
Expand Down
2 changes: 0 additions & 2 deletions filesfolders/templates/filesfolders/file_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ <h3>
<div class="container-fluid sodar-page-container">
<form method="post" enctype="multipart/form-data">
{% csrf_token %}

{{ form.file | as_crispy_field }}
{{ form.unpack_archive | as_crispy_field }}
{{ form.folder | as_crispy_field }}
Expand Down Expand Up @@ -90,7 +89,6 @@ <h3>

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

<!-- Filesfolders Javascript -->
<script type="text/javascript" src="{% static 'filesfolders/js/filesfolders.js' %}"></script>
{% endblock javascript %}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ <h3>Confirm Folder Deletion</h3>
</div>
</form>
{% endif %}

</div>

{% endblock projectroles_extend %}
Loading

0 comments on commit cb0bdc9

Please sign in to comment.