diff options
author | Theo Chatzimichos <tampakrap@gmail.com> | 2013-09-10 04:28:14 -0700 |
---|---|---|
committer | Theo Chatzimichos <tampakrap@gmail.com> | 2013-09-10 04:28:14 -0700 |
commit | 05c180724211bafde30b14c64717a846998ebd6c (patch) | |
tree | af642b9de7c143a0fbaedcce8844f9b179522326 | |
parent | Merge pull request #87 from tampakrap/bin (diff) | |
parent | Fix the tests about rendered result, they were not properly concatenating str... (diff) | |
download | identity.gentoo.org-05c180724211bafde30b14c64717a846998ebd6c.tar.gz identity.gentoo.org-05c180724211bafde30b14c64717a846998ebd6c.tar.bz2 identity.gentoo.org-05c180724211bafde30b14c64717a846998ebd6c.zip |
Merge pull request #88 from tampakrap/templates
Identation, whitespace and other cosmetics fixes in templates
-rw-r--r-- | okupy/templates/base.html | 37 | ||||
-rw-r--r-- | okupy/templates/foundation-members.html | 20 | ||||
-rw-r--r-- | okupy/templates/index.html | 2 | ||||
-rw-r--r-- | okupy/templates/settings-contact.html | 5 | ||||
-rw-r--r-- | okupy/templates/settings-email.html | 56 | ||||
-rw-r--r-- | okupy/templates/settings-gentoo.html | 5 | ||||
-rw-r--r-- | okupy/templates/settings-password.html | 2 | ||||
-rw-r--r-- | okupy/templates/settings-profile.html | 4 | ||||
-rw-r--r-- | okupy/tests/unit/test_lists.py | 18 | ||||
-rw-r--r-- | okupy/tests/unit/test_signup.py | 4 |
10 files changed, 75 insertions, 78 deletions
diff --git a/okupy/templates/base.html b/okupy/templates/base.html index d8f1b1e..e320317 100644 --- a/okupy/templates/base.html +++ b/okupy/templates/base.html @@ -59,23 +59,23 @@ <li><a href="http://sources.gentoo.org/" title="Browse our source code">Sources</a></li> </ul> </li> - {% if user.is_authenticated %} - <li class="divider-vertical"></li> - <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ user.username }}<b class="caret"></b></a> - <ul class="dropdown-menu"> - <li><a href="{% url 'index' %}" title="View Profile">View Profile</a></li> - <li><a href="{% url 'profile-settings' %}" title="Edit Profile">Edit Profile</a></li> - <li><a href="{% url 'contact-settings' %}" title="Contact Settings">Contact Settings</a></li> - <li><a href="{% url 'password-settings' %}" title="Change Password">Change Password</a></li> - <li><a href="{% url 'email-settings' %}" title="Email Settings">Email Settings</a></li> - <li><a href="{% url 'gentoo-dev-settings' %}" title="Gentoo Account Settings">Gentoo Account Settings</a></li> - <li><a href="#" title="Invite others">Invite</a></li> - <li><a href="{% url 'logout' %}" title="Logout">Logout</a></li> - </ul> - </li> - {% endif %} - </ul> + {% if user.is_authenticated %} + <li class="divider-vertical"></li> + <li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ user.username }}<b class="caret"></b></a> + <ul class="dropdown-menu"> + <li><a href="{% url 'index' %}" title="View Profile">View Profile</a></li> + <li><a href="{% url 'profile-settings' %}" title="Edit Profile">Edit Profile</a></li> + <li><a href="{% url 'contact-settings' %}" title="Contact Settings">Contact Settings</a></li> + <li><a href="{% url 'password-settings' %}" title="Change Password">Change Password</a></li> + <li><a href="{% url 'email-settings' %}" title="Email Settings">Email Settings</a></li> + <li><a href="{% url 'gentoo-dev-settings' %}" title="Gentoo Account Settings">Gentoo Account Settings</a></li> + <li><a href="#" title="Invite others">Invite</a></li> + <li><a href="{% url 'logout' %}" title="Logout">Logout</a></li> + </ul> + </li> + {% endif %} + </ul> </div> </div> </div> @@ -105,8 +105,7 @@ </div> </div> </div> - </div> -</footer> + </footer> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> {% compress js %} <!--[if lt IE 9]> diff --git a/okupy/templates/foundation-members.html b/okupy/templates/foundation-members.html index b78beb7..f2fcd3b 100644 --- a/okupy/templates/foundation-members.html +++ b/okupy/templates/foundation-members.html @@ -9,18 +9,18 @@ <div class="span10"> <h2>Foundation Members</h2><br /> <table class="table table-striped sortable" > - <tr> - <td class="infohead"><b>Username</b></td> - <td class="infohead"><b>Name</b></td> - <td class="infohead"><b>Location</b></td> - </tr> - {% for user in devlist %} <tr> - <td style="color:#5c4f85;"><b>{{ user.username }}</b></td> - <td>{{ user.full_name }}</td> - <td><a href="http://maps.google.com/maps?q={{ user.location }}">{{ user.location }}</a></td> + <td class="infohead"><b>Username</b></td> + <td class="infohead"><b>Name</b></td> + <td class="infohead"><b>Location</b></td> </tr> - {% endfor %} + {% for user in devlist %} + <tr> + <td style="color:#5c4f85;"><b>{{ user.username }}</b></td> + <td>{{ user.full_name }}</td> + <td><a href="http://maps.google.com/maps?q={{ user.location }}">{{ user.location }}</a></td> + </tr> + {% endfor %} </table> </div> </div> diff --git a/okupy/templates/index.html b/okupy/templates/index.html index 503841f..5c3e2de 100644 --- a/okupy/templates/index.html +++ b/okupy/templates/index.html @@ -14,8 +14,8 @@ <tr class="even"><th>Nickname</th><td>{{user.username}}</td></tr> <tr class="odd"><th>Location</th><td>{{user.location}}</td></tr> </table> - </p> </div> + </p> </div> <div class="row-fluid"> <p> diff --git a/okupy/templates/settings-contact.html b/okupy/templates/settings-contact.html index 6912b1e..05d21ba 100644 --- a/okupy/templates/settings-contact.html +++ b/okupy/templates/settings-contact.html @@ -17,7 +17,7 @@ </div> <div class="row-fluid"> {{ contact_settings.im.label_tag }} - <input name="im" type="text" value="{{ user_info.im.0 }}" /> {{ contact_settings.im.errors|striptags }} + <input name="im" type="text" value="{{ user_info.im.0 }}" /> {{ contact_settings.im.errors|striptags }} </div> <div class="row-fluid"> {{ contact_settings.location.label_tag }} @@ -38,7 +38,6 @@ <div class="row-fluid"> {{ contact_settings.gpg_fingerprint.label_tag }} <input name="gpg_fingerprint" type="text" value="{{ user_info.gpg_fingerprint.0 }}" /> {{ contact_settings.gpg_fingerprint.errors|striptags }} - </div> <div class="row-fluid buttons"> <input class="btn btn-primary" type="submit" value="Save" /> @@ -47,6 +46,8 @@ </div> </div> </div> + </div> +</div> {% endblock %} {# vim:se fileencoding=utf8 et ts=4 sts=4 sw=4 ft=htmldjango : #} diff --git a/okupy/templates/settings-email.html b/okupy/templates/settings-email.html index e6a082c..51a5eba 100644 --- a/okupy/templates/settings-email.html +++ b/okupy/templates/settings-email.html @@ -6,40 +6,42 @@ <div id="page" class="span10"> <div> <h1>Email Settings</h1> - <h3>Manage your emails.</h3> + <h3>Manage your emails.</h3> <div class="form well"> - {{ email_settings.errors }} + {{ email_settings.errors }} {{ email_settings.non_field_errors }} <div class="row-fluid "> - <table class="table"> - <thead> - <tr> - <th>Email</th> - <th> </th> - </tr> - </thead> - <tbody> - {% for mail in user_info.email%} - <form action="." method="POST">{% csrf_token %} - <tr> - <td><input type="hidden" name="email" value="{{ mail }}" />{{mail}}</td> - <td><input class="btn" type="submit" name="delete" value="Delete" /></td> - </tr> - </form> - {% endfor %} - </tbody> - </table> - <form action="." method="POST">{% csrf_token %} - {{ email_settings.email.label_tag }} + <table class="table"> + <thead> + <tr> + <th>Email</th> + <th> </th> + </tr> + </thead> + <tbody> + {% for mail in user_info.email%} + <form action="." method="POST">{% csrf_token %} + <tr> + <td><input type="hidden" name="email" value="{{ mail }}" />{{mail}}</td> + <td><input class="btn" type="submit" name="delete" value="Delete" /></td> + </tr> + </form> + {% endfor %} + </tbody> + </table> + <form action="." method="POST">{% csrf_token %} + {{ email_settings.email.label_tag }} <input name="email" type="text" /> {{ email_settings.email.errors|striptags }} - <div class="row-fluid buttons"> - <input class="btn btn-primary" type="submit" value="Add email" /> - </div> - </form> - </div> + <div class="row-fluid buttons"> + <input class="btn btn-primary" type="submit" value="Add email" /> + </div> + </form> + </div> </div> </div> </div> + </div> +</div> {% endblock %} {# vim:se fileencoding=utf8 et ts=4 sts=4 sw=4 ft=htmldjango : #} diff --git a/okupy/templates/settings-gentoo.html b/okupy/templates/settings-gentoo.html index 0ab16a6..85a2916 100644 --- a/okupy/templates/settings-gentoo.html +++ b/okupy/templates/settings-gentoo.html @@ -34,9 +34,12 @@ <input class="btn btn-primary" type="submit" value="Update" /> </div> </form> - </div>{% endif %} + </div> + {% endif %} </div> </div> + </div> +</div> {% endblock %} {# vim:se fileencoding=utf8 et ts=4 sts=4 sw=4 ft=htmldjango : #} diff --git a/okupy/templates/settings-password.html b/okupy/templates/settings-password.html index 3e427b9..574fe0f 100644 --- a/okupy/templates/settings-password.html +++ b/okupy/templates/settings-password.html @@ -30,6 +30,8 @@ </div> </div> </div> + </div> +</div> {% endblock %} {# vim:se fileencoding=utf8 et ts=4 sts=4 sw=4 ft=htmldjango : #} diff --git a/okupy/templates/settings-profile.html b/okupy/templates/settings-profile.html index 2b9726c..66a6936 100644 --- a/okupy/templates/settings-profile.html +++ b/okupy/templates/settings-profile.html @@ -23,7 +23,7 @@ {{ profile_settings.email.label_tag }} <input name="email" type="text" value="{{ user_info.email.0 }}" /> {{ profile_settings.email.errors|striptags }} </div> - <!-- <div class="row-fluid"> + <!-- <div class="row-fluid"> {{ profile_settings.birthday.label_tag }} <input name="birthday" type="text" value="{{ user_info.birthday }}" /> {{ profile_settings.birthday.errors|striptags }} </div> --> @@ -49,6 +49,8 @@ </div> </div> </div> + </div> +</div> {% endblock %} {# vim:se fileencoding=utf8 et ts=4 sts=4 sw=4 ft=htmldjango : #} diff --git a/okupy/tests/unit/test_lists.py b/okupy/tests/unit/test_lists.py index b5d7006..d34e27c 100644 --- a/okupy/tests/unit/test_lists.py +++ b/okupy/tests/unit/test_lists.py @@ -34,11 +34,7 @@ class ListsUnitTests(OkupyTestCase): def test_rendered_devlist_page(self): request = set_request(uri='/devlist') response = lists(request, 'devlist') - page_part = '<tr>\n <td class="devname"><b>alice' - '</b></td>\n <td>Alice Adams</td>\n ' - '<td><a href="http://maps.google.com/maps?q=City1, Country1">' - 'City1, Country1</a></td>\n <td class="tableinfo">' - 'kde, qt, cluster</td>\n </tr>' + page_part = '<tr>\n <td class="devname"><b>alice</b></td>\n <td>Alice Adams</td>\n <td><a href="http://maps.google.com/maps?q=City1, Country1">City1, Country1</a></td>\n <td class="tableinfo">kde, qt, cluster</td>\n </tr>' # noqa self.assertIn(page_part, response.content) def test_former_devlist_url_resolves_to_lists_view(self): @@ -53,11 +49,7 @@ class ListsUnitTests(OkupyTestCase): def test_rendered_former_devlist_page(self): request = set_request(uri='/former-devlist') response = lists(request, 'former-devlist') - page_part = '<tr>\n <td class="devname"><b>john' - '</b></td>\n <td>John Smith</td>\n ' - '<td><a href="http://maps.google.com/maps?q=City3, Country3">' - 'City3, Country3</a></td>\n <td class="tableinfo">' - 'kernel, security</td>\n </tr>' + page_part = '<tr>\n <td class="devname"><b>john</b></td>\n <td>John Smith</td>\n <td><a href="http://maps.google.com/maps?q=City3, Country3">City3, Country3</a></td>\n <td class="tableinfo">kernel, security</td>\n </tr>' # noqa self.assertIn(page_part, response.content) def test_foundation_members_list_url_resolves_to_lists_view(self): @@ -72,8 +64,6 @@ class ListsUnitTests(OkupyTestCase): def test_rendered_foundation_members_page(self): request = set_request(uri='/foundation-members') response = lists(request, 'foundation-members') - page_part = '<tr>\n <td style="color:#5c4f85;"><b>bob' - '</b></td>\n <td>Robert Barker</td>\n ' - '<td><a href="http://maps.google.com/maps?q=City2, Country2">' - 'City2, Country2</a></td>\n </tr>' + page_part = '<tr>\n <td style="color:#5c4f85;"><b>bob</b></td>\n <td>Robert Barker</td>\n <td><a href="http://maps.google.com/maps?q=City2, Country2">City2, Country2</a></td>\n </tr>' # noqa + page_part = '<tr>\n <td style="color:#5c4f85;"><b>bob</b></td>\n <td>Robert Barker</td>\n <td><a href="http://maps.google.com/maps?q=City2, Country2">City2, Country2</a></td>\n </tr>' # noqa self.assertIn(page_part, response.content) diff --git a/okupy/tests/unit/test_signup.py b/okupy/tests/unit/test_signup.py index 459e3f8..8009546 100644 --- a/okupy/tests/unit/test_signup.py +++ b/okupy/tests/unit/test_signup.py @@ -204,9 +204,7 @@ class SignupunitTestsNoLDAP(OkupyTestCase): def test_rendered_signup_form(self): request = set_request(uri='/signup') response = signup(request) - signup_form_part = '<label for="id_first_name">First Name:</label>' - '<input id="id_first_name" maxlength="100" name="first_name"' - 'type="text" />' + signup_form_part = '<label for="id_first_name">First Name:</label><input id="id_first_name" maxlength="100" name="first_name" type="text" />' # noqa self.assertIn(signup_form_part, response.content) def test_empty_signup_form_raises_form_error_messages(self): |