Added template support for webadmin module

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@612 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2006-02-08 03:19:13 +00:00
parent 6fb82d5b01
commit 60a8f677e4
9 changed files with 508 additions and 0 deletions
@@ -0,0 +1,54 @@
<? INC Header.tmpl ?>
<form action="<? IF Edit ?>/editchan<? ELSE ?>/addchan<? ENDIF ?>" method="post">
<input type="hidden" name="submitted" value="1" />
<input type="hidden" name="user" value="<? VAR User ESC=HTML ?>" />
<div class="section">
<div class="sectiontitle">Channel Info</div>
<div class="sectionbg">
<div class="sectionbody">
<div class="subsection">
<div class="inputlabel">Channel Name:</div>
<? IF Edit ?>
<input type="hidden" name="name" value="<? VAR ChanName ESC=HTML ?>" />
<? VAR ChanName ESC=HTML ?>
<? ELSE ?>
<div><input type="text" name="name" value="" size="32" /></div>
<? ENDIF ?>
</div>
<div class="subsection">
<div class="inputlabel">Buffer Count:</div>
<div><input type="text" name="buffercount" value="<? VAR BufferCount ESC=HTML ?>" size="8" /></div>
</div>
<div class="subsection">
<div class="inputlabel">Default Modes:</div>
<div><input type="text" name="defmodes" value="<? VAR DefModes ESC=HTML ?>" size="16" /></div>
</div>
<div style="clear: both;"></div>
<div class="subsection">
<div class="inputlabel">Save:</div>
<div><input type="checkbox" name="save" id="save" value="true"<? IF InConfig ?> CHECKED<? ENDIF ?> /><label for="save"> Save to config</label></div>
</div>
<div class="subsection">
<div class="inputlabel">Options:</div>
<? LOOP OptionLoop ?>
<input type="checkbox" name="<? VAR Name ESC=HTML ?>" id="opt_<? VAR Name ESC=HTML ?>" value="true"<? IF Checked ?> CHECKED<? ENDIF ?><? IF Disabled ?> DISABLED<? ENDIF ?> /><label for="opt_<? VAR Name ESC=HTML ?>"> <? VAR DisplayName ESC=HTML ?></label>
<? ENDLOOP ?>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>
<input type="submit" value="<? IF Edit ?>Save<? ELSE ?>Add Channel<? ENDIF ?>" />
</form>
<? INC Footer.tmpl ?>
@@ -0,0 +1,3 @@
<? INC Header.tmpl ?>
<h2><?VAR Error ESC=HTML?></h2>
<? INC Footer.tmpl ?>
@@ -0,0 +1,3 @@
</div>
</body>
</html>
@@ -0,0 +1,27 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>ZNC - <?VAR Title ESC=HTML?></title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" alink="#000000" vlink="#000000">
<div id="banner">
<h2><?VAR Title ESC=HTML?></h2>
<div id="ident"><?VAR SessionUser ESC=HTML?>@<?VAR SessionIP ESC=HTML?></div>
<div id="tag"><?VAR Tag ESC=HTML ?></div>
</div>
<? IF IsAdmin ?>
<div id="sidebar">
<ul class="nav">
<li><a href="/">Home</a></li>
<li><a href="/settings">Settings</a></li>
<li><a href="/adduser">Add User</a></li>
<li><a href="/listusers">List Users</a></li>
</ul>
</div>
<? ENDIF ?>
<div id="main">
@@ -0,0 +1,26 @@
<? INC Header.tmpl ?>
<?IF !UserLoop?>
There are no users defined. Click <a href="/adduser">here</a> if you would like to add one.
<?ELSE?>
<table>
<thead>
<tr>
<td>Action</td>
<td>Username</td>
<td>Current Server</td>
</tr>
</thead>
<?LOOP UserLoop?>
<tr class="<?IF __EVEN__?>evenrow<?ELSE?>oddrow<?ENDIF?>">
<td>
[<a href="/edituser?user=<?VAR Username ESC=URL?>">Edit</a>]
[<a href="/deluser?user=<?VAR Username ESC=URL?>">Delete</a>]
</td>
<td><? VAR Username ESC=HTML ?></td>
<td><? VAR Server ESC=HTML DEFAULT="-N/A-" ?></td>
</tr>
<?ENDLOOP?>
</table>
<?ENDIF?>
<? INC Footer.tmpl ?>
+3
View File
@@ -0,0 +1,3 @@
<? INC Header.tmpl ?>
Welcome to the ZNC webadmin module.
<? INC Footer.tmpl ?>
@@ -0,0 +1,72 @@
<? INC Header.tmpl ?>
<form action="/settings" method="post">
<input type="hidden" name="submitted" value="1" />
<div class="section">
<div class="sectiontitle">Settings</div>
<div class="sectionbg">
<div class="sectionbody">
<div class="subsection">
<div class="inputlabel">Status Prefix:</div>
<div><input type="text" name="statusprefix" value="<? VAR StatusPrefix ESC=HTML ?>" size="32" maxlength="128" /></div>
</div>
<div style="clear: both;"></div>
<div class="subsection">
<div class="inputlabel">ISpoofFile:</div>
<div><input type="text" name="ispooffile" value="<? VAR ISpoofFile ESC=HTML ?>" size="32" maxlength="128" /></div>
</div>
<div class="subsection">
<div class="inputlabel">ISpoofFormat:</div>
<div><input type="text" name="ispoofformat" value="<? VAR ISpoofFormat ESC=HTML ?>" size="32" maxlength="128" /></div>
</div>
<div style="clear: both;"></div>
<div class="subsection">
<div class="inputlabel">MOTD:</div>
<div><textarea name="motd" cols="80" rows="5"><? LOOP MOTDLoop ?><? VAR Line ESC=HTML ?>
<? ENDLOOP ?>
</textarea></div>
</div>
<div class="subsection">
<div class="inputlabel">VHosts:</div>
<div><textarea name="vhosts" cols="80" rows="8"><? LOOP VHostLoop ?><? VAR VHost ESC=HTML ?>
<? ENDLOOP ?>
</textarea></div>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>
<div class="section">
<div class="sectiontitle">Global Modules</div>
<div class="sectionbg">
<div class="sectionbody">
<table>
<thead>
<tr>
<td>Name</td>
<td>Arguments</td>
<td>Description</td>
</tr>
</thead>
<? LOOP ModuleLoop ?>
<tr class="background: <? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
<td><input type="checkbox" name="loadmod" id="lm_<? VAR Name ESC=HTML ?>" value="<? VAR Name ESC=HTML ?>"<? IF Checked ?> CHECKED<? ENDIF ?><? IF Disabled ?> DISABLED<? ENDIF ?> /><label for="lm_<? VAR Name ESC=HTML ?>"> <? VAR Name ESC=HTML ?></label></td>
<td><input type="text" name="modargs_<? VAR Name ESC=HTML ?>" value="<? VAR Args ESC=HTML ?>" /></td>
<td><? VAR Description ?></td>
</tr>
<? ENDLOOP ?>
</table>
</div>
</div>
</div>
<input type="submit" value="Submit" />
</form>
<? INC Footer.tmpl ?>
@@ -0,0 +1,210 @@
<? INC Header.tmpl ?>
<form action="<? IF Edit ?>/edituser<? ELSE ?>/adduser<? ENDIF ?>" method="post">
<input type="hidden" name="submitted" value="1" />
<div class="section">
<div class="sectiontitle">Authentication</div>
<div class="sectionbg">
<div class="sectionbody">
<div class="subsection">
<div class="inputlabel">Username:</div>
<div>
<? IF Edit ?>
<input type="hidden" name="user" value="<? VAR Username ESC=HTML ?>" />
<input type="text" name="newuser" value="<? VAR Username ESC=HTML ?>" size="32" maxlength="12" DISABLED />
<? ELSE ?>
<input type="text" name="user" value="<? VAR Username ESC=HTML ?>" size="32" maxlength="12" />
<? ENDIF ?>
</div>
<div class="inputlabel">Password:</div>
<div><input type="password" name="password" size="32" maxlength="16" /></div>
<div class="inputlabel">Confirm Password:</div>
<div><input type="password" name="password2" size="32" maxlength="16" /></div>
</div>
<div>
<div class="inputlabel">Allowed IPs:</div>
<textarea name="allowedips" cols="40" rows="5"><? LOOP AllowedHostLoop ?><? VAR Host ESC=HTML ?>
<? ENDLOOP ?>
</textarea>
<? IF OwnIP ?>
<div class="subsection">
<span style="white-space: nowrap;"><input type="checkbox" name="ownip" id="ownip" value="<? VAR OwnIP ESC=HTML ?>" CHECKED /><label for="ownip"> <? VAR OwnIP ESC=HTML ?> (your current ip)</label></span>&nbsp;&nbsp;
</div>
<? ENDIF ?>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>
<div class="section">
<div class="sectiontitle">IRC Information</div>
<div class="sectionbg">
<div class="sectionbody">
<div class="subsection">
<div class="inputlabel">Nick:</div>
<div><input type="text" name="nick" value="<? VAR Nick ESC=HTML ?>" size="22" maxlength="128" /></div>
</div>
<div class="subsection">
<div class="inputlabel">AltNick:</div>
<div><input type="text" name="altnick" value="<? VAR AltNick ESC=HTML ?>" size="22" maxlength="128" /></div>
</div>
<div class="subsection">
<div class="inputlabel">AwaySuffix:</div>
<div><input type="text" name="awaysuffix" value="<? VAR AwaySuffix ESC=HTML ?>" size="18" maxlength="128" /></div>
</div>
<div class="subsection">
<div class="inputlabel">StatusPrefix:</div>
<div><input type="text" name="statusprefix" value="<? VAR StatusPrefix ESC=HTML ?>" size="16" maxlength="5" /></div>
</div>
<div style="clear: both;"></div>
<div class="subsection">
<div class="inputlabel">Ident:</div>
<div><input type="text" name="ident" value="<? VAR Ident ESC=HTML ?>" size="22" maxlength="128" /></div>
</div>
<div class="subsection">
<div class="inputlabel">RealName:</div>
<div><input type="text" name="realname" value="<? VAR RealName ESC=HTML ?>" size="68" maxlength="256" /></div>
</div>
<div style="clear: both;"></div>
<div class="subsection">
<? IF VHostLoop ?>
<div class="inputlabel">VHost:</div>
<select name="vhost">
<option value="">- Default -</option>
<? LOOP VHostLoop ?><option value="<? VAR VHost ESC=HTML ?>"<? IF Checked ?> SELECTED<? ENDIF ?>><? VAR VHost ESC=HTML ?></option><? ENDLOOP ?>
</select>
<? ENDIF ?>
</div>
<div style="clear: both;"></div>
<div class="subsection">
<div class="inputlabel">QuitMsg:</div>
<div><input type="text" name="quitmsg" value="<? VAR QuitMsg ESC=HTML ?>" size="96" maxlength="256" /></div>
</div>
<div style="clear: both;"></div>
<div class="subsection">
<div class="inputlabel">Servers:</div>
<div><textarea name="servers" cols="40" rows="5"><? LOOP ServerLoop ?><? VAR Server ESC=HTML ?>
<? ENDLOOP ?>
</textarea></div>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>
<div class="section">
<div class="sectiontitle">Modules</div>
<div class="sectionbg">
<div class="sectionbody">
<table>
<thead>
<tr>
<td>Name</td>
<td>Arguments</td>
<td>Description</td>
</tr>
</thead>
<? LOOP ModuleLoop ?>
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
<td>
<input type="checkbox" name="loadmod" id="lm_<? VAR Name ESC=HTML ?>" value="<? VAR Name ESC=HTML ?>"<? IF Checked ?> CHECKED<? ENDIF ?><? IF Disabled ?> DISABLED<? ENDIF ?> /><label for="lm_<? VAR Name ESC=HTML ?>"> <? VAR Name ESC=HTML ?></label>
</td>
<td>
<? IF Disabled ?><? VAR Args ESC=HTML ?><? ELSE ?><input type="text" name="modargs_<? VAR Name ESC=HTML ?>" value="<? VAR Args ESC=HTML ?>" /><? ENDIF ?>
</td>
<td><? VAR Description ESC=HTML ?></td>
</tr>
<? ENDLOOP ?>
</table>
</div>
</div>
</div>
<div class="section">
<div class="sectiontitle">Channels</div>
<div class="sectionbg">
<div class="sectionbody">
<div class="subsection">
<div class="inputlabel">Default Modes:</div>
<div><input type="text" name="chanmodes" value="<? VAR DefaultChanModes ESC=HTML ?>" size="32" maxlength="32" /></div>
</div>
<div style="clear: both;"></div>
<? IF Edit ?>
<table>
<thead>
<tr>
<td>[<a href="/addchan?user=<? VAR Username ESC=URL ?>">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>&nbsp;&nbsp;&lt;- Add a channel (opens in same page)&nbsp;&nbsp;</td>
<? ENDIF ?>
</tr>
</thead>
<? LOOP ChannelLoop ?>
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
<td>
<input type="hidden" name="channel" value="<? VAR Name ESC=HTML ?>" />
[<a href="/editchan?user=<? VAR Username ESC=URL ?>&amp;chan=<? VAR Name ESC=URL ?>">Edit</a>] [<a href="/delchan?user=<? VAR Username ESC=URL ?>&amp;chan=<? VAR Name ESC=URL ?>">Del</a>]
</td>
<td><input type="checkbox" name="save_<? VAR Name ESC=HTML ?>"<? IF InConfig ?> CHECKED<? ENDIF ?> /></td>
<td><? VAR Name ESC=HTML ?></td>
<td><? VAR CurModes ESC=HTML ?></td>
<td><? VAR DefModes ESC=HTML ?></td>
<td><? VAR BufferCount ESC=HTML ?></td>
<td><? VAR Options ESC=HTML ?></td>
</tr>
<? ENDLOOP ?>
</table>
<? ENDIF ?>
</div>
</div>
</div>
<div class="section">
<div class="sectiontitle">ZNC Behavior</div>
<div class="sectionbg">
<div class="sectionbody">
<div class="subsection">
<div class="inputlabel">Playback Buffer Size:</div>
<div><input type="text" name="bufsize" value="<? VAR BufferCount ESC=HTML ?>" size="32" maxlength="9" /></div>
</div>
<div style="clear: both;"></div>
<div style="margin-bottom: 10px;">
<div class="inputlabel">Options:</div>
<? LOOP OptionLoop ?>
<span style="white-space: nowrap;"><input type="checkbox" name="<? VAR Name ESC=HTML?>" id="opt_<? VAR Name ESC=HTML ?>" value="1"<? IF Checked ?> CHECKED<? ENDIF ?><? IF Disabled ?> DISABLED<? ENDIF ?> /><label for="opt_<? VAR Name ESC=HTML ?>"><? VAR DisplayName ESC=HTML ?></label></span>&nbsp;&nbsp;
<? ENDLOOP ?>
</div>
<div class="subsection">
<div class="inputlabel">CTCP Replies:</div>
<div><textarea name="ctcpreplies" cols="40" rows="5"><? LOOP CTCPLoop ?><? VAR CTCP ESC=HTML ?>
<? ENDLOOP ?>
</textarea></div>
</div>
<div style="clear: both;"></div>
</div>
</div>
</div>
<input type="submit" value="Submit" />
</form>
<? INC Footer.tmpl ?>
+110
View File
@@ -0,0 +1,110 @@
body {
width: 800px;
}
table {
border-collapse: collapse;
border: 2px solid #000;
padding: 0px;
margin: 0px;
}
table td {
border: 1px solid #000;
padding: 4px;
margin: 0px;
}
table thead {
border-bottom: 2px solid #000;
background-color: #ff9;
font-weight: bold;
}
#banner {
border-bottom: 2px solid #000;
text-align: center;
}
#ident {
float: left;
font-weight: bold;
text-align: right;
}
#sidebar {
border-right: 1px solid #000;
height: 500px;
width: 100px;
float: left;
}
#main {
margin: 5px 0px 0px 5px;
float: left;
width: 670px;
}
#tag {
font-weight: bold;
text-align: right;
}
.oddrow {
background-color: #ffc;
}
.evenrow {
background-color: #cc9;
}
.inputlabel {
font-size: small;
font-weight: bold;
color: #000;
}
ul.nav, ul.nav ul {
cursor: default;
margin: 0px 0px 0px 0px;
padding: 5px 5px 5px 5px;
}
ul.nav li {
list-style-type: none;
padding: 0px 2px 1px 2px;
margin: 2px 0px 2px 0px;
}
.section {
padding-bottom: 20px;
}
.subsection {
float: left;
margin-right: 10px;
margin-bottom: 10px;
}
.sectiontitle {
float: left;
white-space: nowrap;
background-color: #ff9;
color: #000;
font-weight: bold;
border: 1px solid #000;
padding: 0px 5px 0px 5px;
margin: 0px 15px -10px 8px;
}
.sectionbg {
clear: both;
background-color: #cc9;
color: #000;
border: 2px solid #000;
padding: 0px;
}
.sectionbody {
margin: 15px 5px 5px 15px;
}