1
0
mirror of synced 2024-11-27 06:06:02 +03:00
mg-transport-telegram/templates/form.html
2018-11-06 14:35:52 +03:00

93 lines
4.7 KiB
HTML

{{define "body"}}
<div class="row indent-top">
<div class="col s12">
<ul class="tabs" id="tab">
<li class="tab col s6"><a class="active" href="#tab1">{{.Locale.TabSettings}}</a></li>
<li class="tab col s6"><a class="" href="#tab2">{{.Locale.TabBots}}</a></li>
</ul>
</div>
<div id="tab1" class="col s12">
<div class="row indent-top">
<form id="save" class="tab-el-center" action="/save/" method="POST">
<input name="clientId" type="hidden" value="{{.Conn.ClientID}}">
<div class="row">
<div class="input-field col s12">
<input placeholder="CRM Url" id="api_url" name="api_url" type="text" class="validate" value="{{.Conn.APIURL}}" maxlength="255">
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input placeholder="{{.Locale.ApiKey}}" id="api_key" name="api_key" type="text" class="validate" value="{{.Conn.APIKEY}}" maxlength="100">
</div>
</div>
<div class="row">
<div class="input-field col s12 center-align">
<button class="btn waves-effect waves-light light-blue darken-1" type="submit" name="action">
{{.Locale.ButtonSave}}
<i class="material-icons right">sync</i>
</button>
</div>
</div>
</form>
</div>
</div>
<div id="tab2" class="col s12">
<div class="docs">
<p>{{.Locale.InfoBot}}</p>
</div>
<div class="row indent-top">
<form id="add-bot" class="tab-el-center" action="/add-bot/" method="POST">
<input name="connectionId" type="hidden" value="{{.Conn.ID}}">
<div class="row">
<div class="input-field col s12">
<input placeholder="{{.Locale.TableToken}}" id="token" name="token" type="text" class="validate" maxlength="100">
</div>
</div>
<div class="row">
<div class="input-field col s12 center-align">
<button class="btn waves-effect waves-light light-blue darken-1" type="submit" name="action">
{{.Locale.AddBot}} <i class="material-icons right">add</i>
</button>
</div>
</div>
</form>
{{$LangCode := .LangCode}}
<table id="bots" class="tab-el-center">
<thead>
<tr>
<th>{{.Locale.TableName}}</th>
<th>{{.Locale.TableToken}}</th>
<th>{{.Locale.Language}}</th>
<th class="text-left">{{.Locale.TableDelete}}</th>
</tr>
</thead>
<tbody>
{{range .Bots}}
{{$lang := .Lang}}
<tr>
<td>{{.Name}}</td>
<td>{{.Token}}</td>
<td>
<div class="col s3 sel-lang">
<select data-token="{{.Token}}">
{{range $key, $value := $LangCode}}
<option value="{{$value}}" {{if eq $value $lang}}selected{{end}}>{{$value}}</option>
{{end}}
</select>
</div>
</td>
<td>
<button class="delete-bot btn btn-small waves-effect waves-light light-blue darken-1" type="submit" name="action"
data-token="{{.Token}}">
<i class="material-icons">delete</i>
</button>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</div>
</div>
{{end}}