diff options
| author | Denis M. (Phr33d0m) <god@politeia.in> | 2013-10-13 15:42:12 +0200 |
|---|---|---|
| committer | Denis M. (Phr33d0m) <god@politeia.in> | 2013-11-04 23:59:55 +0100 |
| commit | 8267407a78375652859f9e6b0a3a6fbabdd4a98b (patch) | |
| tree | 423533aa212fb2a12f3aaac05af8567168b8b478 | |
| parent | 6e8d2bf09dbc349df5e2d2094a83a60c6309b76b (diff) | |
Add a couple of usability and aesthetic changes, fix the half-broken chanlist functionality, add a couple of missing ESCAPED_CHANNEL vars
Add missing ESCAPED_CHANNEL
Changed EMAIL_TYPE to FORCE_EMAIL. Now makes more sense
Make it more obvious when the 'email' field is optional
Add a 'Retry' button to go back to the registration page
Fixed broken chanlist functionality. Before even if the user clicked on the channels nothing happened, now it goes straight to the 'set' page (at least something happens)
Small fix, disable the 'Save' button if user has no SET powers
Add another missing ESCAPED_CHANNEL
Add a more clear definition of what hostmasks are allowed in that field, either user@host or nick\!user@host
Fix wrongly placed var
Changed some aesthetics
13 files changed, 44 insertions, 17 deletions
diff --git a/modules/extra/webcpanel/pages/chanserv/drop.cpp b/modules/extra/webcpanel/pages/chanserv/drop.cpp index 21e968c18..c6984988c 100644 --- a/modules/extra/webcpanel/pages/chanserv/drop.cpp +++ b/modules/extra/webcpanel/pages/chanserv/drop.cpp @@ -42,7 +42,12 @@ bool WebCPanel::ChanServ::Drop::OnRequest(HTTPProvider *server, const Anope::str } if (message.get_data.count("channel") > 0) - replacements["CHANNEL_DROP"] = message.get_data["channel"]; + { + const Anope::string &chname = message.get_data["channel"]; + + replacements["CHANNEL_DROP"] = chname; + replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname); + } TemplateFileServer page("chanserv/drop.html"); page.Serve(server, page_name, client, message, reply, replacements); diff --git a/modules/extra/webcpanel/pages/chanserv/set.cpp b/modules/extra/webcpanel/pages/chanserv/set.cpp index 35861ad19..dba11557c 100644 --- a/modules/extra/webcpanel/pages/chanserv/set.cpp +++ b/modules/extra/webcpanel/pages/chanserv/set.cpp @@ -110,6 +110,7 @@ bool WebCPanel::ChanServ::Set::OnRequest(HTTPProvider *server, const Anope::stri replacements["SUCCESSOR"] = ci->GetSuccessor()->display; replacements["TIME_REGISTERED"] = Anope::strftime(ci->time_registered, na->nc); replacements["LAST_USED"] = Anope::strftime(ci->last_used, na->nc); + replacements["ESCAPED_CHANNEL"] = HTTPUtils::URLEncode(chname); if (!ci->last_topic.empty()) { diff --git a/modules/extra/webcpanel/pages/register.cpp b/modules/extra/webcpanel/pages/register.cpp index 730db612d..c2c5d5d31 100644 --- a/modules/extra/webcpanel/pages/register.cpp +++ b/modules/extra/webcpanel/pages/register.cpp @@ -13,8 +13,8 @@ bool WebCPanel::Register::OnRequest(HTTPProvider *server, const Anope::string &p replacements["TITLE"] = page_title; - if (!Config->GetModule("nickserv")->Get<bool>("forceemail", "yes")) - replacements["EMAIL_TYPE"] = "hidden"; + if (Config->GetModule("nickserv")->Get<bool>("forceemail", "yes")) + replacements["FORCE_EMAIL"] = "yes"; TemplateFileServer page("register.html"); diff --git a/modules/extra/webcpanel/templates/default/chanserv/access.html b/modules/extra/webcpanel/templates/default/chanserv/access.html index 09bc26d8d..c50434f8a 100644 --- a/modules/extra/webcpanel/templates/default/chanserv/access.html +++ b/modules/extra/webcpanel/templates/default/chanserv/access.html @@ -46,7 +46,7 @@ <div class="form-group"> <label class="control-label col-lg-2" for="mask">Mask:</label> <div class="col-lg-6"> - <input class="form-control" type="text" name="mask" id="mask" placeholder="Valid HostMask"> + <input class="form-control" type="text" name="mask" id="mask" placeholder="Mask must be in the form nick!user@host"> </div> </div> <div class="form-group"> diff --git a/modules/extra/webcpanel/templates/default/chanserv/akick.html b/modules/extra/webcpanel/templates/default/chanserv/akick.html index 75cf894e2..ddfea546c 100644 --- a/modules/extra/webcpanel/templates/default/chanserv/akick.html +++ b/modules/extra/webcpanel/templates/default/chanserv/akick.html @@ -41,7 +41,7 @@ <div class="form-group"> <label class="control-label col-lg-2" for="mask">Mask:</label> <div class="col-lg-6"> - <input class="form-control" type="text" name="mask" id="mask" placeholder="Valid HostMask"> + <input class="form-control" type="text" name="mask" id="mask" placeholder="Mask must be in the form nick!user@host"> </div> </div> <div class="form-group"> diff --git a/modules/extra/webcpanel/templates/default/chanserv/chanlist.html b/modules/extra/webcpanel/templates/default/chanserv/chanlist.html index 4d386f6b0..8f00f02ac 100644 --- a/modules/extra/webcpanel/templates/default/chanserv/chanlist.html +++ b/modules/extra/webcpanel/templates/default/chanserv/chanlist.html @@ -1,13 +1,17 @@ -<!--- <div class="panel-heading">Channels you have access in</div> --> +<div class="panel-heading">Channels you have access in</div> <div class="panel-body"> {IF EXISTS CHANNEL_NAMES} <div> <h3 style="margin: -12px 0 20px 0;"><small>Choose a channel to access it's Settings, Access or Akick pages.</small></h3> {FOR CH,ECH IN CHANNEL_NAMES,ESCAPED_CHANNEL_NAMES} - <td><a href="{PAGE_NAME}?channel={ECH}" class="btn btn-sm btn-primary {IF EQ ECH ESCAPED_CHANNEL}disabled{END IF}">{CH}</a></td> + {IF EQ PAGE_NAME /chanserv/info} + <a href="set?channel={ECH}" class="btn btn-sm btn-primary {IF EQ ECH ESCAPED_CHANNEL}disabled{END IF}" style="margin-bottom: 4px;">{CH}</a> + {ELSE} + <a href="{PAGE_NAME}?channel={ECH}" class="btn btn-sm btn-primary {IF EQ ECH ESCAPED_CHANNEL}disabled{END IF}" style="margin-bottom: 4px;">{CH}</a> + {END IF} {END FOR} </div> {ELSE} <em>You don't have access in any channels.</em><br> {END IF} -</div><br> +</div> diff --git a/modules/extra/webcpanel/templates/default/chanserv/drop.html b/modules/extra/webcpanel/templates/default/chanserv/drop.html index 23cb42a1e..c28eb051a 100644 --- a/modules/extra/webcpanel/templates/default/chanserv/drop.html +++ b/modules/extra/webcpanel/templates/default/chanserv/drop.html @@ -15,13 +15,13 @@ <input type="hidden" value="{CHANNEL_DROP}" name="channel"> <input type="hidden" value="yes" name="drop"> <div class="form-group"> - <label class="control-label col-lg-3" for="confChan">Confirm channel name:</label> + <label class="control-label col-lg-4" for="confChan">Confirm channel name:</label> <div class="col-lg-4"> <input class="form-control" type="text" name="confChan" id="confChan" placeholder="This cannot be undone!"> </div> </div> <div class="form-group"> - <div class="col-lg-offset-3 col-lg-4"> + <div class="col-lg-offset-4 col-lg-4"> <button type="submit" class="btn btn-danger">Drop</button> </div> </div> diff --git a/modules/extra/webcpanel/templates/default/chanserv/modes.html b/modules/extra/webcpanel/templates/default/chanserv/modes.html index 861bb0985..3c7fe7ab3 100644 --- a/modules/extra/webcpanel/templates/default/chanserv/modes.html +++ b/modules/extra/webcpanel/templates/default/chanserv/modes.html @@ -42,7 +42,7 @@ <div class="form-group"> <label class="control-label col-lg-2" for="mask">Mask:</label> <div class="col-lg-6"> - <input class="form-control" type="text" name="mask" id="mask" placeholder="Valid HostMask"> + <input class="form-control" type="text" name="mask" id="mask" placeholder="Mask must be in the form nick!user@host"> </div> </div> <div class="form-group"> diff --git a/modules/extra/webcpanel/templates/default/chanserv/set.html b/modules/extra/webcpanel/templates/default/chanserv/set.html index 0a26e3d74..050c37f69 100644 --- a/modules/extra/webcpanel/templates/default/chanserv/set.html +++ b/modules/extra/webcpanel/templates/default/chanserv/set.html @@ -9,7 +9,9 @@ {END FOR} {IF EXISTS OKAY} - {IF EXISTS CAN_SET}<form method="post" action="/chanserv/set?channel={CHANNEL_ESCAPED}">{END IF} + {IF EXISTS CAN_SET} + <form method="post" action="/chanserv/set?channel={CHANNEL_ESCAPED}"> + {END IF} <table id="tableInfo" class="table table-hover"> <tr> <td>Channel Name</td> @@ -74,13 +76,18 @@ <td>Topic Lock</td> <td><input type="checkbox" name="topiclock" value="on" {IF EXISTS TOPICLOCK}checked{END IF}></td> </tr> + {IF EXISTS CAN_SET} <tr> <td></td> <td><button type="submit" class="btn btn-primary">Save</button></td> </tr> {END IF} + {END IF} </table> - {IF EXISTS CAN_SET}</form>{END IF} + + {IF EXISTS CAN_SET} + </form> + {END IF} {END IF} </div> {INCLUDE footer.html} diff --git a/modules/extra/webcpanel/templates/default/confirm.html b/modules/extra/webcpanel/templates/default/confirm.html index 17b0f7816..f9f315fd3 100644 --- a/modules/extra/webcpanel/templates/default/confirm.html +++ b/modules/extra/webcpanel/templates/default/confirm.html @@ -24,12 +24,14 @@ <h1 class="form-signin-heading">Register</h1> {IF EXISTS MESSAGES} - <div class="alert alert-info"> + <div class="alert alert-warning"> {FOR M IN MESSAGES} {M}<br/> {END FOR} </div> {END IF} + + <a href="/register" class="btn btn-lg btn-default btn-block">Retry</a> </div> </div> diff --git a/modules/extra/webcpanel/templates/default/nickserv/access.html b/modules/extra/webcpanel/templates/default/nickserv/access.html index c5397a4a0..d4be56279 100644 --- a/modules/extra/webcpanel/templates/default/nickserv/access.html +++ b/modules/extra/webcpanel/templates/default/nickserv/access.html @@ -29,7 +29,7 @@ <div class="form-group"> <label class="control-label col-lg-2" for="message">Hostmask:</label> <div class="col-lg-5"> - <input class="form-control" type="text" name="message" id="message" placeholder="Your message here"> + <input class="form-control" type="text" name="message" id="message" placeholder="Mask must be in the form user@host"> </div> </div> <div class="form-group"> diff --git a/modules/extra/webcpanel/templates/default/operserv/akill.html b/modules/extra/webcpanel/templates/default/operserv/akill.html index 9b269a7c0..2a6bf4f56 100644 --- a/modules/extra/webcpanel/templates/default/operserv/akill.html +++ b/modules/extra/webcpanel/templates/default/operserv/akill.html @@ -51,7 +51,7 @@ <div class="form-group"> <label class="control-label col-lg-2" for="mask">HostMask:</label> <div class="col-lg-6"> - <input class="form-control" type="text" name="mask" id="mask" placeholder="Valid HostMask"> + <input class="form-control" type="text" name="mask" id="mask" placeholder="Mask must be in the form user@host"> </div> </div> <div class="form-group"> diff --git a/modules/extra/webcpanel/templates/default/register.html b/modules/extra/webcpanel/templates/default/register.html index 821911b9b..bebf4e276 100644 --- a/modules/extra/webcpanel/templates/default/register.html +++ b/modules/extra/webcpanel/templates/default/register.html @@ -34,8 +34,16 @@ style="margin-bottom: -1px; border-bottom-left-radius: 0; border-bottom-right-radius: 0;"> <input type="password" name="password" class="form-control" placeholder="Password" required="required" style="margin-bottom: -1px; border-radius: 0;"> + + {IF EXISTS FORCE_EMAIL} + <input type="email" name="email" class="form-control" placeholder="Email" required="required" + style="margin-bottom: 15px; border-top-left-radius: 0; border-top-right-radius: 0;"> + {ELSE} + <h4>Optional</h4> <input type="email" name="email" class="form-control" placeholder="Email" - style="margin-bottom: 10px; border-top-left-radius: 0; border-top-right-radius: 0;"> + style="margin-bottom: 15px;"> + {END IF} + <button class="btn btn-lg btn-warning btn-block" type="submit">Register</button> </form> </div> |
