mirror of
https://codeberg.org/artfulrobot/contactcats.git
synced 2025-06-26 08:58:06 +02:00
Various UI improvements
This commit is contained in:
parent
bcbf5de9c4
commit
8d0a9d0926
7 changed files with 253 additions and 123 deletions
|
@ -1,8 +1,8 @@
|
|||
<div id=bootstrap-theme>
|
||||
<div ng-if="$ctrl.categoryDefinitions === null">
|
||||
<div ng-if="$ctrl.presentation_order === null">
|
||||
Loading...
|
||||
</div>
|
||||
<form ng-if="$ctrl.categoryDefinitions"
|
||||
<form ng-if="$ctrl.presentation_order"
|
||||
ng-show="$ctrl.view === 'list'"
|
||||
crm-ui-id-scope
|
||||
>
|
||||
|
@ -13,20 +13,50 @@
|
|||
longer title/description. "regular givers who..."
|
||||
-->
|
||||
|
||||
<h2>{{ts('Execution order')}}</h2>
|
||||
<p>{{ts('A contact is assigned the first category that matches according to the order defined here. Categories are presented in order of their label - see list below - so you may want to consider this when naming your categories.')}}</p>
|
||||
<div class=help >{{ts('Each contact is assigned the first category that matches, using the assignment order. When categories are listed, the presentation order is used.')}}</div>
|
||||
|
||||
<div crm-ui-field="{name: 'cc.label', title: ts('Show')}" >
|
||||
<input
|
||||
crm-ui-id="ci.showOrder-execution"
|
||||
type=radio
|
||||
class=crm-form-radio
|
||||
name="useOrder"
|
||||
ng-model="$ctrl.uxOrderField"
|
||||
value="execution_order"
|
||||
ng-disabled="$ctrl.moveIdx !== null"
|
||||
/>
|
||||
<label crm-ui-for="ci.showOrder-execution">{{ts('Assignment order')}}</label>
|
||||
<input
|
||||
crm-ui-id="ci.showOrder-presentation"
|
||||
type=radio
|
||||
class=crm-form-radio
|
||||
name="useOrder"
|
||||
ng-model="$ctrl.uxOrderField"
|
||||
value="presentation_order"
|
||||
ng-disabled="$ctrl.moveIdx !== null"
|
||||
/>
|
||||
<label crm-ui-for="ci.showOrder-presentation">{{ts('Presentation order')}}</label>
|
||||
|
||||
</div>
|
||||
|
||||
<h2 ng-if="$ctrl.uxOrderField === 'execution_order'" >{{ts('Assignment order')}}</h2>
|
||||
<h2 ng-if="$ctrl.uxOrderField === 'presentation_order'" >{{ts('Presentation order')}}</h2>
|
||||
<p ng-if="$ctrl.uxOrderField === 'execution_order'" ><button class="btn btn-secondary" ng-click="$ctrl.copyOrder('presentation_order')" >{{ts('Copy from Presentation Order')}}</button></p>
|
||||
<p ng-if="$ctrl.uxOrderField === 'presentation_order'" ><button class="btn btn-secondary" ng-click="$ctrl.copyOrder('execution_order')" >{{ts('Copy from Assignment Order')}}</button></p>
|
||||
<ol class="crm-catmap {{$ctrl.moveIdx !== null ? 'moving' : ''}}">
|
||||
<li ng-repeat="(idx, row) in $ctrl.categoryDefinitions" class="{{idx === $ctrl.moveIdx ? 'being-moved' : ''}} {{row.deleted ? 'deleted' : ''}}">
|
||||
<div class=panel>
|
||||
<div class=panel-body>
|
||||
<span style="color: {{row.color ? row.color : 'inherit'}};" >
|
||||
<i ng-if="row.icon" class="crm-i {{row.icon}}" ></i>
|
||||
{{row.label}}
|
||||
</span>
|
||||
<li ng-repeat="(idx, row) in $ctrl[$ctrl.uxOrderField]" class="{{idx === $ctrl.moveIdx ? 'being-moved' : ''}} {{row.deleted ? 'deleted' : ''}}">
|
||||
<div class=panel>
|
||||
<div class=panel-body>
|
||||
<span class="contactcats-label" style="color: {{row.color ? row.color : 'inherit'}};" >
|
||||
<i ng-if="row.icon" class="crm-i {{row.icon}}" ></i>
|
||||
{{row.label}}
|
||||
</span>
|
||||
<span class="contactcats-description" >
|
||||
{{row.description}}
|
||||
</span>
|
||||
|
||||
<!-- button group? -->
|
||||
<span>
|
||||
<span class=contactcats-actions>
|
||||
<button ng-if="$ctrl.moveIdx === null && !row.deleted" ng-click="$ctrl.edit(idx)" >
|
||||
<i class="fa-pencil crm-i"></i> {{ts('Edit')}}
|
||||
</button>
|
||||
|
@ -38,7 +68,7 @@
|
|||
</button>
|
||||
<button ng-if="$ctrl.moveIdx === null && !row.deleted && row.search_type !== 'default'" ng-click="$ctrl.moveIdx = idx"
|
||||
class="btn"
|
||||
ng-disabled="$ctrl.categoryDefinitions.length === 1"
|
||||
ng-disabled="$ctrl.presentation_order.length === 1"
|
||||
>
|
||||
<i class="fa-arrows-up-down crm-i"></i> {{ts('Move')}}
|
||||
</button>
|
||||
|
@ -50,8 +80,8 @@
|
|||
<button ng-click="$ctrl.moveTo(idx)" ng-show="$ctrl.moveIdx !== null && (idx === 0 && $ctrl.moveIdx > 0)" ><i class="fa-sort-up crm-i" ></i>{{ts('Before this')}}</button>
|
||||
<button ng-click="$ctrl.moveTo(idx+1)" ng-show="$ctrl.moveIdx !== null && row.search_type !== 'default' && (idx + 1 < $ctrl.moveIdx || idx > $ctrl.moveIdx)"><i class="fa-sort-down crm-i" ></i>{{ts('After this')}}</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- lower idx : {{idx}} moveIdx {{$ctrl.moveIdx}} -->
|
||||
<!-- <div class="crm-contact-cats-move-target" ng-show="($ctrl.moveIdx < idx) || (idx +1 < $ctrl.moveIdx)" > -->
|
||||
<!-- <button ng-click="$ctrl.moveTo(idx+1)" ><i class="fa-right-long crm-i" ></i>{{ts('Move to here')}}</button> -->
|
||||
|
@ -72,24 +102,13 @@
|
|||
Categories saved. Contacts will be updated shortly (when the next Scheduled
|
||||
Job run happens).
|
||||
</div>
|
||||
|
||||
<h2>Presentation order</h2>
|
||||
<ol style="padding-left: 3ch;list-style: decimal;">
|
||||
<li ng-repeat="(idx, row) in $ctrl.presentationOrder" >
|
||||
<span style="color: {{row.color ? row.color : 'inherit'}};" >
|
||||
<i ng-if="row.icon" class="crm-i {{row.icon}}" ></i>
|
||||
{{row.label}}
|
||||
</span>
|
||||
</li>
|
||||
</ol>
|
||||
</form>
|
||||
|
||||
|
||||
<form ng-show="$ctrl.view === 'edit'"
|
||||
crm-ui-id-scope>
|
||||
<div>
|
||||
<h2 ng-if="$ctrl.categoryDefinitions.length > $ctrl.categoryToEdit.idx">{{ts('Edit category %1', {1 : $ctrl.categoryDefinitions[$ctrl.categoryToEdit.idx].label })}}</h2>
|
||||
<h2 ng-if="$ctrl.categoryDefinitions.length == $ctrl.categoryToEdit.idx" >{{ts('Add new category')}}</h2>
|
||||
<h2 ng-if="$ctrl.presentation_order.length > $ctrl.categoryToEdit.idx">{{ts('Edit category %1', {1 : $ctrl.[$ctrl.uxOrderField][$ctrl.categoryToEdit[$ctrl.uxOrderField]].label })}}</h2>
|
||||
<h2 ng-if="$ctrl.presentation_order.length == $ctrl.categoryToEdit.idx" >{{ts('Add new category')}}</h2>
|
||||
|
||||
<div crm-ui-field="{name: 'cc.label', title: ts('Category label'), required: 1}" >
|
||||
<input
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue