Skip to content
Snippets Groups Projects
Commit 03df3233 authored by Jared Hancock's avatar Jared Hancock Committed by Peter Rotich
Browse files

Rework the layout of the email template edit page

parent dd9d30a2
No related branches found
No related tags found
No related merge requests found
......@@ -518,7 +518,8 @@ class EmailTemplate {
$inst = self::lookup(self::create($vars, $errors));
// Inline images (attached to the draft)
$inst->attachments->upload(Draft::getAttachmentIds($inst->getBody()), true);
if ($inst)
$inst->attachments->upload(Draft::getAttachmentIds($inst->getBody()), true);
return $inst;
}
......
......@@ -34,12 +34,12 @@ if (is_a($template, EmailTemplateGroup)) {
$tpl=$msgtemplates[$selected];
?>
<h2>Email Template Message - <span><?php echo $name; ?></span></h2>
<div style="padding-top:10px;padding-bottom:5px;">
<form method="get" action="templates.php?">
<form method="get" action="templates.php?">
<h2><span>Email Template Set &nbsp;/&nbsp; <span><a href="templates.php?tpl_id=<?php echo $tpl_id; ?>"><?php echo $name; ?></a>
<input type="hidden" name="a" value="manage">
<input type="hidden" name="tpl_id" value="<?php echo $tpl_id; ?>">
Message Template:
<div class="pull-right">
<span style="font-size:10pt">Viewing:</span>
<select id="tpl_options" name="id" style="width:300px;">
<option value="">&mdash; Select Setting Group &mdash;</option>
<?php
......@@ -70,9 +70,10 @@ $tpl=$msgtemplates[$selected];
?>
</select>
<input type="submit" value="Go">
&nbsp;&nbsp;&nbsp;<font color="red"><?php echo $errors['tpl']; ?></font>
</form>
</div>
</div>
</h2>
</form>
<hr/>
<form action="templates.php?id=<?php echo $id; ?>&amp;a=manage" method="post" id="save">
<?php csrf_token(); ?>
<?php foreach ($extras as $k=>$v) { ?>
......@@ -82,36 +83,30 @@ $tpl=$msgtemplates[$selected];
<input type="hidden" name="a" value="manage">
<input type="hidden" name="do" value="<?php echo $action; ?>">
<table class="form_table settings_table" width="940" border="0" cellspacing="0" cellpadding="2">
<thead>
<tr>
<th colspan="2">
<h4><?php echo Format::htmlchars($desc['desc']); ?></h4>
<em>Subject and body required. <a class="tip" href="#ticket_variables.txt">Supported Variables</a>.</em>
</th>
</tr>
</thead>
<tbody>
<tr>
<td colspan=2>
<strong>Message Subject:</strong> <em>Email message subject</em> <font class="error">*&nbsp;<?php echo $errors['subject']; ?></font><br>
<input type="text" name="subject" size="60" value="<?php echo $info['subject']; ?>" >
</td>
</tr>
<tr>
<td colspan="2">
<div style="margin-bottom:0.5em;margin-top:0.5em">
<strong>Message Body:</strong> <em>Email message body.</em> <font class="error">*&nbsp;<?php echo $errors['body']; ?></font>
</div>
<input type="hidden" name="draft_id" value=""/>
<textarea name="body" cols="21" rows="16" style="width:98%;" wrap="soft"
class="richtext draft" data-draft-namespace="tpl.<?php echo $selected; ?>"
data-draft-object-id="<?php echo $tpl_id; ?>"><?php echo $info['body']; ?></textarea>
</td>
</tr>
</tbody>
</table>
<p style="padding-left:210px;">
<p>
<h3 style="font-size:12pt;"><?php echo $desc['name']; ?>
&nbsp;<i class="help-tip icon-question-sign"
data-content="<?php echo Format::htmlchars($desc['desc']); ?>"
data-title="<?php echo Format::htmlchars($desc['name']); ?>"></i>
<a style="font-size:10pt" class="tip pull-right" href="#ticket_variables.txt">Supported Variables</a>
</h3>
<?php if ($errors) { ?>
<font class="error"><?php echo $errors['subject']; ?>&nbsp;<?php echo $errors['body']; ?></font>
<?php } ?>
</p>
<div>
<input type="text" name="subject" size="65" value="<?php echo $info['subject']; ?>"
style="font-size:14pt">
<div style="margin-bottom:0.5em;margin-top:0.5em">
</div>
<input type="hidden" name="draft_id" value=""/>
<textarea name="body" cols="21" rows="16" style="width:98%;" wrap="soft"
class="richtext draft" data-draft-namespace="tpl.<?php echo $selected; ?>"
data-draft-object-id="<?php echo $tpl_id; ?>"><?php echo $info['body']; ?></textarea>
</div>
<p style="text-align:center">
<input class="button" type="submit" name="submit" value="Save Changes">
<input class="button" type="reset" name="reset" value="Reset Changes" onclick="javascript:
setTimeout('location.reload()', 25);" />
......
......@@ -111,8 +111,14 @@ jQuery(function() {
});
getHelpTips().then(function(tips) {
var section = tips[elem.attr('href').substr(1)];
if (!section) {
var href = elem.attr('href');
if (href) {
section = tips[elem.attr('href').substr(1)];
}
else if (elem.data('content')) {
section = {title: elem.data('title'), content: elem.data('content')};
}
else {
elem.remove();
clearTimeout(tip_timer);
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment