gocron/templates/manage/mail.html

192 lines
6.7 KiB
Go
Raw Normal View History

2017-04-30 17:12:07 +00:00
{{{ template "common/header" . }}}
<div class="ui grid">
2017-04-30 22:02:49 +00:00
{{{template "manage/menu" .}}}
2017-04-30 17:12:07 +00:00
<div class="twelve wide column">
<div class="pageHeader">
<div class="segment">
<h3 class="ui dividing header">
<div class="content">
{{{.Title}}}
</div>
</h3>
</div>
</div>
<form class="ui form fluid vertical segment mail-server">
<div class="content"></div><br>
<div class="four fields">
<div class="field">
<label>
</label>
<div class="ui small input">
<input type="text" name="host" value="{{{.Mail.Host}}}">
</div>
</div>
<div class="field">
<label>
</label>
<div class="ui small input">
<input type="text" name="port" value="{{{if gt .Mail.Port 0}}}{{{.Mail.Port}}}{{{end}}}">
</div>
</div>
<div class="field">
<label>
</label>
<div class="ui small input">
<input type="text" name="user" value="{{{.Mail.User}}}">
</div>
</div>
<div class="field">
<label>
</label>
<div class="ui small input">
<input type="text" name="password" value="{{{.Mail.Password}}}">
</div>
</div>
</div>
<button class="ui primary button"></button>
<br><br><br>
<div>
<div class="content"></div><p></p>
<div class="fields">
{{{range $i, $v := .Mail.MailUsers}}}
<div class="field">
<div class="ui segment">
{{{.Username}}}-{{{.Email}}}&nbsp;&nbsp;&nbsp;<div class="ui blue button" onclick="removeMailUser({{{.Id}}})"></div>
</div>
</div>
{{{end}}}
</div>
</div>
</form>
<div class="ui facebook button" onclick="createMailUser();"></div>
</div>
</div>
<div class="ui small modal">
<div class="header"></div>
<div class="content">
<form class="ui form mail-user">
<div class="two fields">
<div class="field">
<label>
</label>
<div class="ui small input">
<input type="text" name="username">
</div>
</div>
<div class="field">
<label>
</label>
<div class="ui small input">
<input type="text" name="email">
</div>
</div>
</div>
<button class="ui primary button"></button>
</form>
</div>
</div>
<script type="text/javascript">
$('.mail-server').form(
{
onSuccess: function(event, fields) {
2017-04-30 22:02:49 +00:00
util.post('/manage/mail/server',
2017-04-30 17:12:07 +00:00
fields,
function(code, message) {
util.alertSuccess();
}
);
return false;
},
fields: {
host: {
identifier : 'host',
rules: [
{
type : 'empty',
prompt : ''
}
]
},
port: {
identifier : 'port',
rules: [
{
type : 'integer[1..65535]',
prompt : ''
}
]
},
user: {
identifier : 'user',
rules: [
{
type : 'email',
prompt : ''
}
]
},
password: {
identifier : 'password',
rules: [
{
type : 'empty',
prompt : ''
}
]
}
},
inline : true
});
$('.mail-user').form(
{
onSuccess: function(event, fields) {
2017-04-30 22:02:49 +00:00
util.post('/manage/mail/user',
2017-04-30 17:12:07 +00:00
fields,
function(code, message) {
util.alertSuccess();
location.reload();
}
);
return false;
},
fields: {
username: {
identifier : 'username',
rules: [
{
type : 'empty',
prompt : ''
}
]
},
email: {
identifier : 'email',
rules: [
{
type : 'email',
prompt : ''
}
]
}
},
inline : true
});
function createMailUser() {
$('.ui.modal').modal('show');
}
function removeMailUser(id) {
2017-04-30 22:02:49 +00:00
util.post('/manage/mail/user/remove/' + id, {}, function(code, message) {
2017-04-30 17:12:07 +00:00
location.reload();
});
}
</script>
{{{ template "common/footer" . }}}