diff --git a/modules/system/controllers/MailLayouts.php b/modules/system/controllers/MailLayouts.php
index d142cc4ec..da913c2be 100644
--- a/modules/system/controllers/MailLayouts.php
+++ b/modules/system/controllers/MailLayouts.php
@@ -35,4 +35,16 @@ class MailLayouts extends Controller
BackendMenu::setContext('October.System', 'system', 'settings');
SettingsManager::setContext('October.System', 'mail_templates');
}
+
+ public function update_onResetDefault($recordId)
+ {
+ $model = $this->formFindModelObject($recordId);
+
+ $model->fillFromCode();
+ $model->save();
+
+ Flash::success(Lang::get('backend::lang.form.reset_success'));
+
+ return Redirect::refresh();
+ }
}
diff --git a/modules/system/controllers/MailPartials.php b/modules/system/controllers/MailPartials.php
index 4e0606d52..b7692d031 100644
--- a/modules/system/controllers/MailPartials.php
+++ b/modules/system/controllers/MailPartials.php
@@ -35,4 +35,9 @@ class MailPartials extends Controller
BackendMenu::setContext('October.System', 'system', 'settings');
SettingsManager::setContext('October.System', 'mail_templates');
}
+
+ public function formBeforeSave($model)
+ {
+ $model->is_custom = 1;
+ }
}
diff --git a/modules/system/controllers/maillayouts/update.htm b/modules/system/controllers/maillayouts/update.htm
index 62bab8bed..5a403ca0c 100644
--- a/modules/system/controllers/maillayouts/update.htm
+++ b/modules/system/controllers/maillayouts/update.htm
@@ -44,7 +44,16 @@
class="btn btn-default">
= e(trans('backend::lang.form.save_and_close')) ?>
- is_locked): ?>
+ is_locked): ?>
+
+
- is_locked): ?>
-
-
+
= e(trans('backend::lang.form.or')) ?> = e(trans('backend::lang.form.cancel')) ?>
diff --git a/modules/system/models/MailLayout.php b/modules/system/models/MailLayout.php
index ef108d8ec..df7065459 100644
--- a/modules/system/models/MailLayout.php
+++ b/modules/system/models/MailLayout.php
@@ -107,21 +107,21 @@ class MailLayout extends Model
$sections = self::getTemplateSections($path);
$css = '
- @media only screen and (max-width: 600px) {
- .inner-body {
- width: 100% !important;
- }
+@media only screen and (max-width: 600px) {
+ .inner-body {
+ width: 100% !important;
+ }
- .footer {
- width: 100% !important;
- }
- }
+ .footer {
+ width: 100% !important;
+ }
+}
- @media only screen and (max-width: 500px) {
- .button {
- width: 100% !important;
- }
- }
+@media only screen and (max-width: 500px) {
+ .button {
+ width: 100% !important;
+ }
+}
';
$this->name = array_get($sections, 'settings.name', '???');