root / main / templates / collection / view-collection.html @ 4282f214
History | View | Annotate | Download (5.8 kB)
| 1 |
|
|---|---|
| 2 |
{% extends "template_profil.html" %}
|
| 3 |
{% load i18n %}
|
| 4 |
{% load localeurl_tags %}
|
| 5 |
|
| 6 |
{% block meta %}
|
| 7 |
<style type="text/css" title="currentStyle"> |
| 8 |
|
| 9 |
@import "/world/static/js/datatables/media/css/demo_page.css"; |
| 10 |
@import "/world/static/js/datatables/media/css/demo_table.css"; |
| 11 |
@import "http://invisible.sat.qc.ca/wp-content/themes/invisible/css/datatable_custom.css"; |
| 12 |
|
| 13 |
</style>
|
| 14 |
|
| 15 |
<script type="text/javascript" charset="utf-8"> |
| 16 |
$(document).ready(function() {
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
//on cache les section
|
| 21 |
$(".section-profile").hide(); |
| 22 |
|
| 23 |
|
| 24 |
//generate the table for the artworks
|
| 25 |
|
| 26 |
$('#table_list').dataTable( { |
| 27 |
|
| 28 |
"sPaginationType": "full_numbers", |
| 29 |
"aoColumns": [
|
| 30 |
{ "bSortable": false },
|
| 31 |
{ "bSortable": false },
|
| 32 |
null,
|
| 33 |
null,
|
| 34 |
{ "bSortable": false }
|
| 35 |
]} ); |
| 36 |
|
| 37 |
var fixHelper = function(e, ui) { |
| 38 |
ui.children().each(function() {
|
| 39 |
$(this).width($(this).width()); |
| 40 |
}); |
| 41 |
return ui;
|
| 42 |
}; |
| 43 |
|
| 44 |
$( "#table_list tbody" ).sortable({ |
| 45 |
|
| 46 |
helper: fixHelper,
|
| 47 |
handle: '.btn-drag', |
| 48 |
update: function(event, ui) { |
| 49 |
|
| 50 |
var positionArt = ui.item.index()+1; |
| 51 |
var idArt = ui.item.attr('id').match(/[0-9 -()+]+$/); |
| 52 |
|
| 53 |
$.post('/world/api/art/'+idArt+'/'+positionArt+'/', |
| 54 |
function(result){
|
| 55 |
alert('id:'+idArt+' , position:'+positionArt); |
| 56 |
} |
| 57 |
); |
| 58 |
|
| 59 |
|
| 60 |
} |
| 61 |
}); |
| 62 |
|
| 63 |
$( "#table_list tbody" ).disableSelection(); |
| 64 |
|
| 65 |
|
| 66 |
} ); |
| 67 |
|
| 68 |
|
| 69 |
</script>
|
| 70 |
|
| 71 |
|
| 72 |
<script type="text/javascript" src="/world/static/js/datatables/media/js/jquery.dataTables.min.js"></script> |
| 73 |
|
| 74 |
|
| 75 |
{% endblock %}
|
| 76 |
|
| 77 |
{% block content_profil %}
|
| 78 |
|
| 79 |
|
| 80 |
<article id="article-profil" class="profile-view"> |
| 81 |
<header id="header-profil"> |
| 82 |
<h1>{% trans "My collections" %}</h1> |
| 83 |
<h2>{{ c.title }}</h2> |
| 84 |
</header>
|
| 85 |
|
| 86 |
|
| 87 |
<ul class="profile-list"> |
| 88 |
<li class="element-list"> |
| 89 |
<span class="element-name">{% trans "Status" %}</span> |
| 90 |
<span class="element-value">{{c.get_status_display}}</span> |
| 91 |
</li>
|
| 92 |
<li class="element-list"> |
| 93 |
<img class="thumb-element" src="{{root}}th/{{c.thumbnail}}" alt="thumbnail"/> |
| 94 |
<span class="element-value"> |
| 95 |
<a target="_blank" href="/world/{{ request.LANGUAGE_CODE }}/collection/{{ c.id }}/">{%trans "Preview"%}</a><br/> |
| 96 |
{{c.created|date:'d.m.Y'}}<br/>
|
| 97 |
</span>
|
| 98 |
</li>
|
| 99 |
<li><hr/></li> |
| 100 |
<li class="element-list"> |
| 101 |
<span class="element-name">{% trans "Title" %}</span> |
| 102 |
<span class="element-value">{{c.title}}</span> |
| 103 |
</li>
|
| 104 |
<li class="setting"> |
| 105 |
<span class="element-name">{% trans "Description" %}</span> |
| 106 |
<span class="element-value">{{c.description}}</span> |
| 107 |
</li>
|
| 108 |
<li><hr/></li> |
| 109 |
<li class="element-list"> |
| 110 |
<span class="element-name">{% trans "Producer" %}</span> |
| 111 |
<span class="element-value">{{c.producer}}</span> |
| 112 |
</li>
|
| 113 |
<li><hr/></li> |
| 114 |
<li class="element-list"> |
| 115 |
<span class="element-name">{% trans "Director" %}</span> |
| 116 |
<span class="element-value">{{c.director}}</span> |
| 117 |
</li>
|
| 118 |
<li><hr/></li> |
| 119 |
<li class="element-list"> |
| 120 |
<span class="element-name">{% trans "Url" %}</span> |
| 121 |
<span class="element-value"><a href="{{c.url}}">{{c.url}}</a></span> |
| 122 |
</li>
|
| 123 |
<li><hr/></li> |
| 124 |
<li class="element-list"> |
| 125 |
<span class="element-name">{% trans "Year" %}</span> |
| 126 |
<span class="element-value">{{c.year}}</span> |
| 127 |
</li>
|
| 128 |
<li><hr/></li> |
| 129 |
</ul>
|
| 130 |
<div class="btn-profile"><a href="../../update-collection/{{c.id}}/" >{% trans "Update this collection" %}</a></div> |
| 131 |
<div class="btn-profile"><a href="../update-collection/{{c.id}}/">{% trans "Delete this collection" %}</a></div> |
| 132 |
</section>
|
| 133 |
|
| 134 |
<section class="section-profile"> |
| 135 |
<h3 class="title-sublist">artworks from the collection</h3> |
| 136 |
<div class="btn-profile btn-profile-add"><a href="../../upload-artwork/">add an artwork</a></div> |
| 137 |
<span id="msgRemove" style="display:none;">{% trans "Are you sure you want to remove this artwork from the collection?" %}</span> |
| 138 |
|
| 139 |
<table id="table_list" class="display" cellspacing="0" cellpadding="0" border="1" style="width:620px"> |
| 140 |
<thead>
|
| 141 |
<tr>
|
| 142 |
<th></th> |
| 143 |
<th>{% trans "Thumbnail" %}</th> |
| 144 |
<th>{% trans "Title" %}</th> |
| 145 |
<th>{% trans "State" %}</th> |
| 146 |
|
| 147 |
<th></th> |
| 148 |
|
| 149 |
</tr>
|
| 150 |
</thead>
|
| 151 |
<tbody>
|
| 152 |
{% for co in col %}
|
| 153 |
<tr id="idArt-{{co.art.id}}" class="positionArt-{{co.sequence}}"> |
| 154 |
|
| 155 |
<td><div class="btn-drag"></div></td> |
| 156 |
<td><a href="/world/profile/view-artwork/{{co.art.id}}/"><img src="{{root}}th/{{co.art.thumbnail}}" title="{{co.art.title}}" /></a></td> |
| 157 |
<td><a href="/world/profile/view-artwork/{{co.art.id}}/">{{co.art.title}}</a></td> |
| 158 |
<td></td> |
| 159 |
<td>
|
| 160 |
|
| 161 |
<a title="{% trans 'Delete' %}" class="btn-table btn-delete" href="#" onclick="removeFromCollection({{c.id}}, {{a.id}});"></a> |
| 162 |
<a title="{% trans 'update' %}" class="btn-table btn-edit" href="../../update-artwork/{{a.id}}/"></a> |
| 163 |
<a title="{% trans 'View' %}" class="btn-table btn-view" href="../../view-artwork/{{a.id}}/"></a> |
| 164 |
|
| 165 |
|
| 166 |
</td>
|
| 167 |
</tr>
|
| 168 |
|
| 169 |
{% endfor %}
|
| 170 |
</tbody>
|
| 171 |
</table>
|
| 172 |
|
| 173 |
|
| 174 |
|
| 175 |
</section>
|
| 176 |
</article>
|
| 177 |
{% endblock %}
|
| 178 |
|
| 179 |
|
| 180 |
|
