zncstrap/modules/webadmin/tmpl/add_edit_network.tmpl
2014-06-14 03:00:40 +08:00

220 lines
9.3 KiB
Cheetah

<? AddRow JSLoop HREF=/modfiles/global/webadmin/webadmin.js ?>
<? INC Header.tmpl ?>
<div class="container">
<div class="panel panel-default">
<div class="panel-heading">Network Info</div>
<div class="panel-body">
<div class="alert alert-warning">To connect to this network from your IRC client, you can set the server password field as follows: <code><? VAR Username ?>/<? IF Edit ?><? VAR Name ?><? ELSE ?>&lt;network&gt;<? ENDIF ?>:&lt;password&gt;</code> or username field as <code><? VAR Username ?>/<? IF Edit ?><? VAR Name ?><? ELSE ?>&lt;network&gt;<? ENDIF ?></code></div>
<form class="form-horizontal" role="form" action="<? IF Edit ?>editnetwork<? ELSE ?>addnetwork<? ENDIF ?>" method="post">
<? INC _csrf_check.tmpl ?>
<div class="section">
<input type="hidden" name="submitted" value="1" />
<input type="hidden" name="user" value="<? VAR Username ?>" />
<? IF Edit ?><input type="hidden" name="network" value="<? VAR Name ?>" /><? ENDIF ?>
<div class="alert alert-info">Nick, AltNick, Ident, RealName, BindHost can be left empty to use the value from the user.</div>
<? IF !Edit ?>
<div class="form-group">
<label for="inputNetworkName" class="col-sm-2 control-label">Network Name:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputNetworkName" name="network" value="<? VAR Name ?>" maxlength="20" placeholder="The name of the IRC network.">
</div>
</div>
<? ENDIF ?>
<div class="form-group">
<label for="inputNickname" class="col-sm-2 control-label">Nickname:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputNickname" name="nick" value="<? VAR Nick ?>" maxlength="30" placeholder="Your nickname on IRC.">
</div>
</div>
<div class="form-group">
<label for="inputAltNickname" class="col-sm-2 control-label">Alt. Nickname:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="AltNickname" name="altnick" value="<? VAR AltNick ?>" maxlength="30" placeholder="Your secondary nickname, if the first is not available on IRC.">
</div>
</div>
<div class="form-group">
<label for="inputIdent" class="col-sm-2 control-label">Ident:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputIdent" name="ident" value="<? VAR Ident ?>" maxlength="30" placeholder="Your ident.">
</div>
</div>
<div class="form-group">
<label for="inputRealname" class="col-sm-2 control-label">Realname:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputRealname" name="realname" value="<? VAR RealName ?>" maxlength="128" placeholder="Your real name.">
</div>
</div>
<? IF BindHostEdit ?>
<div class="form-group">
<label for="inputBindHost" class="col-sm-2 control-label">BindHost:</label>
<div class="col-sm-10">
<? IF BindHostLoop ?>
<select class="form-control" name="bindhost">
<option value="">Default</option>
<? LOOP BindHostLoop ?>
<option value="<? VAR BindHost ?>"<? IF Checked ?> selected="selected"<? ENDIF ?>><? VAR BindHost ?></option>
<? ENDLOOP ?>
</select>
<? ELSE ?>
<input class="form-control" type="text" name="bindhost" value="<? VAR BindHost ?>"/>
<? ENDIF ?>
</div>
</div>
<? ENDIF ?>
<div class="form-group">
<label for="inputActive" class="col-sm-2 control-label">Active:</label>
<div class="col-sm-10">
<div class="checkboxSwitch">
<input type="checkbox" value="1" name="doconnect" id="doconnect_checkbox"<? IF IRCConnectEnabled ?> checked="checked"<? ENDIF ?> />
<label for="doconnect_checkbox"></label>
<span class="help-block">Connect to IRC &amp; automatically re-connect</span>
</div>
</div>
</div>
<div class="form-group">
<label for="inputServers" class="col-sm-2 control-label">Servers of this IRC network:</label>
<div class="col-sm-10">
<textarea class="form-control" name="servers" rows="5"><? LOOP ServerLoop ?><? VAR Server ?><? ENDLOOP ?></textarea>
<span class="help-block">One server per line, "host [[+]port] [password]", + means SSL</span>
</div>
</div>
<h3>Flood Protection</h3>
<hr>
<div class="form-group">
<label for="inputFloodpro" class="col-sm-2 control-label">Flood protection:</label>
<div class="col-sm-10">
<div class="checkboxSwitch">
<input type="checkbox" name="floodprotection" id="floodprotection_checkbox" placeholder="You might enable the flood protection. This prevents `excess flood' errors, which occur, when your IRC bot is command flooded or spammed." onchange="floodprotection_change();" <? IF FloodProtection ?>checked="checked"<? ENDIF ?> />
<label for="floodprotection_checkbox"></label>
</div>
</div>
</div>
<div class="form-group">
<label for="inputFloodproRate" class="col-sm-2 control-label">Flood protection rate:</label>
<div class="col-sm-10">
<input class="form-control" type="number" name="floodrate" min="0.3" step="0.05" id="floodrate" placeholder="The number of seconds per line." <? IF FloodProtection ?> value="<? VAR FloodRate ?>" <? ELSE ?> value="1.00" disabled="disabled" <? ENDIF ?> /> seconds per line
</div>
</div>
<div class="form-group">
<label for="inputFloodproBurst" class="col-sm-2 control-label">Flood protection burst:</label>
<div class="col-sm-10">
<input type="number" class="form-control" name="floodburst" min="1" id="inputFloodproBurst floodburst" placeholder="Defines the number of lines, which can be sent immediately." <? IF FloodProtection ?> value="<? VAR FloodBurst ?>" <? ELSE ?> value="4" disabled="disabled" <? ENDIF ?> /> lines can be sent immediately
</div>
</div>
<script type="text/javascript">floodprotection_change();</script>
<h3>Channels</h3>
<hr>
<? IF !Edit ?>
<span class="info">You will be able to add + modify channels here after you created the network.</span><br />
<? ELSE ?>
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<td><a href="addchan?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Name ESC=URL ?>" class="btn btn-primary btn-xs">Add</a></td>
<? IF ChannelLoop ?>
<td>Save</td>
<td>Name</td>
<td>CurModes</td>
<td>DefModes</td>
<td>BufferCount</td>
<td>Options</td>
<? ELSE ?>
<td>&lt;- Add a channel (opens in same page)</td>
<? ENDIF ?>
</tr>
</thead>
<tbody>
<? LOOP ChannelLoop SORTASC=Name ?>
<tr>
<td>
<input type="hidden" name="channel" value="<? VAR Name ?>" /> <a href="editchan?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Network ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>" class="btn btn-warning btn-xs">Edit</a> <a href="delchan?user=<? VAR Username ESC=URL ?>&amp;network=<? VAR Network ESC=URL ?>&amp;name=<? VAR Name ESC=URL ?>" class="btn btn-danger btn-xs">Del</a>
</td>
<td>
<div class="checkboxSwitchMini">
<input type="checkbox" name="save_<? VAR Name ?>"<? IF InConfig ?> checked="checked"<? ENDIF ?> />
<label for="save_<? VAR Name ?>"></label>
</div>
</td>
<td><? VAR Name ?></td>
<td><? VAR CurModes ?></td>
<td><? VAR DefModes ?></td>
<td><? VAR BufferCount ?></td>
<td><? VAR Options ?></td>
</tr>
<? ENDLOOP ?>
</tbody>
</table>
<? ENDIF ?>
<h3>Modules</h3>
<hr>
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<td>Status</td>
<td>Name</td>
<td>Arguments</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<? LOOP ModuleLoop ?>
<tr>
<td>
<div class="checkboxSwitch">
<input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" value="<? VAR Name ?>"<? IF Checked ?> checked="checked"<? ENDIF ?><? IF Disabled ?> disabled="disabled"<? ENDIF ?> />
<label for="lm_<? VAR Name ?>"></label>
</div>
</td>
<td>
<label for="lm_<? VAR Name ?>"> <? IF Wiki ?><a href="http://wiki.znc.in/<? VAR Wiki ?>" target="_blank"><? VAR Name ?></a> <? ELSE ?> <? VAR Name ?> <? ENDIF ?></label>
</td>
<td>
<? IF Disabled ?>
<? VAR Args ?>
<? ELSE ?>
<input class="form-control" class="third" type="text" name="modargs_<? VAR Name ?>" value="<? VAR Args ?>"
<? IF !HasArgs ?> disabled="disabled"<? ENDIF ?>
<? IF ArgsHelpText ?> data-toggle="tooltip" data-placement="top" data-original-title="<? VAR ArgsHelpText ?>"<? ENDIF ?> />
<? ENDIF ?>
</td>
<td><? VAR Description ?></td>
</tr>
<? ENDLOOP ?>
</tbody>
</table>
<? LOOP EmbeddedModuleLoop ?>
<? IF Embed ?>
<h3>Module <? VAR ModName ?></h3>
<? INC *Embed ?>
<? ENDIF ?>
<? ENDLOOP ?>
<div class="pull-right">
<input class="btn btn-danger" type="reset" value="Reset">
<input class="btn btn-success" type="submit" name="submit_return" value="<? IF Edit ?>Save<? ELSE ?>Save Network<? ENDIF ?>" />
<input class="btn btn-default" type="submit" name="submit_continue" value="<? IF Edit ?>Save and continue<? ELSE ?>Save and continue<? ENDIF ?>" />
</div>
</form>
</div>
</div>
</div>
<? INC Footer.tmpl ?>