diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2009-08-19 21:29:51 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2009-08-19 21:29:51 -0400 |
commit | 2022b772a01f36fa74de002b5370dd70b6c051ba (patch) | |
tree | 2ce70a5d5fb0eab245126fab7fac628fab0cffbe /templates | |
parent | 1bc0d490820c4587a8902747e8516aa6ae98a515 (diff) | |
download | askbot-2022b772a01f36fa74de002b5370dd70b6c051ba.tar.gz askbot-2022b772a01f36fa74de002b5370dd70b6c051ba.tar.bz2 askbot-2022b772a01f36fa74de002b5370dd70b6c051ba.zip |
added Adolfos mods, django_authopeid bug, unified traditional and OpenID login
Diffstat (limited to 'templates')
-rw-r--r-- | templates/authopenid/sendpw.html | 2 | ||||
-rw-r--r-- | templates/authopenid/settings.html | 2 | ||||
-rw-r--r-- | templates/authopenid/signin.html | 79 | ||||
-rw-r--r-- | templates/content/jquery-openid/images/local-login.png | bin | 0 -> 2522 bytes | |||
-rw-r--r-- | templates/content/jquery-openid/images/openidico16.png | bin | 0 -> 554 bytes | |||
-rw-r--r-- | templates/content/jquery-openid/jquery.openid.js | 19 | ||||
-rw-r--r-- | templates/content/jquery-openid/openid.css | 16 | ||||
-rw-r--r-- | templates/content/style/style.css | 4 | ||||
-rw-r--r-- | templates/footer.html | 2 | ||||
-rw-r--r-- | templates/question.html | 4 |
10 files changed, 87 insertions, 41 deletions
diff --git a/templates/authopenid/sendpw.html b/templates/authopenid/sendpw.html index 383723ca..37091261 100644 --- a/templates/authopenid/sendpw.html +++ b/templates/authopenid/sendpw.html @@ -13,7 +13,7 @@ {% trans "Please enter your username below and new password will be sent to your registered e-mail" %} </div> {% if form.errors %} -<p class="errors"><span class="big">{% "Sorry, looks like we have some errors:" %}</span><br/> +<p class="errors"><span class="big">{% trans "Sorry, looks like we have some errors:" %}</span><br/> {% if form.username.errors %} <span class="error">{{ form.username.errors|join:", " }}</span> {% endif %} diff --git a/templates/authopenid/settings.html b/templates/authopenid/settings.html index a373324e..ecc16c72 100644 --- a/templates/authopenid/settings.html +++ b/templates/authopenid/settings.html @@ -31,7 +31,7 @@ <dt>» <a href="{% url user_changeemail %}">{% trans "Change email " %}</a></dt> <dd>{% trans "Add or update the email address associated with your account." %}</dd> {% if is_openid %} - <dt>» <a href="{% url user_changeopenid %}">{% trans "Change OpenID %}</a></dt> + <dt>» <a href="{% url user_changeopenid %}">{% trans "Change OpenID" %}</a></dt> <dd>{% trans "Change openid associated to your account" %}</dd> {% endif %} diff --git a/templates/authopenid/signin.html b/templates/authopenid/signin.html index 8601f6ee..60aa5e5d 100644 --- a/templates/authopenid/signin.html +++ b/templates/authopenid/signin.html @@ -37,14 +37,16 @@ {% endblocktrans %} </div> {% endif %} - <div style="width:600px;float:left;margin-bottom:5px;">{% trans "Click to sign in through any of these services." %}</div> <form id="openid_form" name="openid_form" class="openid" method="post" action="{% url user_signin %}"> + <div style="width:600px;float:left;margin-bottom:5px;"> + {% trans "Click to sign in through any of these services." %} + </div> <ul class="providers"> - <li class="openid" title="OpenID"> - <div class="logo_box openid_box"> - <img src="/content/jquery-openid/images/openid.gif" alt="icon" /> + <li class="local" title="Local login"> + <div class="logo_box local_login_box"> + <img src="/content/jquery-openid/images/local-login.png" alt="icon" /> </div> - <span><strong>http://{your-openid-url}</strong></span> + <span></span> </li> <li class="direct" title="Google"> <div class="logo_box google_box"> @@ -61,7 +63,17 @@ <img src="/content/jquery-openid/images/aol.gif" alt="icon" /><span>http://openid.aol.com/<strong>username</strong></span> </div> </li> - <li class="username first_tiny_li" title="MyOpenID user name"> + <!--<li class="openid" title="OpenID"> + <div class="logo_box openid_box"> + <img src="/content/jquery-openid/images/openid.gif" alt="icon" /> + </div> + <span><strong>http://{your-openid-url}</strong></span> + </li>--> + <li class="openid first_tiny_li" title="OpenID URL"> + <img src="/content/jquery-openid/images/openidico16.png" alt="icon" /> + <span>http://{your-openid-url}</span> + </li> + <li class="username" title="MyOpenID user name"> <img src="/content/jquery-openid/images/myopenid-2.png" alt="icon" /> <span>http://<strong>username</strong>.myopenid.com/</span> </li> @@ -111,36 +123,33 @@ <div><p><input id="openid_url" type="text" value="http://" name="openid_url" /> <input id="bsignin" name="bsignin" type="submit" value="{% trans "Login" %}" /></p></div> </fieldset> + <fieldset id='local_login_fs'> + <p>{% trans 'Enter your login name and password' %}</p> + {% if form1.errors %} + <p class="errors"> + <span class="big">{% trans "Sorry, looks like we have some errors:" %}</span><br/> + <ul class="error-list"> + {% if form1.username.errors %} + <li><span class="error">{{ form1.username.errors|join:", " }}</span></li> + {% endif %} + {% if form1.password.errors %} + <li><span class="error">{{ form1.password.errors|join:", " }}</span></li> + {% endif %} + </ul> + </p> + {% endif %} + <div><label for="username">{% trans "Login name" %}</label> + {{form1.username}}<br/> + <label for="password">{% trans "Password" %}</label> + {{form1.password}}<br/> + <p id="local_login_buttons"> + <input id="blogin" name="blogin" type="submit" value="{% trans "Login" %}" /> + <a href="{% url user_signup %}">{% trans "Create account" %}</a><br/> + <a href="{% url user_sendpw %}">{% trans "I forgot my password" %}</a> + </p> + </div> + </fieldset> </form> -<div class="login"> - <p style="display:none">{% trans "we support two login modes" %}</p> - <div style="display:none"> - {% if form1.errors %} - <p class="errors"> - <span class="big">{% trans "Sorry, looks like we have some errors:" %}</span><br/> - <ul class="error-list"> - {% if form1.username.errors %} - <li><span class="error">{{ form1.username.errors|join:", " }}</span></li> - {% endif %} - {% if form1.password.errors %} - <li><span class="error">{{ form1.password.errors|join:", " }}</span></li> - {% endif %} - </ul> - </p> - {% endif %} - <form name="fauth" action="{% url user_signin %}" method="post"> - {{ form1.next }} - <fieldset class="fieldset" > - <legend class="big">{% trans "Use login name and password" %}</legend> - <div class="form-row"><label for="id_username">{% trans "Login name" %}:</label><br />{{ form1.username }}</div> - <div class="form-row"><label for="id_password">{% trans "Password" %}:</label><br />{{ form1.password }}</div> - <div class="submit-row"><input type="submit" class="submit" name="blogin" value="{% trans "Login" %}"/> - <a href="">{% trans "Forgot your password?" %}</a> - <a href="">{% trans "Create new account" %}</a></div> - </fieldset> - </form> - </div> -</div> {% endblock %} {% block sidebar %} diff --git a/templates/content/jquery-openid/images/local-login.png b/templates/content/jquery-openid/images/local-login.png Binary files differnew file mode 100644 index 00000000..258cedac --- /dev/null +++ b/templates/content/jquery-openid/images/local-login.png diff --git a/templates/content/jquery-openid/images/openidico16.png b/templates/content/jquery-openid/images/openidico16.png Binary files differnew file mode 100644 index 00000000..ad718ac5 --- /dev/null +++ b/templates/content/jquery-openid/images/openidico16.png diff --git a/templates/content/jquery-openid/jquery.openid.js b/templates/content/jquery-openid/jquery.openid.js index eec29ab2..6486fd39 100644 --- a/templates/content/jquery-openid/jquery.openid.js +++ b/templates/content/jquery-openid/jquery.openid.js @@ -13,6 +13,7 @@ $.fn.openid = function() { var $end = $this.find('p:has(input[name=openid_username])>span:eq(1)'); //needed for special effects only + var $localfs = $this.find('fieldset:has(input[name=username])'); var $usrfs = $this.find('fieldset:has(input[name=openid_username])'); var $idfs = $this.find('fieldset:has(input[name=openid_url])'); @@ -33,11 +34,23 @@ $.fn.openid = function() { return true; }; + var local = function() { + var $li = $(this); + $li.parent().find('li').removeClass('highlight'); + $li.addClass('highlight'); + $usrfs.hide(); + $idfs.hide(); + $localfs.show(); + $this.unbind('submit').submit(submitid); + return false; + }; + var direct = function() { var $li = $(this); $li.parent().find('li').removeClass('highlight'); $li.addClass('highlight'); $usrfs.fadeOut('slow'); + $localfs.fadeOut('slow'); $idfs.fadeOut('slow'); $id.val($this.find("li.highlight span").text()); setTimeout(function(){$('#bsignin').click()},1000); @@ -49,6 +62,7 @@ $.fn.openid = function() { $li.parent().find('li').removeClass('highlight'); $li.addClass('highlight'); $usrfs.hide(); + $localfs.hide(); $idfs.show(); $id.focus(); $this.unbind('submit').submit(submitid); @@ -60,6 +74,7 @@ $.fn.openid = function() { $li.parent().find('li').removeClass('highlight'); $li.addClass('highlight'); $idfs.hide(); + $localfs.hide(); $usrfs.show(); $this.find('#enter_your_what').text($li.attr("title")); $front.text($li.find("span").text().split("username")[0]); @@ -69,6 +84,7 @@ $.fn.openid = function() { return false; }; + $this.find('li.local').click(local); $this.find('li.direct').click(direct); $this.find('li.openid').click(openid); $this.find('li.username').click(username); @@ -84,6 +100,9 @@ $.fn.openid = function() { }); $this.find('li span').hide(); $this.find('li').css('line-height', 0).css('cursor', 'pointer'); + $usrfs.hide(); + $idfs.hide(); + $localfs.hide(); $this.find('li:eq(0)').click(); return this; diff --git a/templates/content/jquery-openid/openid.css b/templates/content/jquery-openid/openid.css index 6c59192f..2ec8adf4 100644 --- a/templates/content/jquery-openid/openid.css +++ b/templates/content/jquery-openid/openid.css @@ -6,6 +6,7 @@ img {border-style:none;} .aol_box img {margin-top:6px;} .yahoo_box img {margin-top:13px;} .google_box img {margin-top:6px;} +.local_login_box img {margin-top:9px;} form.openid ul{ margin:0;padding:0;text-align:center; list-style-type:none; display:block;} form.openid ul li {float:left; padding:4px;} @@ -20,7 +21,22 @@ form.openid ul li.highlight { -moz-border-radius:4px; -webkit-border-radius:4px; form.openid fieldset div {-moz-border-radius:4px; -webkit-border-radius:4px; background: #DCDCDC; padding:10px;display:inline-block} +form.openid p {margin-bottom:4px;} form.openid fieldset div p {padding:0px;margin:0px;} +form.openid label { + display:inline-block; + font-weight:normal; + width:6em; + text-align:right; +} +#local_login_fs div { + padding-bottom:4px; +} +#local_login_buttons { + text-align:center; + line-height:1.8em; + margin-top:3px; +} /*form.openid input[type='submit'] {margin-left:1em;}*/ #openid_username {background:#ffffa0;} #openid_url {background:#ffffa0;} diff --git a/templates/content/style/style.css b/templates/content/style/style.css index 6d48198b..0fb96c7f 100644 --- a/templates/content/style/style.css +++ b/templates/content/style/style.css @@ -1093,7 +1093,9 @@ ul.bulleta li {background:url(/content/images/bullet_green.gif) no-repeat 0px 2p color:#d64000; font-weight:bold; } - +.grey { + color:#808080; +} .about div { padding:10px 5px 10px 5px; border-top:1px dashed #aaaaaa; diff --git a/templates/footer.html b/templates/footer.html index 9e877b42..7eb0205e 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -3,7 +3,7 @@ {% load i18n %} <!-- 页面底部开始: --> <div id="ground"> - <div class="footerLinks" > + <div class="footerLinks" > <a href="{% url about %}">{% trans "about" %}</a><span class="link-separator"> |</span> <a href="{% url faq %}">{% trans "faq" %}</a><span class="link-separator"> |</span> <a href="{{ blog_url }}">{% trans "blog" %}</a><span class="link-separator"> |</span> diff --git a/templates/question.html b/templates/question.html index 7f1ab3a5..c9446076 100644 --- a/templates/question.html +++ b/templates/question.html @@ -9,7 +9,7 @@ <meta name="description" content="{{question.summary}}" /> <meta name="keywords" content="{{question.tagname_meta_generator}}" /> <link rel="canonical" href="{{settings.APP_URL}}{{question.get_absolute_url}}"/> - {% if not question.closed and request.user.is_authenticated %} + {% if not question.closed %} <script type='text/javascript' src='/content/js/com.cnprog.editor.js'></script> <script type='text/javascript' src='/content/js/wmd/showdown.js'></script> <script type='text/javascript' src='/content/js/wmd/wmd.js'></script> @@ -259,7 +259,7 @@ <div class="question-status" style="margin-bottom:15px"> <h3>{% trans "The question has been closed for the following reason" %} "{{ question.get_close_reason_display }}" {% trans "by"%} <a href="{{ question.closed_by.get_profile_url }}">{{ question.closed_by.username }}</a> - {% blocktrans %}close date {% endblocktrans %}{{question.closed_at|date:"d-m-Y H:i"}}</h3> + {% blocktrans %}close date {% endblocktrans %} {{question.closed_at|date:"d-m-Y H:i"}}</h3> </div> {% endif %} |