record view ref
This commit is contained in:
@@ -106,6 +106,7 @@ Espo.define('crm:views/lead/convert', 'view', function (Dep) {
|
||||
model: model,
|
||||
el: '#main .edit-container-' + Espo.Utils.toDom(scope),
|
||||
buttonsPosition: false,
|
||||
buttonsDisabled: true,
|
||||
layoutName: 'detailConvert',
|
||||
exit: function () {},
|
||||
}, function (view) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="detail" id="{{id}}">
|
||||
{{#if buttonsTop}}
|
||||
{{#unless buttonsDisabled}}
|
||||
<div class="detail-button-container button-container record-buttons clearfix">
|
||||
<div class="btn-group" role="group">
|
||||
{{#each buttonList}}{{button name scope=../../entityType label=label style=style hidden=hidden html=html}}{{/each}}
|
||||
@@ -42,8 +42,7 @@
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{/unless}}
|
||||
|
||||
<div class="row">
|
||||
<div class="{{#if isWide}} col-md-12{{else}}{{#if isSmall}} col-md-7{{else}} col-md-8{{/if}}{{/if}}">
|
||||
@@ -55,38 +54,4 @@
|
||||
{{{side}}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if buttonsBottom}}
|
||||
<div class="button-container record-buttons">
|
||||
<div class="btn-group" role="group">
|
||||
{{#each buttonList}}{{button name scope=../../entityType label=label style=style html=html}}{{/each}}
|
||||
{{#if dropdownItemList}}
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-left">
|
||||
{{#each dropdownItemList}}
|
||||
<li><a href="javascript:" class="action" data-action="{{name}}">{{#if html}}{{{html}}}{{else}}{{translate label scope=../../entityType}}{{/if}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-button-container button-container edit-buttons hidden">
|
||||
<div class="btn-group" role="group">
|
||||
{{#each buttonEditList}}{{button name scope=../../entityType label=label style=style html=html}}{{/each}}
|
||||
{{#if dropdownEditItemList}}
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-left">
|
||||
{{#each dropdownEditItemList}}
|
||||
<li><a href="javascript:" class="action" data-action="{{name}}">{{#if html}}{{{html}}}{{else}}{{translate label scope=../../entityType}}{{/if}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div class="edit" id="{{id}}">
|
||||
{{#if buttonsTop}}
|
||||
{{#unless buttonsDisabled}}
|
||||
<div class="detail-button-container button-container record-buttons clearfix">
|
||||
<div class="btn-group" role="group">
|
||||
{{#each buttonList}}{{button name scope=../../entityType label=label style=style html=html}}{{/each}}
|
||||
@@ -15,36 +15,16 @@
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{/unless}}
|
||||
|
||||
<div class="row">
|
||||
<div class="{{#if isWide}} col-md-12{{else}}{{#if isSmall}} col-md-7{{else}} col-md-8{{/if}}{{/if}}">
|
||||
<div class="{{#if isWide}}col-md-12{{else}}{{#if isSmall}}col-md-7{{else}}col-md-8{{/if}}{{/if}}">
|
||||
<div class="middle">{{{middle}}}</div>
|
||||
<div class="extra">{{{extra}}}</div>
|
||||
<div class="bottom">{{{bottom}}}</div>
|
||||
</div>
|
||||
<div class="side {{#if isWide}} col-md-12{{else}}{{#if isSmall}} col-md-5{{else}} col-md-4{{/if}}{{/if}}">
|
||||
<div class="side {{#if isWide}}col-md-12{{else}}{{#if isSmall}}col-md-5{{else}}col-md-4{{/if}}{{/if}}">
|
||||
{{{side}}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{{#if buttonsBottom}}
|
||||
<div class="detail-button-container button-container record-buttons">
|
||||
<div class="btn-group" role="group">
|
||||
{{#each buttonList}}{{button name scope=../../entityType label=label style=style html=html}}{{/each}}
|
||||
{{#if dropdownItemList}}
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-left">
|
||||
{{#each dropdownItemList}}
|
||||
<li><a href="javascript:" class="action" data-action="{{name}}">{{#if html}}{{{html}}}{{else}}{{translate label scope=../../entityType}}{{/if}}</a></li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -80,7 +80,7 @@ Espo.define('views/modals/compose-email', 'views/modals/edit', function (Dep) {
|
||||
type: 'editSmall',
|
||||
layoutName: this.layoutName || 'detailSmall',
|
||||
columnCount: this.columnCount,
|
||||
buttonsPosition: false,
|
||||
buttonsDisabled: true,
|
||||
selectTemplateDisabled: this.options.selectTemplateDisabled,
|
||||
removeAttachmentsOnSelectTemplate: this.options.removeAttachmentsOnSelectTemplate,
|
||||
signatureDisabled: this.options.signatureDisabled,
|
||||
|
||||
@@ -239,7 +239,7 @@ Espo.define('views/modals/detail', 'views/modal', function (Dep) {
|
||||
type: 'detailSmall',
|
||||
layoutName: this.layoutName || 'detailSmall',
|
||||
columnCount: this.columnCount,
|
||||
buttonsPosition: false,
|
||||
buttonsDisabled: true,
|
||||
inlineEditDisabled: true,
|
||||
sideDisabled: this.sideDisabled,
|
||||
bottomDisabled: this.bottomDisabled,
|
||||
|
||||
@@ -151,7 +151,7 @@ Espo.define('views/modals/edit', 'views/modal', function (Dep) {
|
||||
type: 'editSmall',
|
||||
layoutName: this.layoutName || 'detailSmall',
|
||||
columnCount: this.columnCount,
|
||||
buttonsPosition: false,
|
||||
buttonsDisabled: true,
|
||||
sideDisabled: this.sideDisabled,
|
||||
bottomDisabled: this.bottomDisabled,
|
||||
exit: function () {}
|
||||
|
||||
@@ -44,10 +44,7 @@ Espo.define('views/record/detail', ['views/record/base', 'view-record-helper'],
|
||||
|
||||
detailLayout: null,
|
||||
|
||||
/**
|
||||
* @property {string} or {bool} ['both', 'top', 'bottom', false, true] Where to display buttons.
|
||||
*/
|
||||
buttonsPosition: 'top',
|
||||
buttonsDisabled: false,
|
||||
|
||||
columnCount: 2,
|
||||
|
||||
@@ -607,8 +604,7 @@ Espo.define('views/record/detail', ['views/record/base', 'view-record-helper'],
|
||||
dropdownItemList: this.dropdownItemList,
|
||||
dropdownEditItemList: this.dropdownEditItemList,
|
||||
dropdownItemListEmpty: this.isDropdownItemListEmpty(),
|
||||
buttonsTop: this.buttonsPosition === 'both' || this.buttonsPosition === true || this.buttonsPosition === 'top',
|
||||
buttonsBottom: this.buttonsPosition === 'both' || this.buttonsPosition === true || this.buttonsPosition === 'bottom',
|
||||
buttonsDisabled: this.buttonsDisabled,
|
||||
name: this.name,
|
||||
id: this.id,
|
||||
isWide: this.isWide,
|
||||
@@ -710,8 +706,12 @@ Espo.define('views/record/detail', ['views/record/base', 'view-record-helper'],
|
||||
}
|
||||
}
|
||||
|
||||
if ('buttonsPosition' in this.options) {
|
||||
this.buttonsPosition = this.options.buttonsPosition;
|
||||
this.buttonsDisabled = this.options.buttonsDisabled || this.buttonsDisabled;
|
||||
|
||||
// for backward compatibility
|
||||
// TODO remove in 5.6.0
|
||||
if ('buttonsPosition' in this.options && !this.options.buttonsPosition) {
|
||||
this.buttonsDisabled = true;
|
||||
}
|
||||
|
||||
if ('isWide' in this.options) {
|
||||
|
||||
Reference in New Issue
Block a user