-
Notifications
You must be signed in to change notification settings - Fork 81
/
project_detail.html
110 lines (105 loc) · 4.94 KB
/
project_detail.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{% extends "organization/project_wrapper.html" %}
{% load i18n %}
{% block page_title %}{% trans "Resource detail:" %} {{ resource.name }} | {% endblock %}
{% block left-nav %}resources{% endblock %}
{% block content %}
<div class="col-md-12 content-single">
<div class="row">
<!-- Main text -->
<div class="col-md-12 main-text">
<div class="page-title">
<h2 class="short">{% trans "Resource detail" %}</h2>
<div class="top-btn pull-right">
<!-- Action buttons -->
{% if can_edit %}
<a class="btn btn-default btn-action btn-sm" href="{% url 'resources:project_edit' object.organization.slug object.slug resource.id %}" title="{% trans 'Edit resource' %}" aria-label="{% trans 'Edit resource' %}"><span class="glyphicon glyphicon-pencil"></span></a>
{% endif %}
{% if resource.archived %}
<a class="btn btn-default btn-action btn-sm" href="#undelete_resource_confirm" data-toggle="modal" title="{% trans 'Restore deleted resource' %}" aria-label="{% trans 'Restore deleted resource' %}"><span class="glyphicon glyphicon-repeat"></span></a>
{% else %}
{% if can_archive %}
<a class="btn btn-default btn-action btn-sm" href="#delete_resource_confirm" data-toggle="modal" title="{% trans 'Delete resource' %}" aria-label="{% trans 'Delete resource' %}"><span class="glyphicon glyphicon-trash"></span></a>
{% endif %}
{% endif %}
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<h2>
<span class="entity">{% trans "Resource" %} </span>{{ resource.name }}
{% if resource.archived %}
<span class="label label-danger">{% trans "Deleted" %}</span>
{% endif %}
</h2>
<div class="row">
<div class="media col-md-6">
<div class="media-left">
<img src="{{ resource.thumbnail }}" class="thumb-128">
</div>
<div class="media-body">
<p class="media-heading">{{ resource.description }}</p>
<table class="table table-condensed table-media">
<tr>
<td class="small text-nowrap">{% trans "File name" %}:</td>
<td class="small name-break">{{ resource.original_file }}</td>
</tr>
<tr>
<td class="small text-nowrap">{% trans "Uploaded on" %}:</td>
<td class="small">{% blocktrans with date=resource.last_updated user=resource.contributor.get_display_name %}{{ date }} by {{ user }}{% endblocktrans %}</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="panel-footer panel-buttons">
<a href="{{ resource.file.url }}" class="btn btn-primary" download="{{ resource.original_file }}">{% trans "Download" %}</a>
</div>
</div>
{% if not resource.archived %}
<!-- Attachments table -->
<div class="panel panel-default">
<div class="panel-body">
<h3>{% trans "Attached to" %}</h3>
{% if attachment_list %}
<table class="table table-hover datatable" data-paging-type="simple">
<thead>
<tr>
<th class="col-md-2">{% trans "Entity Class" %}</th>
<th class="col-md-8">{% trans "Entity Name or Description" %}</th>
<th class="col-md-2">{% trans "Detach" %}</th>
</tr>
</thead>
<tbody>
{% for attachment in attachment_list %}
<tr class="linked" onclick="window.document.location='{{ attachment.object.get_absolute_url }}';">
<td>{{ attachment.object.ui_class_name }}</td>
<td>{{ attachment.object.name }}</td>
<td>
<form method="POST" action="{% url 'resources:detach' object.organization.slug object.slug resource.id attachment.id %}?next={{ request.path }}">
{% csrf_token %}
<button type="submit" class="btn btn-danger btn-sm" role="button">
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span> {% trans "Detach" %}
</button>
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
{% trans "This resource is currently not attached to anything." %}
{% endif %}
</div>
</div>
{% endif %}
</div>
</div>
</div>
{% endblock %}
{% block form_modal %}
{% url 'resources:archive' object.organization.slug object.slug resource.id as archive_url %}
{% url 'resources:unarchive' object.organization.slug object.slug resource.id as unarchive_url %}
{% include 'resources/modal_archive.html' %}
{% include 'resources/modal_unarchive.html' %}
{% endblock %}