From 78cf62cff17dcfa08ac69fd4b60e063368d325a0 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Tue, 30 Jun 2015 18:58:40 +1000 Subject: [PATCH] Add a note about October.Drivers for mail methods that use it Trim field partials to allow :empty selector to work --- modules/backend/assets/css/october.css | 1 + modules/backend/assets/js/october-min.js | 5 +- .../backend/assets/less/controls/callout.less | 135 ------------------ .../backend/models/brandsettings/fields.yaml | 1 - .../form/partials/_field-container.htm | 2 +- .../widgets/form/partials/_field_hint.htm | 1 - .../widgets/form/partials/_field_partial.htm | 1 - modules/system/assets/ui/less/callout.less | 4 + modules/system/lang/en/lang.php | 22 +-- .../models/mailsettings/_drivers_hint.htm | 11 ++ .../system/models/mailsettings/fields.yaml | 9 ++ 11 files changed, 41 insertions(+), 151 deletions(-) delete mode 100644 modules/backend/assets/less/controls/callout.less create mode 100644 modules/system/models/mailsettings/_drivers_hint.htm diff --git a/modules/backend/assets/css/october.css b/modules/backend/assets/css/october.css index 60812b272..e6d5743fd 100644 --- a/modules/backend/assets/css/october.css +++ b/modules/backend/assets/css/october.css @@ -1606,6 +1606,7 @@ ul.status-list li span.status.info{background:#5bc0de} .callout > .content .action-panel{padding:10px 0 0 0} .callout.no-icon > .header h3,.callout.no-icon > .header p{margin-left:0} .callout.no-subheader > .header i{margin-top:-5px} +.form-group > .callout{margin-bottom:0} .control-toolbar{font-size:0;padding:0 0 20px 0;position:relative} .control-toolbar:after,.control-toolbar:before{display:none;position:absolute;top:50%;margin-top:-7px;height:9px;font-size:10px;color:#bbbbbb} .control-toolbar:before{left:-6px;font-family:FontAwesome;font-weight:normal;font-style:normal;text-decoration:inherit;-webkit-font-smoothing:antialiased;*margin-right:.3em;content:"\f104"} diff --git a/modules/backend/assets/js/october-min.js b/modules/backend/assets/js/october-min.js index b924c9cb9..0b9ba6cb0 100644 --- a/modules/backend/assets/js/october-min.js +++ b/modules/backend/assets/js/october-min.js @@ -3896,8 +3896,9 @@ $el.on('oc.triggerOn.update',function(e){e.stopPropagation() self.onConditionChanged()}) self.onConditionChanged()} TriggerOn.prototype.onConditionChanged=function(){if(this.triggerCondition=='checked'){this.updateTarget($(this.options.trigger+':checked',this.triggerParent).length>0)} -else if(this.triggerCondition=='value'){var trigger=$(this.options.trigger+':checked',this.triggerParent);if(trigger.length){this.updateTarget(trigger.val()==this.triggerConditionValue)} -else{this.updateTarget($(this.options.trigger,this.triggerParent).val()==this.triggerConditionValue)}}} +else if(this.triggerCondition=='value'){console.log(this.triggerConditionValue) +var trigger=$(this.options.trigger+':checked',this.triggerParent),needle=trigger.length?trigger.val():$(this.options.trigger,this.triggerParent).val() +this.updateTarget($.inArray(needle,this.triggerConditionValue)!=-1)}} TriggerOn.prototype.updateTarget=function(status){if(this.options.triggerAction=='show') this.$el.toggleClass('hide',!status).trigger('hide.oc.triggerapi',[!status]) else if(this.options.triggerAction=='hide') diff --git a/modules/backend/assets/less/controls/callout.less b/modules/backend/assets/less/controls/callout.less deleted file mode 100644 index 4b4586799..000000000 --- a/modules/backend/assets/less/controls/callout.less +++ /dev/null @@ -1,135 +0,0 @@ -// -// Callouts -// -------------------------------------------------- - -.callout { - font-size: 14px; - margin-bottom: @line-height-computed; - - &.fade { - .opacity(0); - .transition(~'all 0.5s, width 0s'); - .transform(~'scale(0.9)'); - } - - &.fade.in { - .opacity(1); - .transform( ~'scale(1)'); - } - - > .close { - margin: 15px 15px 0 0; - } - - &.callout-danger { - > .header { - background: @callout-danger-header-bg; - i { color: @callout-danger-icon; } - } - > .content { background: @callout-danger-content-bg; } - } - - &.callout-info { - > .header { - background: @callout-info-header-bg; - i { color: @callout-info-icon; } - } - > .content { background: @callout-info-content-bg; } - } - - &.callout-success { - > .header { - background: @callout-success-header-bg; - i { color: @callout-success-icon; } - } - > .content { background: @callout-success-content-bg; } - } - - &.callout-warning { - > .header { - background: @callout-warning-header-bg; - i { color: @callout-warning-icon; } - } - > .content { background: @callout-warning-content-bg; } - } - - > .header { - padding: @callout-padding; - padding-bottom: 15px; - .border-radius(4px 4px 0 0); - color: #2f2d26; - - h3 { - letter-spacing: 0; - margin: 0 0 7px 0; - font-size: 14px; - font-weight: bold; - } - - h3, p { - margin-left: 35px; - } - - *:last-child { - margin-bottom: 0; - } - - &:last-child { - .border-radius(4px); - } - - i { - font-size: 26px; - float: left; - } - } - - > .content { - color: #2f2d26; - padding: 16px 20px 15px; - - h1, h2, h3, h4, h5, h6 { - color: #2f2d26; - text-transform: none; - margin: 20px 0 5px 0; - line-height: 150%; - } - - h1 { font-size: 30px; } - h2 { font-size: 26px; } - h3 { font-size: 24px; } - h4 { font-size: 20px; } - h5 { font-size: 18px; } - h6 { font-size: 16px; } - - *:last-child { - margin-bottom: 0; - } - - ul, ol { - li { - margin-bottom: 5px; - } - } - - .action-panel { - padding: 10px 0 0 0; - } - } - - &.no-icon { - > .header { - h3, p { - margin-left: 0; - } - } - } - - &.no-subheader { - > .header { - i { - margin-top: -5px; - } - } - } -} \ No newline at end of file diff --git a/modules/backend/models/brandsettings/fields.yaml b/modules/backend/models/brandsettings/fields.yaml index 02b91d95f..63d15d2a3 100644 --- a/modules/backend/models/brandsettings/fields.yaml +++ b/modules/backend/models/brandsettings/fields.yaml @@ -11,7 +11,6 @@ tabs: commentAbove: backend::lang.branding.logo_description mode: image imageHeight: 170 - imageWidth: 340 tab: backend::lang.branding.brand app_name: diff --git a/modules/backend/widgets/form/partials/_field-container.htm b/modules/backend/widgets/form/partials/_field-container.htm index 80e5ba1cc..98c6e4e1d 100644 --- a/modules/backend/widgets/form/partials/_field-container.htm +++ b/modules/backend/widgets/form/partials/_field-container.htm @@ -5,5 +5,5 @@ getAttributes('container') ?> id="getId('group') ?>">makePartial('field', ['field' => $field]) + trim($this->makePartial('field', ['field' => $field])) ?> \ No newline at end of file diff --git a/modules/backend/widgets/form/partials/_field_hint.htm b/modules/backend/widgets/form/partials/_field_hint.htm index c06d57fa8..ac8e29918 100644 --- a/modules/backend/widgets/form/partials/_field_hint.htm +++ b/modules/backend/widgets/form/partials/_field_hint.htm @@ -1,4 +1,3 @@ - controller->makeHintPartial($field->getId(), $field->path ?: $field->fieldName, [ 'formModel' => $formModel, 'formField' => $field, diff --git a/modules/backend/widgets/form/partials/_field_partial.htm b/modules/backend/widgets/form/partials/_field_partial.htm index 20ae0d91f..631c56d6d 100644 --- a/modules/backend/widgets/form/partials/_field_partial.htm +++ b/modules/backend/widgets/form/partials/_field_partial.htm @@ -1,4 +1,3 @@ - controller->makePartial($field->path ?: $field->fieldName, [ 'formModel' => $formModel, 'formField' => $field, diff --git a/modules/system/assets/ui/less/callout.less b/modules/system/assets/ui/less/callout.less index cb1bbc26d..95698abcb 100644 --- a/modules/system/assets/ui/less/callout.less +++ b/modules/system/assets/ui/less/callout.less @@ -154,4 +154,8 @@ } } } +} + +.form-group > .callout { + margin-bottom: 0; } \ No newline at end of file diff --git a/modules/system/lang/en/lang.php b/modules/system/lang/en/lang.php index ffd94462a..1b9f5508d 100644 --- a/modules/system/lang/en/lang.php +++ b/modules/system/lang/en/lang.php @@ -128,29 +128,31 @@ return [ 'menu_label' => 'Mail configuration', 'menu_description' => 'Manage email configuration.', 'general' => 'General', - 'method' => 'Mail Method', - 'sender_name' => 'Sender Name', - 'sender_email' => 'Sender Email', + 'method' => 'Mail method', + 'sender_name' => 'Sender name', + 'sender_email' => 'Sender email', 'php_mail' => 'PHP mail', 'smtp' => 'SMTP', - 'smtp_address' => 'SMTP Address', + 'smtp_address' => 'SMTP address', 'smtp_authorization' => 'SMTP authorization required', 'smtp_authorization_comment' => 'Use this checkbox if your SMTP server requires authorization.', 'smtp_username' => 'Username', 'smtp_password' => 'Password', - 'smtp_port' => 'SMTP Port', + 'smtp_port' => 'SMTP port', 'smtp_ssl' => 'SSL connection required', 'sendmail' => 'Sendmail', - 'sendmail_path' => 'Sendmail Path', + 'sendmail_path' => 'Sendmail path', 'sendmail_path_comment' => 'Please specify the path of the sendmail program.', 'mailgun' => 'Mailgun', - 'mailgun_domain' => 'Mailgun Domain', + 'mailgun_domain' => 'Mailgun domain', 'mailgun_domain_comment' => 'Please specify the Mailgun domain name.', - 'mailgun_secret' => 'Mailgun Secret', + 'mailgun_secret' => 'Mailgun secret', 'mailgun_secret_comment' => 'Enter your Mailgun API key.', 'mandrill' => 'Mandrill', - 'mandrill_secret' => 'Mandrill Secret', - 'mandrill_secret_comment' => 'Enter your Mandrill API key.' + 'mandrill_secret' => 'Mandrill secret', + 'mandrill_secret_comment' => 'Enter your Mandrill API key.', + 'drivers_hint_header' => 'Drivers not installed', + 'drivers_hint_content' => 'This mail method requires the plugin ":plugin" be installed before you can send mail.' ], 'mail_templates' => [ 'menu_label' => 'Mail templates', diff --git a/modules/system/models/mailsettings/_drivers_hint.htm b/modules/system/models/mailsettings/_drivers_hint.htm new file mode 100644 index 000000000..e61ca4178 --- /dev/null +++ b/modules/system/models/mailsettings/_drivers_hint.htm @@ -0,0 +1,11 @@ +hasPlugin('October.Drivers')): ?> +
+
+ +

+
+
+

'October.Drivers'])) ?>

+
+
+ \ No newline at end of file diff --git a/modules/system/models/mailsettings/fields.yaml b/modules/system/models/mailsettings/fields.yaml index c38ecf280..0e37e30fc 100644 --- a/modules/system/models/mailsettings/fields.yaml +++ b/modules/system/models/mailsettings/fields.yaml @@ -20,6 +20,15 @@ tabs: type: dropdown tab: system::lang.mail.general + drivers_hint: + type: partial + path: ~/modules/system/models/mailsettings/_drivers_hint.htm + tab: system::lang.mail.general + trigger: + action: show + field: send_mode + condition: value[mandrill][mailgun] + smtp_address: label: system::lang.mail.smtp_address tab: system::lang.mail.general