Porting refactor trash to 4.1

This commit is contained in:
Mike Ng
2018-03-01 15:14:49 +04:00
parent 71f6e5d964
commit 5708e8731b
11 changed files with 936 additions and 781 deletions

View File

@@ -1,6 +1,9 @@
{% set nbReceived = records.received().count() %}
{% set nbEligibleDocuments = records.count() %}
{% set nbTrash = filteredRecord.trash|length %}
{% set nbDelete = filteredRecord.delete|length %}
{% if nbEligibleDocuments > 0 %}
{% if nbReceived != records.count() %}
<div class="well-small" style="text-align:center;">
@@ -8,25 +11,51 @@
</div>
{% endif %}
<form method="POST" action="{{ path('record_delete') }}">
<form id="delete-record-form" style="margin: 0;" method="POST" action="{{ path('record_delete') }}">
<input type="hidden" value="{{ records.serializedList() }}" name="lst" />
<div class="well-small label-important" style="background-color: red;color:#000;padding:5px;display:block;word-wrap:break-word;font-weight: bold;">
<span class="ui-icon ui-icon-alert" ></span>
{{ "These records will be definitely deleted and can not be recovered" | trans }}
</div>
{% if records.stories().count() %}
<label class="checkbox">
<input type="checkbox" id="del_children" name="del_children" value="1"> {{ "Also delete records that rely on groupings." | trans }}
</label>
{% if nbTrash > 0 %}
<div class="well-small label-important"
style="background-color: #ffef22;">
<div class="dialog-left-section">
<img src="/assets/common/images/icons/icon_collection_bin.png"/>
</div>
<div class="dialog-right-section" style="margin-top: 8px;">
<span>{{ nbTrash }} {{ "prod:app trash: record-move-to-trash" | trans }}</span>
</div>
{% if records.stories().count() %}
<label class="checkbox story">
<input type="checkbox" id="del_children" name="del_children"
value="1"> {{ "prod:app trash: also-move-record" | trans }}
</label>
{% endif %}
</div>
{% endif %}
{% if nbDelete > 0 %}
<div class="well-small label-important"
style="background-color: #ed1c24;">
<div class="dialog-left-section">
<img src="/assets/common/images/icons/icon_empty_bin.png"/>
</div>
<div class="dialog-right-section">
<span>{{ nbDelete }} {{ "prod:app trash: record-delete" | trans }}</span>
</div>
{% if records.stories().count() %}
<label class="checkbox story">
<input type="checkbox" id="del_children" name="del_children"
value="1"> {{ "Also delete records that rely on groupings." | trans }}
</label>
{% endif %}
</div>
{% endif %}
<div class="form-actions" style="background-color:transparent;">
<button type="button" class="btn btn-danger submiter">{{ "Delete" | trans }} ({{ nbEligibleDocuments }})</button>
<button type="button" class="btn btn-danger submiter">{{ "Ok" | trans }}</button>
<button type="button" class="btn cancel">{{ "Cancel" | trans }}</button>
<span class="form-action-loader" style="display:none;">
<img src="/assets/common/images/icons/loader000.gif" />
</span>
<img src="/assets/common/images/icons/loader000.gif"/>
</span>
</div>
</form>
{% elseif nbReceived == 0 %}
<div class="well-small" style="text-align:center;">
<span class="label label-important">{{ "No document selected" | trans }}</span>
@@ -35,4 +64,4 @@
<div class="well-small" style="text-align:center;">
<span class="label label-info">{{ "You do not have rights to remove selected documents" | trans }}</span>
</div>
{% endif %}
{% endif %}