zncstrap/modules/webadmin/tmpl/add_edit_network.tmpl
2014-10-31 00:46:36 +08:00

269 lines
12 KiB
Cheetah

<? AddRow JSLoop HREF=/modfiles/global/webadmin/webadmin.js ?>
<? INC Header.tmpl ?>
<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 ?>" />
<input type="hidden" name="network" value="<? VAR Name ?>" />
<div class="container col-md-10 col-md-offset-1">
<div class="panel with-nav-tabs panel-default">
<div class="panel-heading">
<ul class="nav nav-tabs">
<li class="active"><a href="#netinfotab" data-toggle="tab">Network Info</a></li>
<li><a href="#floodprotab" data-toggle="tab">Flood Protection</a></li>
<li><a href="#channelstab" data-toggle="tab">Channels</a></li>
<li><a href="#modulestab" data-toggle="tab">Modules</a></li>
</ul>
</div>
<div class="panel-body">
<div class="tab-content">
<!-- Network Info -->
<div class="tab-pane fade in active" id="netinfotab">
<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>
<div class="alert alert-info">Nick, AltNick, Ident, RealName, BindHost can be left empty to use the value from the user.</div>
<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="name" value="<? VAR Name ?>" maxlength="20" placeholder="The name of the IRC network.">
</div>
</div>
<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="inputQuit" class="col-sm-2 control-label">Quit Message:</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputQuit" name="quitmsg" value="<? VAR QuitMsg ?>" maxlength="256" placeholder="You may define a Message shown, when you quit IRC.">
</div>
</div>
<div class="form-group">
<label for="inputActive" class="col-sm-2 control-label">Active:</label>
<div class="col-sm-10">
<div class="switch">
<input type="checkbox" value="1" name="doconnect" class="cmn-toggle cmn-toggle-round-flat" 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>
</div> <!-- Network Info -->
<!-- Flood Protection -->
<div class="tab-pane fade" id="floodprotab">
<div class="form-group">
<label for="inputFloodpro" class="col-sm-2 control-label">Flood protection:</label>
<div class="col-sm-10">
<div class="switch">
<input type="checkbox" name="floodprotection" id="floodprotection_checkbox" class="cmn-toggle cmn-toggle-round-flat" onchange="floodprotection_change();" <? IF FloodProtection ?>checked="checked"<? ENDIF ?> />
<label for="floodprotection_checkbox"></label>
<span class="help-block">This prevents 'excess flood' errors, which occur, when an IRC robot is command flooded or spammed.</span>
</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>
<div class="form-group">
<label for="inputJoinDelay" class="col-sm-2 control-label">Channel join delay:</label>
<div class="col-sm-10">
<input class="form-control" type="number" name="joindelay" id="joindelay" min="0" placeholder="Defines the delay in seconds, until channels are joined after getting connected." value="<? VAR JoinDelay ?>"/> seconds
</div>
</div>
<script type="text/javascript">floodprotection_change();</script>
</div> <!-- Flood Protection -->
<!-- Channels -->
<div class="tab-pane fade" id="channelstab">
<? 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 class="text-center">
<div class="switch">
<input type="checkbox" name="save_<? VAR Name ?>" class="cmn-toggle cmn-toggle-round-flat"<? 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 ?>
</div> <!-- Channels -->
<!-- Modules -->
<div class="tab-pane fade" id="modulestab">
<table class="table table-bordered table-hover table-striped">
<thead>
<tr>
<td>Status</td>
<td>Name</td>
<td>Arguments</td>
<td>Description</td>
<td>Global</td>
<td>Networks</td>
</tr>
</thead>
<tbody>
<? LOOP ModuleLoop ?>
<tr>
<td>
<div class="switch">
<input type="checkbox" name="loadmod" id="lm_<? VAR Name ?>" class="cmn-toggle cmn-toggle-round-flat" 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 ?> autocomplete="off"/>
<? ENDIF ?>
</td>
<td><? VAR Description ?></td>
<td>
<? IF CanBeLoadedGlobally ?>
<div class="checkboxSwitchMini">
<input type="checkbox" name="loaded_globally" id="loaded_globally_<? VAR Name ?>" value="<? VAR Name ?>"<? IF LoadedGloabally?> checked="checked" <? ENDIF ?> class="sr-only" disabled="disabled" /> <? ENDIF ?>
<label for="loaded_globally_<? VAR Name ?>"></label>
</div>
<? ENDIF ?>
</td>
<td>
<? IF CanBeLoadedByUser ?>
<div class="checkboxSwitchMini">
<input type="checkbox" name="loaded_by_user" id="loaded_by_user_<? VAR Name ?>" value="<? VAR Name ?>"<? IF LoadedByUser ?> checked="checked" <? ENDIF ?> class="sr-only" disabled="disabled" /> <? ENDIF ?>
<label for="loaded_by_user_<? VAR Name ?>"></label>
</div>
<? ENDIF ?>
</td>
</tr>
<? ENDLOOP ?>
</tbody>
</table>
</div> <!-- Modules -->
<!-- Other Modules -->
<div class="tab-pane fade" id="othermods">
<? LOOP EmbeddedModuleLoop ?>
<? IF Embed ?>
<h3>Module <? VAR ModName ?></h3>
<? INC *Embed ?>
<? ENDIF ?>
<? ENDLOOP ?>
</div> <!-- Other Modules -->
</div>
</div>
<div class="panel-footer text-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>
</div>
</div>
</form>
<? INC Footer.tmpl ?>