break;
}
- /** @var \Civi\Angular\AngularLoader $loader */
CRM_Utils_System::setTitle(ts('Message Templates'));
+
+ $breadCrumb = [
+ 'title' => E::ts('Message Templates'),
+ 'url' => CRM_Utils_System::url('civicrm/admin/messageTemplates', NULL, FALSE, '/user'),
+ ];
+ CRM_Utils_System::appendBreadCrumb([$breadCrumb]);
+
+ /** @var \Civi\Angular\AngularLoader $loader */
$loader = \Civi::service('angularjs.loader');
$loader->addModules(['crmMsgadm']);
$loader->useApp(array(
<div class="radio" ng-if="!!model.langs">
<label>
<input type="radio" ng-model="model.selected" value="other" name="lang" ng-disabled="!model.langs"/>
- {{:: ts('Other')}}
<select
class="form-control"
- crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('- select -')}"
+ style="min-width: 200px"
+ crm-ui-select="{dropdownAutoWidth : true, allowClear: true, placeholder: ts('Other')}"
name="selectedOther"
ng-model="model.selectedOther"
ng-change="model.selected='other'">
- <!-- "ng-click" might be better than "ng-select" but doesn't seem to work w/select2 variant -->
<option value=""></option>
<option ng-repeat="item in model.langs | orderBy:'label'" value="{{item.name}}" ng-disabled="!item.is_allowed">{{item.label}}</option>
</select>
</div>
<a name="crm-msgadm-tabs"></a>
- <div class="panel panel-info">
+ <div class="panel panel-default">
<div class="panel-heading" role="navigation">
<ul class="nav nav-pills">
<li role="presentation" class="navitem" ng-class="{active: $ctrl.tab == 'main'}" ng-if="!$ctrl.lang">
<a crm-icon="fa-file-text" class="nav-link" ng-click="$ctrl.tab = 'main'">
- {{::ts('Current')}}
+ {{:: ts('Current') }}
</a>
</li>
<li role="presentation" class="navitem" ng-class="{active: $ctrl.tab == 'txActive'}" ng-if="!!$ctrl.lang">
<a crm-icon="fa-file-text" class="nav-link" ng-click="$ctrl.tab = 'txActive'">
- {{::ts('Current')}}
+ {{:: ts('Current') }}
</a>
</li>
<li role="presentation" class="navitem" ng-class="{active: $ctrl.tab == 'txDraft'}" ng-if="$ctrl.hasDraft()">
<a crm-icon="fa-file-text-o" class="nav-link" ng-click="$ctrl.tab = 'txDraft'">
- {{::ts('Draft')}}
+ {{:: ts('Draft') }}
</a>
</li>
<li role="presentation" class="navitem" ng-class="{active: $ctrl.tab == 'original'}">
<a crm-icon="fa-file-text-o" class="nav-link" ng-click="$ctrl.tab = 'original'">
- {{::ts('Original')}}
+ {{:: ts('Original') }}
</a>
</li>
<li role="presentation" class="navitem pull-right" ng-show="$ctrl.tab.match('txActive|original') && !$ctrl.hasDraft() && $ctrl.allowDraft()">
<a crm-icon="fa-plus" class="nav-link text-success" ng-click="$ctrl.createDraft($ctrl.records[$ctrl.tab])">
- {{::ts('Create draft')}}
+ {{:: ts('Create draft') }}
</a>
</li>
<li role="presentation" class="navitem pull-right" ng-show="$ctrl.tab.match('txActive|original') && $ctrl.hasDraft() && $ctrl.allowDraft()">
<a crm-icon="fa-plus" class="nav-link text-warning" crm-confirm="{title: ts('Create draft?'), message: ts('There is already an existing draft. If you continue, it will be replaced with a clean draft. (Note: Changes will not take full effect until you save.)')}" on-yes="$ctrl.createDraft($ctrl.records[$ctrl.tab])">
- {{::ts('Create draft')}}
+ {{:: ts('Create draft') }}
</a>
</li>
<li role="presentation" class="navitem pull-right" ng-show="$ctrl.tab === 'txDraft'">
<a crm-icon="fa-trash" class="nav-link text-danger" crm-confirm="{type: 'delete', obj: {}, title: ts('Abandon draft?'), message: ts('Are you sure you want to abandon this draft? (Note: Changes will not take full effect until you save.)')}" on-yes="$ctrl.deleteDraft()">
- {{ts('Abandon draft')}}
+ {{:: ts('Abandon draft') }}
</a>
</li>
<li role="presentation" class="navitem pull-right" ng-show="$ctrl.tab === 'txDraft'">
<a crm-icon="fa-rocket" class="nav-link text-success" crm-confirm="{title: ts('Activate draft?'), message: ts('Are you sure you want to activate this draft? (Note: Changes will not take full effect until you save.)')}" on-yes="$ctrl.activateDraft()">
- {{::ts('Activate draft')}}
+ {{:: ts('Activate draft') }}
</a>
</li>
</ul>
</div>
<div class="btn-group pull-right">
- <button crm-icon="fa-check" type="button" class="btn btn-primary" ng-click="$ctrl.save()">
+ <button type="button" class="btn btn-primary" ng-click="$ctrl.save()">
+ <i class="crm-i fa-check"></i>
{{:: ts('Save') }}
</button>
- <button crm-icon="fa-check-circle" type="button" class="btn btn-primary" ng-click="$ctrl.save().then($ctrl.cancel)">
+ <button type="button" class="btn btn-primary" ng-click="$ctrl.save().then($ctrl.cancel)">
+ <i class="crm-i fa-check-circle"></i>
{{:: ts('Save and Done') }}
</button>
- <button crm-icon="fa-times" type="button" class="btn btn-primary" ng-click="$ctrl.cancel()">
+ <button type="button" class="btn btn-primary" ng-click="$ctrl.cancel()">
+ <i class="crm-i fa-times"></i>
{{:: ts('Cancel') }}
</button>
- <button crm-icon="fa-trash" type="button" class="btn btn-danger" crm-confirm="{type: 'delete', obj: {}, title: ts('Delete translation?'), message: ts('Are you sure want to delete this translation (%1)? This will remove any current and draft versions.', {1: $ctrl.lang})}" on-yes="$ctrl.delete()" ng-if="!!$ctrl.lang">
+ <button type="button" class="btn btn-danger" crm-confirm="{type: 'delete', obj: {}, title: ts('Delete translation?'), message: ts('Are you sure want to delete this translation (%1)? This will remove any current and draft versions.', {1: $ctrl.lang})}" on-yes="$ctrl.delete()" ng-if="!!$ctrl.lang">
+ <i class="crm-i fa-trash"></i>
{{:: ts('Delete') }}
</button>
</div>
<div class="panel panel-default">
<div class="panel-heading">
- <a href="" ng-click="accordions.msg_subject = !accordions.msg_subject">{{::ts('Subject')}}</a>
+ <a href ng-click="accordions.msg_subject = !accordions.msg_subject">
+ <i class="crm-i fa-caret-{{ accordions.msg_subject ? 'down' : 'right' }}"></i>
+ {{:: ts('Subject') }}
+ </a>
<input class="form-control pull-right crm-action-menu fa-code"
tabindex="-1"
style="z-index:1"
<div class="panel panel-default">
<div class="panel-heading">
- <a href="" ng-click="accordions.msg_html = !accordions.msg_html">{{::ts('HTML Content')}}</a>
+ <a href ng-click="accordions.msg_html = !accordions.msg_html">
+ <i class="crm-i fa-caret-{{ accordions.msg_html ? 'down' : 'right' }}"></i>
+ {{:: ts('HTML Content') }}
+ </a>
+ <div class="btn-group btn-group-xs pull-right" role="toolbar" aria-label="{{::ts('HTML Content: Toolbar')}}" ng-show="accordions.msg_html">
+ <button type="button" class="btn btn-secondary" title="{{::ts('Open large editor')}}" ng-click="$ctrl.openFull(ts('HTML Content'), 'msg_html', {language: 'html'})">
+ <i class="crm-i fa-expand"></i>
+ </button>
+ <button type="button" class="btn btn-secondary" title="{{::ts('Open preview')}}" ng-click="$ctrl.openPreview({formatName: 'msg_html'})">
+ <i class="crm-i fa-eye"></i>
+ </button>
+ </div>
<input class="form-control pull-right crm-action-menu fa-code"
tabindex="-1"
style="z-index:1"
on-crm-ui-select="$broadcast('insert:msg_html', selection)"
ng-show="accordions.msg_html && !$ctrl.isDisabled()"
/>
-
- <div class="btn-group btn-group-xs pull-right" role="toolbar" aria-label="{{::ts('HTML Content: Toolbar')}}" ng-show="accordions.msg_html">
- <button crm-icon="fa-expand" type="button" class="btn btn-default" title="{{::ts('Open large editor')}}" ng-click="$ctrl.openFull(ts('HTML Content'), 'msg_html', {language: 'html'})"></button>
- <button crm-icon="fa-eye" type="button" class="btn btn-default" title="{{::ts('Open preview')}}" ng-click="$ctrl.openPreview({formatName: 'msg_html'})"></button>
- <!--<button type="button" class="btn btn-default" title="{{::ts('Insert token')}}" ng-click="$ctrl.insertToken('msg_html')" crm-icon="fa-plus">-->
- <!-- {{::ts('Token')}}-->
- <!--</button>-->
- </div>
<div class="clearfix"></div>
</div>
<div class="panel-body" uib-collapse="!accordions.msg_html">
<div class="panel panel-default">
<div class="panel-heading">
- <a href="" ng-click="accordions.msg_text = !accordions.msg_text">{{::ts('Text Content')}}</a>
+ <a href ng-click="accordions.msg_text = !accordions.msg_text">
+ <i class="crm-i fa-caret-{{ accordions.msg_text ? 'down' : 'right' }}"></i>
+ {{:: ts('Text Content') }}
+ </a>
+ <div class="btn-group btn-group-xs pull-right" role="toolbar" aria-label="{{::ts('Text Content: Toolbar')}}" ng-show="accordions.msg_text">
+ <button type="button" class="btn btn-secondary" title="{{ ::ts('Open large editor') }}" ng-click="$ctrl.openFull(ts('Text Content'), 'msg_text', {language: 'smarty'})">
+ <i class="crm-i fa-expand"></i>
+ </button>
+ <button type="button" class="btn btn-secondary" title="{{ ::ts('Open preview') }}" ng-click="$ctrl.openPreview({formatName: 'msg_text'})">
+ <i class="crm-i fa-eye"></i>
+ </button>
+ </div>
+
<input class="form-control pull-right crm-action-menu fa-code"
tabindex="-1"
style="z-index:1"
on-crm-ui-select="$broadcast('insert:msg_text', selection)"
ng-show="accordions.msg_text && !$ctrl.isDisabled()"
/>
-
- <div class="btn-group btn-group-xs pull-right" role="toolbar" aria-label="{{::ts('Text Content: Toolbar')}}" ng-show="accordions.msg_text">
- <button crm-icon="fa-expand" type="button" class="btn btn-default" title="{{::ts('Open large editor')}}" ng-click="$ctrl.openFull(ts('Text Content'), 'msg_text', {language: 'smarty'})"></button>
- <button crmicon="fa-eye" type="button" class="btn btn-default" title="{{::ts('Open preview')}}" ng-click="$ctrl.openPreview({formatName: 'msg_text'})"></button>
- <!--<button type="button" class="btn btn-default" title="{{::ts('Insert token')}}" ng-click="$ctrl.insertToken('msg_text')" crm-icon="fa-plus">-->
- <!-- {{::ts('Token')}}-->
- <!--</button>-->
- </div>
<div class="clearfix"></div>
</div>
<div class="panel-body" uib-collapse="!accordions.msg_text">
</div>
<div class="navbar-form navbar-right">
<div class="form-group">
- <button crm-icon="fa-eye" type="button" class="btn btn-default" ng-click="model.openPreview({formatName: model.field})">
- {{::ts('Preview')}}
+ <button type="button" class="btn btn-default" ng-click="model.openPreview({formatName: model.field})">
+ <i class="crm-i fa-eye"></i>
+ {{ ::ts('Preview') }}
</button>
- <!-- class='fa-code' is unhappy here. At least in Firefox. -->
- <input class="form-control crm-action-menu"
+ <input class="form-control crm-action-menu fa-code"
tabindex="-1"
style="z-index:1"
crm-ui-select="{placeholder: ts('Token'), data: model.tokenList, width: '12em', dropdownAutoWidth: true}"
on-crm-ui-select="$broadcast('insert:expanded', selection)"
/>
- <button crm-icon="fa-times" type="button" class="btn btn-default" ng-click="expandedEditDlg.close()">
- {{::ts('Close')}}
+ <button type="button" class="btn btn-default" ng-click="expandedEditDlg.close()">
+ <i class="crm-i fa-times"></i>
+ {{ ::ts('Close') }}
</button>
</div>
-<div class="panel panel-info">
-
- <ul class="panel-heading nav nav-tabs">
+<nav class="bg-info">
+ <ul class="nav nav-tabs">
<li role="presentation"
ng-class="{active: location.path() === '/user'}"
ng-if="checkPerm('edit message templates') || checkPerm('edit user-driven message templates')">
- <a ng-href="#/user">{{ts('User-Driven Messages')}}</a>
+ <a ng-href="#/user">{{:: ts('User-Driven Messages') }}</a>
</li>
<li role="presentation"
ng-class="{active: location.path() === '/workflow'}"
ng-if="checkPerm('edit message templates') || checkPerm('edit system workflow message templates')">
- <a ng-href="#/workflow">{{ts('System Workflow Messages')}}</a>
+ <a ng-href="#/workflow">{{:: ts('System Workflow Messages' )}}</a>
</li>
</ul>
-
-</div>
+</nav>
<div class="help">
</a>
</div>
- <table>
+ <table class="table table-striped">
<thead>
<tr>
- <th>{{ts('Title')}}</th>
- <th>{{ts('Subject')}}</th>
- <th>{{ts('Enabled?')}}</th>
+ <th>{{:: ts('Title') }}</th>
+ <th>{{:: ts('Subject') }}</th>
+ <th>{{:: ts('Enabled?') }}</th>
<th></th>
</tr>
</thead>
<td>{{record.msg_subject}}</td>
<td>{{record.is_active ? ts('Yes') : ts('No')}}</td>
<td class="text-right">
- <a class="btn btn-xs btn-default" ng-href="{{$ctrl.editUrl(record, 'legacy')}}">{{ts('Edit')}}</a>
- <a class="btn btn-xs btn-default" ng-click="$ctrl.toggle(record)" ng-if="!!record.is_active">{{ts('Disable')}}</a>
- <a class="btn btn-xs btn-default" ng-click="$ctrl.toggle(record)" ng-if="!record.is_active">{{ts('Enable')}}</a>
- <a class="btn btn-xs btn-danger" crm-confirm="{type: 'delete', obj: record}" on-yes="$ctrl.delete(record)">{{ts('Delete')}}</a>
+ <a class="btn btn-xs btn-default" ng-href="{{$ctrl.editUrl(record, 'legacy')}}">{{:: ts('Edit') }}</a>
+ <a class="btn btn-xs btn-default" ng-click="$ctrl.toggle(record)" ng-if="!!record.is_active">{{:: ts('Disable') }}</a>
+ <a class="btn btn-xs btn-default" ng-click="$ctrl.toggle(record)" ng-if="!record.is_active">{{:: ts('Enable') }}</a>
+ <a class="btn btn-xs btn-danger" crm-confirm="{type: 'delete', obj: record}" on-yes="$ctrl.delete(record)">{{:: ts('Delete') }}</a>
</td>
</tr>
</tbody>
<input class="form-control" type="search" id="msgtpl-filter-text" ng-model="filters.text">
</div>
- <table>
+ <table class="table table-striped">
<thead>
<tr>
- <th>{{ts('Title')}}</th>
+ <th>{{:: ts('Title') }}</th>
<th></th>
</tr>
</thead>
<tr ng-repeat="record in $ctrl.records | filter:filters.text | orderBy:['msg_title','_is_translation','tx_language_label']">
<td>{{record.msg_title}}</td>
<td class="text-right">
- <a class="btn btn-xs btn-default" ng-href="{{$ctrl.editUrl(record)}}">{{ts('Edit')}}</a>
+ <a class="btn btn-xs btn-default" ng-href="{{$ctrl.editUrl(record)}}">{{:: ts('Edit') }}</a>
</td>
</tr>
</tbody>
<input class="form-control" type="search" id="msgtpl-filter-text" ng-model="filters.text">
</div>
- <table>
+ <table class="table table-striped">
<thead>
<tr>
- <th>{{ts('Title')}}</th>
- <th>{{ts('Locale')}}</th>
+ <th>{{:: ts('Title') }}</th>
+ <th>{{:: ts('Locale') }}</th>
<th></th>
<th></th>
<th></th>
<td>{{record.tx_language_label || ts('Standard')}}</td>
<td>
<span ng-if="!record.tx_language || !!record.tx_statuses.active">
- <a class="text-success" crm-icon="fa-file-text" title="{{ts('Edit current revision, "%1", "%2"', {1: record.msg_title, 2: record.tx_language_label || ts('Standard')})}}" ng-href="{{$ctrl.editUrl(record)}}">{{ts('Current')}}</a>
+ <a class="text-success" crm-icon="fa-file-text" title="{{ts('Edit current revision, "%1", "%2"', {1: record.msg_title, 2: record.tx_language_label || ts('Standard')})}}" ng-href="{{$ctrl.editUrl(record)}}">{{:: ts('Current') }}</a>
</span>
<span ng-if="!(!record.tx_language || !!record.tx_statuses.active)">
- <span class="text-danger" crm-icon="fa-file-text" title="{{ts('No current revision, "%1", "%2"', {1: record.msg_title, 2: record.tx_language_label || ts('Standard')})}}">{{ts('Current')}}</span>
+ <span class="text-danger" crm-icon="fa-file-text" title="{{ts('No current revision, "%1", "%2"', {1: record.msg_title, 2: record.tx_language_label || ts('Standard')})}}">{{:: ts('Current') }}</span>
</span>
</td>
<td>
<span ng-if="!!record.tx_statuses.draft">
- <a class="text-warning" crm-icon="fa-file-text-o" title="{{ts('Edit draft revision, "%1", "%2"', {1: record.msg_title, 2: record.tx_language_label || ts('Standard')})}}" ng-href="{{$ctrl.editUrl(record, 'draft')}}">{{ts('Draft')}}</a>
+ <a class="text-warning" crm-icon="fa-file-text-o" title="{{ts('Edit draft revision, "%1", "%2"', {1: record.msg_title, 2: record.tx_language_label || ts('Standard')})}}" ng-href="{{$ctrl.editUrl(record, 'draft')}}">{{:: ts('Draft') }}</a>
</span>
<span ng-if="!record.tx_statuses.draft">
- <span class="text-muted" crm-icon="fa-file-text-o" title="{{ts('No draft revision, "%1", "%2"', {1: record.msg_title, 2: record.tx_language_label || ts('Standard')})}}">{{ts('Draft')}}</span>
+ <span class="text-muted" crm-icon="fa-file-text-o" title="{{ts('No draft revision, "%1", "%2"', {1: record.msg_title, 2: record.tx_language_label || ts('Standard')})}}">{{:: ts('Draft') }}</span>
</span>
</td>
<td>
<span ng-if="!record.tx_language">
- <a class="" crm-icon="fa-plus" ng-click="$ctrl.addTranslation(record)" title="{{ts('Add translation, "%1"', {1: record.msg_title})}}">{{ts('Translate')}}</a>
+ <a href crm-icon="fa-plus" ng-click="$ctrl.addTranslation(record)" title="{{ts('Add translation, "%1"', {1: record.msg_title})}}">{{:: ts('Translate') }}</a>
</span>
</td>
</tr>
settings.width = '' + parseInt(percentage+gap-((screenWidth - 700)/7*(gap)/100), 10) + '%';
}
}
+ if (settings.dialogClass && !_.includes(settings.dialogClass, 'crm-container')) {
+ settings.dialogClass += ' crm-container';
+ }
return settings;
};