List Manager

This commit is contained in:
Romain Neutron
2012-02-02 11:26:06 +01:00
parent a332aebe68
commit dd1714fbfa
3 changed files with 139 additions and 49 deletions

View File

@@ -1,4 +1,4 @@
<div class="PNB PushBox" id="PushBox" style="display:none;">
<div class="PNB PushBox" id="PushBox" >
<div class="PNB" style="width:205px;">
<div class="PNB10">
<div class="PNB" style="height:80px;bottom:auto;text-align:center;">
@@ -55,6 +55,9 @@
</button>
</form>
</td>
<td>
<a href="#" class="list_manager">{% trans 'List Manager' %}</a>
</td>
<td class="options">
<button>{% trans 'Select all' %}</button>
<button>{% trans 'Deselect all' %}</button>
@@ -73,13 +76,25 @@
</div>
</div>
</div>
<div id="ListManager" class="PNB PushBox">
<div id="ListManager" class="PNB PushBox" style="display:none;">
<div class="PNB" style="width:320px;right:auto;">
<div class="PNB10 content all-lists">
{% include 'prod/actions/Feedback/lists-all.html.twig' %}
</div>
</div>
<div class="editor PNB" style="left:320px;">
<div class="welcome">
<h1>{% trans 'Welcome to the ListManager !' %}</h1>
{% if lists|length == 0 %}
<p class="welcome">
{% trans 'Start by creating one by using the "add" button on the left !' %}
</p>
{% else %}
<p class="welcome">
{% trans 'Select a list on the left and edit it !' %}
</p>
{% endif %}
</div>
</div>
</div>
<script type="text/javascript">

View File

@@ -1,11 +1,13 @@
{% import 'prod/actions/Feedback/ListsMacros.html.twig' as ListsMacros %}
<div class="PNB10">
<div class="PNB" style="height:120px;bottom:auto;">
<div class="PNB" style="height:40px;bottom:auto;">
<table>
<tr>
<td>
<form method="POST" action="/prod/lists/list/{{ id }}/update/">
<form method="POST" action="/prod/lists/list/{{ list.getId() }}/update/">
<label>{% trans 'List Name' %}</label>
<input name="name" value="{{ name }}"/>
<input name="name" value="{{ list.getName() }}"/>
</form>
</td>
<td>
@@ -16,55 +18,128 @@
</td>
</tr>
</table>
<input name="list-add-user" />
<a href="/prod/push/add-user/" class="user_adder">{% trans 'Add user' %}</a>
</div>
<div class="PNB" style="top:120px;">
<div class="PNB content user_content">
<p>
{% set length = '<span class="counter current">' ~ users.count() ~ '</span>' %}
{% trans %}
{{ length }} peoples
{% endtrans %}
</p>
<div class="badges">
{% for entry in users %}
<div class="badge badge_{{ entry.usr_id }}">
<input name="id" value="{{ entry.usr_id }}" type="hidden" />
<table>
<tr>
<td class="icon">
<img src="/skins/icons/user.png"/>
</td>
<td class="infos">
<div style="margin:5px 10px 5px;">
<table>
<tr>
<td colspan="3">
<span class="name">{{ entry.display_name }}</span>
<a href="#" class="deleter">
<img src="/skins/prod/Push/close_badge.png"/>
</a>
</td>
</tr>
<tr>
<td colspan="3">
<span class="subtite">{{ entry.company }}</span>
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
{% endfor %}
<form name="list-editor-search" method="POST" action="/prod/push/edit-list/{{ list.getId() }}/">
<div class="PNB" style="top:40px;height:40px;bottom:auto;">
<select name="like_field">
<option value="usr_login">
{% trans 'Push::filter on login' %}
</option>
<option value="name">
{% trans 'Push::filter on name' %}
</option>
<option value="pays">
{% trans 'Push::filter on countries' %}
</option>
<option value="societe">
{% trans 'Push::filter on companies' %}
</option>
<option value="usr_mail">
{% trans 'Push::filter on emails' %}
</option>
<option value="lastModel">
{% trans 'Push::filter on templates' %}
</option>
</select>
{% trans 'Push::filter starts' %}
<input type="text" value="" class="search" name="query">
<button type="submit">
{% trans 'boutton::chercher' %}
</button>
</div>
<div class="PNB" style="top:80px;height:120px;bottom:auto;">
<table style="table-layout:fixed;">
<tr>
<td style="width:20%;">
<label>
{% trans 'Activite' %}
</label>
<select size="5" multiple="multiple" name="Activity[]" style="width:80%;">
<option value="">{% trans 'All' %}</option>
{% for Activity in query.getRelatedActivities() %}
<option value="{{ Activity }}">{{ Activity }}</option>
{% endfor %}
</select>
</td>
<td style="width:20%;">
<label>
{% trans 'Template' %}
</label>
<select size="5" multiple="multiple" name="Template[]" style="width:80%;">
<option value="">{% trans 'All' %}</option>
{% for Template in query.getRelatedTemplates() %}
<option value="{{ Template }}">{{ Template }}</option>
{% endfor %}
</select>
</td>
<td style="width:20%;">
<label>
{% trans 'Company' %}
</label>
<select size="5" multiple="multiple" name="Company[]" style="width:80%;">
<option value="">{% trans 'All' %}</option>
{% for Company in query.getRelatedCompanies() %}
<option value="{{ Company }}">{{ Company }}</option>
{% endfor %}
</select>
</td>
<td style="width:20%;">
<label>
{% trans 'Country' %}
</label>
<select size="5" multiple="multiple" name="Country[]" style="width:80%;">
<option value="">{% trans 'All' %}</option>
{% for Code, Country in query.getRelatedCountries() %}
<option value="{{ Code }}">{{ Country }}</option>
{% endfor %}
</select>
</td>
<td style="width:20%;">
<label>
{% trans 'Position' %}
</label>
<select size="5" multiple="multiple" name="Position[]" style="width:80%;">
<option value="">{% trans 'All' %}</option>
{% for Position in query.getRelatedPositions() %}
<option value="{{ Position }}">{{ Position }}</option>
{% endfor %}
</select>
</td>
</tr>
</table>
</div>
<input type="hidden" name="page" value="" />
<input type="hidden" name="srt" value="{{ sort }}" />
<input type="hidden" name="ord" value="{{ ord }}" />
<input type="hidden" name="type" value="fragment" />
</form>
<div class="PNB content" style="top:200px;">
<div class="PNB10">
<div class="PNB" style="height:25px;bottom:auto;">
<p>
{% set length = '<span class="counter current">' ~ list.getEntries().count() ~ '</span>' %}
{% trans %}
{{ length }} peoples
{% endtrans %}
</p>
</div>
<div class="PNB list-editor-results" style="overflow-y:scroll;overflow-x:hidden;top:25px;bottom:25px;">
{{ ListsMacros.ResultTable(results, list, sort, ord) }}
</div>
<div class="PNB" style="top:auto;height:25px;">
{{ query.get_page() }} / {{ query.get_total_page() }}
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){
p4.ListManager.workOn({{ id }});
p4.ListManager.workOn({{ list.getId() }});
});
</script>

View File

@@ -11,7 +11,7 @@
{% for list in lists %}
{% set length = '<span class="counter">' ~ list.getEntries().count() ~ '</span>' %}
<li class="list">
<a href="/prod/lists/list/{{ list.getId() }}/" class="link">
<a href="/prod/push/edit-list/{{ list.getId() }}/" class="link">
<img src="/skins/prod/Push/list-icon.png" />
"{{ list.getName() }}"
{% trans %}