Browser templates

This commit is contained in:
Romain Neutron
2012-01-11 20:59:18 +01:00
parent 94abb51fe8
commit 810e42a15d
3 changed files with 78 additions and 10 deletions

View File

@@ -2,7 +2,7 @@
<div class="PNB header" style="height:40px;bottom:auto;"> <div class="PNB header" style="height:40px;bottom:auto;">
<table> <table>
<tr> <tr>
<td> <td style="width:230px;">
<a href="#" class="back"> <a href="#" class="back">
<img src="/skins/prod/Basket/Browser/BASKET_LIST.png"/> <img src="/skins/prod/Basket/Browser/BASKET_LIST.png"/>
{% trans 'Back to basket list' %} {% trans 'Back to basket list' %}
@@ -29,10 +29,46 @@
</tr> </tr>
</table> </table>
</div> </div>
<div class="PNB" style="top:40px;bottom:auto;height:160px;">
</div> {% set top = 0 %}
<div class="PNB" style="height:40px;bottom:auto;top:200px;">
{% if Basket.getPusher() %}
{% set top = top + 40 %}
<div class="PNB" style="top:40px;bottom:auto;height:40px;background-color:#404040;">
<div class="PNB10">
<p>
{% set user_name = '<a href="/prod/tooltip/user/' ~ Basket.getPusher().get_id() ~ '/" class="userTips">' ~ Basket.getPusher().get_display_name() ~ '</a>' %}
{% trans %}
Received from {{ user_name }}
{% endtrans %}
</p>
</div>
</div>
{% endif %}
{% if Basket.getValidation() %}
{% set top = top + 160 %}
<div class="PNB" style="top:40px;bottom:auto;height:160px;background-color:#404040;">
<div class="PNB10">
<p>
{% set list_participants = '' %}
{% for Participant in Basket.getValidation().getParticipants() %}
{% set list_participants = list_participants ~ '<a href="/user/{{ Participant.getUser().get_id() }}/">
{{ Participant.getUser().get_display_name }}
</a>' %}
{% endfor %}
{% trans %}
Sent for validation to {{ list_participants }}
{% endtrans %}
</p>
</div>
</div>
{% endif %}
{% set top = top + 40 %}
<div class="PNB" style="height:40px;bottom:auto;top:{{ top }}px;">
<div class="PNB10">
{% set ElementsCount = Basket.getElements().count() %} {% set ElementsCount = Basket.getElements().count() %}
{% if ElementsCount == 0 %} {% if ElementsCount == 0 %}
{% trans 'No records' %} {% trans 'No records' %}
@@ -41,8 +77,33 @@
{% else %} {% else %}
{% trans %}{{ ElementsCount }} records{% endtrans %} {% trans %}{{ ElementsCount }} records{% endtrans %}
{% endif %} {% endif %}
</div>
</div> </div>
<div class="PNB" style="top:240px;">
{% set top = top + 40 %}
{% import 'common/thumbnail.html' as thumbnail %}
<div class="PNB" style="top:{{ top }}px;">
<div class="PNB10">
{% for BasketElement in Basket.getElements() %}
{% set record = BasketElement.getRecord() %}
<div class="diapo" style="width:150px; height:180px;">
<div class='titre'>
{{record.get_original_name()}}
</div>
<div>
{{thumbnail.format(record.get_thumbnail,120,120, '', session, true)}}
</div>
<div style='position:absolute; bottom:0px; left:0px; height:20px'>
<div class="previewTips" tooltipsrc="/prod/tooltip/preview/{{record.get_sbas_id()}}/{{record.get_record_id()}}/"></div>
<img class="infoTips" tooltipsrc="/prod/tooltip/tc_datas/{{record.get_sbas_id()}}/{{record.get_record_id()}}/" src="/skins/icons/info.gif"/>
</div>
</div>
{% endfor %}
</div>
</div> </div>
</div> </div>

View File

@@ -110,7 +110,7 @@
var results = $('.results', $container); var results = $('.results', $container);
results.removeClass('loading').append(data); results.removeClass('loading').append(data);
activateLinks(results); activateLinks(results);
active_archiver(results);
return; return;
} }
@@ -147,6 +147,7 @@
return false; return false;
}); });
active_archiver($('.Basket', $container));
return; return;
} }
@@ -172,7 +173,13 @@
return false; return false;
}); });
}
function active_archiver($scope)
{
$('.userTips', $scope).tooltip();
$('a.archive_toggler', $scope).bind('click', function(){ $('a.archive_toggler', $scope).bind('click', function(){
var $this = $(this), parent = $this.parent(); var $this = $(this), parent = $this.parent();

View File

@@ -66,7 +66,7 @@
{% if Basket.getPusher() %} {% if Basket.getPusher() %}
<p> <p>
{% set user_name = '<a href="/prod/tooltip/user/' ~ Basket.getPusher().get_id() ~ '/" class="userTips">' ~ Basket.getPusher().get_display_name() ~ '</a>' %} {% set user_name = '<a href="#" tooltipsrc="/prod/tooltip/user/' ~ Basket.getPusher().get_id() ~ '/" class="userTips">' ~ Basket.getPusher().get_display_name() ~ '</a>' %}
{% trans %} {% trans %}
Received from {{ user_name }} Received from {{ user_name }}
{% endtrans %} {% endtrans %}
@@ -78,9 +78,9 @@
<p> <p>
{% set list_participants = '' %} {% set list_participants = '' %}
{% for Participant in Basket.getValidation().getParticipants() %} {% for Participant in Basket.getValidation().getParticipants() %}
{% set list_participants = list_participants ~ '<a href="/user/{{ Participant.getUser().get_id() }}/"> {% set list_participants = list_participants ~ '<a href="/user/' ~ Participant.getUser().get_id() ~ '/">' %}
{{ Participant.getUser().get_display_name }} {% set list_participants = list_participants ~ Participant.getUser().get_display_name %}
</a>' %} {% set list_participants = list_participants ~ '</a>' %}
{% endfor %} {% endfor %}
{% trans %} {% trans %}
Sent for validation to {{ list_participants }} Sent for validation to {{ list_participants }}