Permalink
Browse files

Better frontend code organization -- js at the bottom, css at the top

  • Loading branch information...
1 parent d588a2c commit bcf0fe8f8a1587a690d07a34afd026d6527aa7cf @brutasse brutasse committed Jan 21, 2013
Showing with 231 additions and 236 deletions.
  1. +5 −3 djangopeople/django_openidauth/templates/openid_associations.html
  2. +12 −11 djangopeople/django_openidconsumer/templates/openid_failure.html
  3. +12 −11 djangopeople/django_openidconsumer/templates/openid_signin.html
  4. +0 −3 djangopeople/djangopeople/templates/404.html
  5. +0 −3 djangopeople/djangopeople/templates/500.html
  6. +2 −2 djangopeople/djangopeople/templates/about.html
  7. +11 −9 djangopeople/djangopeople/templates/base.html
  8. +21 −20 djangopeople/djangopeople/templates/country.html
  9. +2 −4 djangopeople/djangopeople/templates/country_looking_for.html
  10. +0 −3 djangopeople/djangopeople/templates/country_sites.html
  11. +0 −3 djangopeople/djangopeople/templates/edit_account.html
  12. +0 −3 djangopeople/djangopeople/templates/edit_bio.html
  13. +0 −3 djangopeople/djangopeople/templates/edit_finding.html
  14. +17 −13 djangopeople/djangopeople/templates/edit_location.html
  15. +0 −3 djangopeople/djangopeople/templates/edit_password.html
  16. +13 −11 djangopeople/djangopeople/templates/edit_portfolio.html
  17. +0 −3 djangopeople/djangopeople/templates/edit_skills.html
  18. +19 −18 djangopeople/djangopeople/templates/index.html
  19. +38 −34 djangopeople/djangopeople/templates/login.html
  20. +17 −31 djangopeople/djangopeople/templates/maps.html
  21. +31 −28 djangopeople/djangopeople/templates/profile.html
  22. +2 −4 djangopeople/djangopeople/templates/recent.html
  23. +2 −1 djangopeople/djangopeople/templates/search.html
  24. +11 −7 djangopeople/djangopeople/templates/signup.html
  25. +2 −2 djangopeople/djangopeople/templates/skill.html
  26. +0 −3 djangopeople/djangopeople/templates/skills.html
  27. +12 −0 djangopeople/settings.py
  28. +2 −0 requirements.txt
@@ -1,7 +1,10 @@
{% extends "base.html" %}
+{% load sekizai_tags %}
{% block title %}{% trans "OpenID associations" %} |{% endblock %}
-{% block js %}
+{% block content %}
+
+{% addtoblock "css" %}
<style type="text/css">
div#openidadmin ul {
padding-left: 2em;
@@ -13,9 +16,8 @@
color: red;
}
</style>
-{% endblock %}
+{% endaddtoblock %}
-{% block content %}
<h2>{% trans "OpenID associations" %}</h2>
{% if messages %}
@@ -1,25 +1,26 @@
{% extends "base.html" %}
+{% load sekizai_tags %}
{% block title %}{% trans "Open ID failed, Sign in with your OpenID" %} |{% endblock %}
{% block nav_li_class_login %} class="current"{% endblock %}>
-{% block js %}
-<style type="text/css">
-input.openid {
- background: url({{ logo }}) no-repeat;
- background-position: 0 50%;
- padding-left: 16px;
-}
-</style>
-
-{% endblock %}
-
{% block header%}
<h1>{% trans "Sign in with your OpenID" %}</h1>
{% endblock %}
{% block content %}
+
+{% addtoblock "css" %}
+ <style type="text/css">
+ input.openid {
+ background: url({{ logo }}) no-repeat;
+ background-position: 0 50%;
+ padding-left: 16px;
+ }
+ </style>
+{% endaddtoblock %}
+
<div class="highlight"><p><strong>{% trans "OpenID failed" %}</strong>, {{ message|escape }}</p></div>
<form method="post" action="{{ action }}">{% csrf_token %}
@@ -1,25 +1,26 @@
{% extends "base.html" %}
+{% load sekizai_tags %}
{% block title %}{% trans "Sign in with your OpenID" %} |{% endblock %}
{% block nav_li_class_login %} class="current"{% endblock %}
-{% block js %}
-<style type="text/css">
-input.openid {
- background: url({{ logo }}) no-repeat;
- background-position: 0 50%;
- padding-left: 16px;
-}
-</style>
-
-{% endblock %}
-
{% block header%}
<h1>{% trans "Sign in with your OpenID" %}</h1>
{% endblock %}
{% block content %}
+
+{% addtoblock "css" %}
+<style type="text/css">
+ input.openid {
+ background: url({{ logo }}) no-repeat;
+ background-position: 0 50%;
+ padding-left: 16px;
+ }
+</style>
+{% endaddtoblock %}
+
<form method="post" action="{{ action }}">{% csrf_token %}
<div class="fieldWrapper">
<label for="id_openid">{% trans "OpenID" %}</label>
@@ -2,9 +2,6 @@
{% block title %}{% trans "404 error" %} |{% endblock %}
-{% block js %}
-{% endblock %}
-
{% block header%}
<h1>{% trans "404 error" %}</h1>
{% endblock %}
@@ -2,9 +2,6 @@
{% block title %}{% trans "500 error" %} |{% endblock %}
-{% block js %}
-{% endblock %}
-
{% block header%}
<h1>{% trans "500 error" %}</h1>
{% endblock %}
@@ -1,5 +1,5 @@
{% extends "base.html" %}
-{% load staticfiles %}
+{% load staticfiles humanize %}
{% block title %}{% trans "About" %} |{% endblock %}
@@ -9,7 +9,7 @@
<h1>{% trans "About Django People" %}</h1>
{% endblock %}
-{% block content %}{% load humanize %}
+{% block content %}
<div class="about">
<p>{% blocktrans with count=total_people countries=countries|length|apnumber %}Django People lists {{ count }} <a href="https://www.djangoproject.com/">Django</a> developers from around the world, in {{ countries }} different countries. The aim of the site is to help Django developers find like-minded souls near them, and hopefully kick-start some local meet-ups and user groups.{% endblocktrans %}</p>
@@ -1,4 +1,4 @@
-{% load static staticfiles %}
+{% load static staticfiles sekizai_tags %}
<!DOCTYPE html>
{# Not all our third-party app views use RequestContext #}
{% get_static_prefix as STATIC_URL %}
@@ -8,14 +8,8 @@
<title>{% block title %}{% endblock %} Django People</title>
<link rel="shortcut icon" href="{% static "djangopeople/img/favicon.ico" %}">
<link rel="stylesheet" href="{% static "djangopeople/css/styles.css" %}" type="text/css" media="all" charset="utf-8">
- <script type="text/javascript" src="{% static "djangopeople/js/jquery-1.5.2.min.js" %}"></script>
- <script type="text/javascript">
- var STATIC_URL = '{{ STATIC_URL }}';
- </script>
- <script type="text/javascript" src="{% static "djangopeople/js/common.js" %}"></script>
- {% block maps_api %}{% endblock %}
- {% block js %}{% endblock %}
- {% block extrahead %}{% endblock %}
+ {% render_block "css" %}
+ {% block adder %}{% endblock %}
</head>
<body{% block bodymeta %}{% endblock %}>
<div class="wrapper">
@@ -60,5 +54,13 @@
<div class="footer">
<p>{% blocktrans %}Hosted on <span class="heroku">Heroku</span>{% endblocktrans %}</p>
</div>
+
+<script type="text/javascript" src="{% static "djangopeople/js/jquery-1.5.2.min.js" %}"></script>
+<script type="text/javascript">
+ var STATIC_URL = '{{ STATIC_URL }}';
+</script>
+<script type="text/javascript" src="{% static "djangopeople/js/common.js" %}"></script>
+
+{% render_block "js" %}
</body>
</html>
@@ -1,29 +1,30 @@
{% extends "maps.html" %}
-{% load staticfiles %}
+{% load staticfiles person_list_items sekizai_tags %}
{% block title %}{{ country }} |{% endblock %}
-{% block maps_code %}
+{% block header %}
+
+{% addtoblock "js" %}
<script type="text/javascript">
-window.onload = function() {
- var swBound = new google.maps.LatLng({{ country.bbox_south }}, {{ country.bbox_west }});
- var neBound = new google.maps.LatLng({{ country.bbox_north }}, {{ country.bbox_east }});
- var boundBox = new google.maps.LatLngBounds(swBound, neBound);
- var gmap = new google.maps.Map(document.getElementById('gmap'), {
- zoom: 9,
- center: boundBox.getCenter(),
- mapTypeId: google.maps.MapTypeId.ROADMAP,
- scrollwheel: false
- });
- gmap.fitBounds(boundBox);
+ $(function() {
+ var swBound = new google.maps.LatLng({{ country.bbox_south }}, {{ country.bbox_west }});
+ var neBound = new google.maps.LatLng({{ country.bbox_north }}, {{ country.bbox_east }});
+ var boundBox = new google.maps.LatLngBounds(swBound, neBound);
+ var gmap = new google.maps.Map(document.getElementById('gmap'), {
+ zoom: 9,
+ center: boundBox.getCenter(),
+ mapTypeId: google.maps.MapTypeId.ROADMAP,
+ scrollwheel: false
+ });
+ gmap.fitBounds(boundBox);
- // Plot the people as markers
- plotPeopleOnMap(people, gmap);
-};
+ // Plot the people as markers
+ plotPeopleOnMap(people, gmap);
+ });
</script>
-{% endblock %}
+{% endaddtoblock %}
-{% block header %}
{% if country.iso_code or country.flag %}<img src="{% static country.flag_url %}" alt="{{ country }}" class="main">{% endif %}
<h1>{{ country }}</h1>
<p class="meta">
@@ -77,9 +78,9 @@ <h2>{% blocktrans %}Django community sites in {{ country }}{% endblocktrans %}</
{% endif %}
<ul class="detailsList split">
{% if is_paginated %}
- {% load person_list_items %}{% person_list_items page_obj.object_list %}
+ {% person_list_items page_obj.object_list %}
{% else %}
- {% load person_list_items %}{% person_list_items people_list %}
+ {% person_list_items people_list %}
{% endif %}
</ul>
{% if regions %}
@@ -1,10 +1,8 @@
{% extends "base.html" %}
+{% load person_list_items %}
{% block title %}{% blocktrans %}People in {{ country }} looking for {{ looking_for }}{% endblocktrans %} |{% endblock %}
-{% block js %}
-{% endblock %}
-
{% block header %}
<h1>{% blocktrans %}{{ country }}, seeking {{ looking_for }} work{% endblocktrans %}</h1>
{% endblock %}
@@ -14,6 +12,6 @@ <h1>{% blocktrans %}{{ country }}, seeking {{ looking_for }} work{% endblocktran
{% block content %}
<ul class="detailsList split">
- {% load person_list_items %}{% person_list_items people %}
+ {% person_list_items people %}
</ul>
{% endblock %}
@@ -3,9 +3,6 @@
{% block title %}{% blocktrans %}Sites in {{ country }}{% endblocktrans %} |{% endblock %}
-{% block js %}
-{% endblock %}
-
{% block header %}
<h1>{% blocktrans %}Sites in {{ country }}{% endblocktrans %}</h1>
<p class="meta"><img src="{% static country.flag_url %}" title="{{ country }}" class="flag"></a> {{ country }}</p>
@@ -4,9 +4,6 @@
{% block nav_li_class_account %} class="current"{% endblock %}
-{% block js %}
-{% endblock %}
-
{% block header%}
<h1>{% trans "Account settings" %}</h1>
{% endblock %}
@@ -2,9 +2,6 @@
{% block title %}{% trans "Edit your bio" %} |{% endblock %}
-{% block js %}
-{% endblock %}
-
{% block header%}
<h1>{% trans "Edit your bio" %}</h1>
{% endblock %}
@@ -2,9 +2,6 @@
{% block title %}{% trans "Edit contact information" %} |{% endblock %}
-{% block js %}
-{% endblock %}
-
{% block header%}
<h1>{% trans "Edit contact information" %}</h1>
{% endblock %}
@@ -1,24 +1,28 @@
{% extends "maps.html" %}
-{% load staticfiles %}
+{% load staticfiles sekizai_tags %}
{% block title %}{% trans "Change your location" %} |{% endblock %}
-{% block js %}
-<script type="text/javascript" src="{% static "djangopeople/js/jquery.color.js" %}"></script>
-<script type="text/javascript" src="{% static "djangopeople/js/signup.js" %}"></script>
-<link rel="stylesheet" href="{% static "djangopeople/css/flags.css" %}" type="text/css">
-<style type="text/css">
-#id_location_description {
- width: 24em;
-}
-</style>
-{% endblock %}
-
{% block header%}
<h1>{% trans "Change your location" %}</h1>
{% endblock %}
{% block content %}
+
+{% addtoblock "js" %}
+ <script type="text/javascript" src="{% static "djangopeople/js/jquery.color.js" %}"></script>
+ <script type="text/javascript" src="{% static "djangopeople/js/signup.js" %}"></script>
+{% endaddtoblock %}
+
+{% addtoblock "css" %}
+ <link rel="stylesheet" href="{% static "djangopeople/css/flags.css" %}" type="text/css">
+ <style type="text/css">
+ #id_location_description {
+ width: 24em;
+ }
+ </style>
+{% endaddtoblock %}
+
{% endblock %}
{% block extra %}
<div class="content">
@@ -30,7 +34,7 @@ <h1>{% trans "Change your location" %}</h1>
</div>
<div class="content">
- <form method="post" action="{% url 'edit_location' user.username %}">
+ <form method="post" action="{% url "edit_location" user.username %}">
{% csrf_token %}
<fieldset>
<div class="fieldWrapper" id="location">
@@ -4,9 +4,6 @@
{% block nav_li_class_account %} class="current"{% endblock %}
-{% block js %}
-{% endblock %}
-
{% block header%}
<h1>{% trans "Change your password" %}</h1>
{% endblock %}
@@ -1,23 +1,25 @@
{% extends "edit_account.html" %}
+{% load sekizai_tags %}
{% block title %}{% trans "Update your portfolio" %} |{% endblock %}
-{% block js %}
-<style type="text/css">
-.fieldWrapper label {
- width: 5em;
-}
-.fieldWrapper input {
- width: 20em;
-}
-</style>
-{% endblock %}
-
{% block header%}
<h1>{% trans "Update your portfolio" %}</h1>
{% endblock %}
{% block content %}
+
+{% addtoblock "css" %}
+<style type="text/css">
+ .fieldWrapper label {
+ width: 5em;
+ }
+ .fieldWrapper input {
+ width: 20em;
+ }
+</style>
+{% endaddtoblock %}
+
<p class="help">{% trans "Show off the sites and projects you've personally built (or contributed to) using Django." %}</p>
<form method="post" action="{% url "edit_portfolio" user.username %}">
{% include "includes/form.html" %}
@@ -2,9 +2,6 @@
{% block title %}{% trans "Update your skills" %} |{% endblock %}
-{% block js %}
-{% endblock %}
-
{% block header%}
<h1>{% trans "Update your skills" %}</h1>
{% endblock %}
Oops, something went wrong.

0 comments on commit bcf0fe8

Please sign in to comment.