Files
Phraseanet/templates/web/prod/actions/publish/publish.html.twig
Romain Neutron ec11550eab Update templates
2012-10-04 15:42:53 +02:00

93 lines
4.2 KiB
Twig

{% macro format_diapo(record) %}
{% import 'common/thumbnail.html.twig' as thumbnail %}
<div class="diapo">
{{thumbnail.format(record.get_thumbnail(), 100, 100, '', true, false)}}
</div>
{% endmacro %}
<style type="text/css">
.record_list .sortable.ui-sortable-placeholder{
width:112px;
height:118px;
position:relative;
float:left;
}
</style>
<div class="PNB" style="height:200px;bottom:auto;">
<div class="PNB10 record_list" style="overflow:auto;">
{% for record in publishing %}
<div class="sortable" style="position:relative;float:left;">
{{ _self.format_diapo(record) }}
<form>
<input type="hidden" name="sbas_id" value="{{record.get_sbas_id()}}" />
<input type="hidden" name="record_id" value="{{record.get_record_id()}}" />
</form>
</div>
{% endfor %}
</div>
</div>
<form class="main_form" method="post" action="/prod/feeds/entry/create/">
<input type="hidden" name="lst" value="{{ publishing.serializedList() }}" />
<div class="PNB" style="top:200px; bottom:50px;">
<div class="PNB" style="width:50%; right:auto;">
<div class="PNB10 fields">
{% set title = '' %}
{% set desc = '' %}
{% if publishing.basket() is not null %}
{% set title = publishing.basket().getName() %}
{% set desc = publishing.basket().getDescription() %}
{% endif %}
<label for="feed_add_title">{% trans 'publication : titre' %}</label>
<input class="required_text" type="text" name="title" id="feed_add_title" value="{{title}}" />
<label for="feed_add_subtitle">{% trans 'publication : sous titre' %}</label>
<textarea id="feed_add_subtitle" name="subtitle">{{desc}}</textarea>
<label for="feed_add_author_name">{% trans 'publication : autheur' %}</label>
<input class="required_text" type="text" name="author_name" id="feed_add_author_name" value="{{ user.get_display_name() }}" />
<label for="feed_add_author_mail">{% trans 'publication : email autheur' %}</label>
<input class="required_text" type="text" name="author_mail" id="feed_add_author_mail" value="{{ user.get_email() }}" />
</div>
</div>
<div class="PNB" style="width:50%;left:auto;">
<div class="PNB10 feeds">
<h1>{% trans 'Fils disponibles' %}</h1>
<div class="list">
{% for feed in feeds.get_feeds() %}
{% if feed.is_publisher(user) %}
<div class="feed {% if loop.index is odd%}odd{% endif %}">
<span>{{ feed.get_title() }}</span>
{% if feed.is_public() %}
<img src="/skins/icons/ligth-on.png" title="{% trans 'This feed is public' %}"/>
{% endif %}
<input type="hidden" value="{{ feed.get_id() }}"/>
</div>
{% endif %}
{% endfor %}
<input type="hidden" value="" name="feed_id" />
</div>
</div>
</div>
</div>
<div class="PNB" style="top:auto; height:50px; text-align:center;">
<div class="PNB10">
<button class="valid_form btn btn-inverse">{% trans 'boutton::publier' %}</button>
<button class="close_dialog btn btn-inverse">{% trans 'boutton::annuler' %}</button>
</div>
</div>
</form>
<script type="text/javascript">
$(document).ready(function(){
$('#modal_feed .record_list').sortable({
stop:function(event, ui){
var lst = [];
$('#modal_feed .record_list .sortable form').each(function(i, el){
lst.push($('input[name="sbas_id"]', el).val()+'_'+$('input[name="record_id"]', el).val());
});
$('#modal_feed form.main_form input[name="lst"]').val(lst.join(';'));
}
});
});
</script>