[SCM] Code for the Debian Games Parties branch, master, updated. 2183807ac104c0c509f20d8d9c6a47ec91e7a219

Paul Wise pabs at debian.org
Fri Jul 30 20:55:15 UTC 2010


The following commit has been merged in the master branch:
commit 2183807ac104c0c509f20d8d9c6a47ec91e7a219
Author: Paul Wise <pabs at debian.org>
Date:   Fri Jul 30 16:55:11 2010 -0400

    Handle an empty IRC nick correctly.

diff --git a/screenshots/javascript/scripts.js b/screenshots/javascript/scripts.js
index 35eeb94..2db733c 100644
--- a/screenshots/javascript/scripts.js
+++ b/screenshots/javascript/scripts.js
@@ -10,8 +10,16 @@ function set_cookie(name,value){
 
 function save_irc_nick(irc_nick){
 	set_cookie('irc_nick', irc_nick);
-	$("#text_irc_nick").show().text(irc_nick);
-	$("#edit_irc_nick").remove();
+	if( irc_nick.length ){
+		$("#form_unset_irc_nick").show();
+		$("#form_set_irc_nick").hide();
+		$("#text_irc_nick").show().text(irc_nick);
+		$("#edit_irc_nick").remove();
+	} else {
+		$("#form_unset_irc_nick").hide();
+		$("#form_set_irc_nick").show();
+		$("#irc_nick").show().text(irc_nick);
+	}
 }
 
 function init(){
diff --git a/screenshots/templates/page.html b/screenshots/templates/page.html
index 288be10..82d7b17 100644
--- a/screenshots/templates/page.html
+++ b/screenshots/templates/page.html
@@ -11,25 +11,23 @@
 
 	<p>Please read the <a href="http://wiki.debian.org/Games/Parties/Screenshots">wiki page for more information</a> about the party.</>
 
-	{% if irc_nick %}
-		<form id="form_unset_irc_nick" action="{% url parties.screenshots.views.unset_irc_nick %}" method="post">
-		<p>
-			IRC nickname:
-			<span id="text_irc_nick">{{ irc_nick }}</span>
-			<input type="submit" name="edit_irc_nick" id="edit_irc_nick" value="Edit" />
-			<input type="hidden" name="page" value="{{ pagination.number }}"/>
-		</p>
-		</form>
-	{% else %}
-		<form id="form_set_irc_nick" action="{% url parties.screenshots.views.set_irc_nick %}" method="post">
-		<p>
-			Please set an IRC nickname:
-			<input type="text" name="irc_nick" id="irc_nick" value="" />
-			<input type="submit" name="go_irc_nick" id="go_irc_nick" value="Go" />
-			<input type="hidden" name="page" value="{{ pagination.number }}"/>
-		</p>
-		</form>
-	{% endif%}
+	<form id="form_unset_irc_nick" action="{% url parties.screenshots.views.unset_irc_nick %}" method="post" style="{% if not irc_nick %}display: none;{% endif %}">
+	<p>
+		IRC nickname:
+		<span id="text_irc_nick">{{ irc_nick }}</span>
+		<input type="submit" name="edit_irc_nick" id="edit_irc_nick" value="Edit" />
+		<input type="hidden" name="page" value="{{ pagination.number }}"/>
+	</p>
+	</form>
+
+	<form id="form_set_irc_nick" action="{% url parties.screenshots.views.set_irc_nick %}" method="post"  style="{% if irc_nick %}display: none;{% endif %}">
+	<p>
+		Please set an IRC nickname:
+		<input type="text" name="irc_nick" id="irc_nick" value="" />
+		<input type="submit" name="go_irc_nick" id="go_irc_nick" value="Go" />
+		<input type="hidden" name="page" value="{{ pagination.number }}"/>
+	</p>
+	</form>
 
 	<br clear="left"/>
 

-- 
Code for the Debian Games Parties



More information about the Pkg-games-commits mailing list