2018-05-23 18:03:11 +03:00
|
|
|
{{define "body"}}
|
2018-05-22 10:34:39 +03:00
|
|
|
<div class="row indent-top">
|
2018-05-23 18:03:11 +03:00
|
|
|
<div class="col s12">
|
2018-05-22 10:34:39 +03:00
|
|
|
<ul class="tabs" id="tab">
|
|
|
|
<li class="tab col s6"><a class="active" href="#tab1">{{.Locale.TabSettings}}</a></li>
|
2018-05-23 17:03:37 +03:00
|
|
|
<li class="tab col s6"><a class="" href="#tab2">{{.Locale.TabBots}}</a></li>
|
2018-05-22 10:34:39 +03:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="tab1" class="col s12">
|
|
|
|
<div class="row indent-top">
|
2018-05-23 18:03:11 +03:00
|
|
|
<form id="save" class="tab-el-center" action="/save/" method="POST">
|
2018-08-16 18:13:01 +03:00
|
|
|
<input name="clientId" type="hidden" value="{{.Conn.ClientID}}">
|
2018-05-22 10:34:39 +03:00
|
|
|
<div class="row">
|
|
|
|
<div class="input-field col s12">
|
2018-11-06 14:35:52 +03:00
|
|
|
<input placeholder="CRM Url" id="api_url" name="api_url" type="text" class="validate" value="{{.Conn.APIURL}}" maxlength="255">
|
2018-05-22 10:34:39 +03:00
|
|
|
</div>
|
2018-05-17 18:35:53 +03:00
|
|
|
</div>
|
2018-05-22 10:34:39 +03:00
|
|
|
<div class="row">
|
|
|
|
<div class="input-field col s12">
|
2018-11-06 14:35:52 +03:00
|
|
|
<input placeholder="{{.Locale.ApiKey}}" id="api_key" name="api_key" type="text" class="validate" value="{{.Conn.APIKEY}}" maxlength="100">
|
2018-05-22 10:34:39 +03:00
|
|
|
</div>
|
2018-05-17 18:35:53 +03:00
|
|
|
</div>
|
2018-05-22 10:34:39 +03:00
|
|
|
<div class="row">
|
2018-05-23 17:03:37 +03:00
|
|
|
<div class="input-field col s12 center-align">
|
|
|
|
<button class="btn waves-effect waves-light light-blue darken-1" type="submit" name="action">
|
2018-05-25 18:09:38 +03:00
|
|
|
{{.Locale.ButtonSave}}
|
2018-05-22 10:34:39 +03:00
|
|
|
<i class="material-icons right">sync</i>
|
|
|
|
</button>
|
2018-05-17 18:35:53 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-05-22 10:34:39 +03:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="tab2" class="col s12">
|
2018-08-30 15:07:20 +03:00
|
|
|
<div class="docs">
|
|
|
|
<p>{{.Locale.InfoBot}}</p>
|
|
|
|
</div>
|
2018-05-22 10:34:39 +03:00
|
|
|
<div class="row indent-top">
|
2018-05-23 18:03:11 +03:00
|
|
|
<form id="add-bot" class="tab-el-center" action="/add-bot/" method="POST">
|
2018-05-28 18:16:13 +03:00
|
|
|
<input name="connectionId" type="hidden" value="{{.Conn.ID}}">
|
2018-05-22 10:34:39 +03:00
|
|
|
<div class="row">
|
2018-05-23 17:03:37 +03:00
|
|
|
<div class="input-field col s12">
|
2018-11-06 14:35:52 +03:00
|
|
|
<input placeholder="{{.Locale.TableToken}}" id="token" name="token" type="text" class="validate" maxlength="100">
|
2018-05-22 10:34:39 +03:00
|
|
|
</div>
|
2018-05-23 17:03:37 +03:00
|
|
|
</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>
|
2018-05-22 10:34:39 +03:00
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2018-09-21 12:48:42 +03:00
|
|
|
{{$LangCode := .LangCode}}
|
2018-05-23 18:03:11 +03:00
|
|
|
<table id="bots" class="tab-el-center">
|
2018-05-22 10:34:39 +03:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>{{.Locale.TableName}}</th>
|
|
|
|
<th>{{.Locale.TableToken}}</th>
|
2018-09-21 12:48:42 +03:00
|
|
|
<th>{{.Locale.Language}}</th>
|
2018-06-28 12:17:19 +03:00
|
|
|
<th class="text-left">{{.Locale.TableDelete}}</th>
|
2018-05-22 10:34:39 +03:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{range .Bots}}
|
2018-09-21 12:48:42 +03:00
|
|
|
{{$lang := .Lang}}
|
2018-05-22 10:34:39 +03:00
|
|
|
<tr>
|
|
|
|
<td>{{.Name}}</td>
|
|
|
|
<td>{{.Token}}</td>
|
2018-09-21 12:48:42 +03:00
|
|
|
<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>
|
2018-05-22 10:34:39 +03:00
|
|
|
<td>
|
2018-06-28 12:17:19 +03:00
|
|
|
<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>
|
2018-05-22 10:34:39 +03:00
|
|
|
</button>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{{end}}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
2018-05-17 18:35:53 +03:00
|
|
|
</div>
|
|
|
|
</div>
|
2018-05-22 10:34:39 +03:00
|
|
|
</div>
|
2018-05-23 18:03:11 +03:00
|
|
|
{{end}}
|