Commits

Panayiotis Lipiridis committed 1d6d0de

Changed the line statement prefix for Jinja2 to # for better readability

Comments (0)

Files changed (19)

 
 app = flask.Flask(__name__)
 app.config.from_object(config)
+app.jinja_env.line_statement_prefix = '#'
 
 from google.appengine.api import mail
 

main/templates/admin/config_update.html

-{% extends 'base.html' %}
+# extends 'base.html'
 
-{% block content %}
+# block content
   <div class="page-header">
     <h1>
       {{title}}
         <fieldset>
           {{form.csrf}}
 
-          {% set form_field = form.brand_name %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.brand_name
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.feedback_email %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.feedback_email
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.analytics_id %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.analytics_id
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.facebook_app_id %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.facebook_app_id
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.facebook_app_secret %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.facebook_app_secret
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.twitter_consumer_key %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.twitter_consumer_key
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.twitter_consumer_secret %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.twitter_consumer_secret
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.pubnub_publish %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.pubnub_publish
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.pubnub_subscribe %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.pubnub_subscribe
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.pubnub_secret %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.pubnub_secret
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.flask_secret_key %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.flask_secret_key
+          # include 'bit/form_text_field.html'
 
           <button type="submit" class="btn btn-primary btn-block btn-loading" data-loading-text="Updating Config..">
             Update Config
       </form>
     </div>
   </div>
-{% endblock %}
+# endblock

main/templates/base.html

   <head>
     <meta charset="utf-8">
     <title>
-      {% block title %}
-        {% if title %}
+      # block title
+        # if title
           {{title}} |
-        {% endif %}
-      {% endblock %}
+        # endif
+      # endblock
       {{config.CONFIG_DB.brand_name}}
     </title>
-    {% include 'bit/style.html' %}
-    {% block head %}{% endblock %}
-    {% include 'bit/analytics.html' %}
+    # include 'bit/style.html'
+    # block head
+    # endblock
+    # include 'bit/analytics.html'
   </head>
 
   <body>
-    {% include 'bit/top_bar.html' %}
+    # include 'bit/top_bar.html'
     <div class="container">
-      {% include 'bit/notifications.html' %}
-      {% block content %}{% endblock %}
+      # include 'bit/notifications.html'
+      # block content
+      # endblock
     </div>
-    {% include 'bit/footer.html' %}
-    {% include 'bit/script.html' %}
-    {% block scripts %}{% endblock %}
+    # include 'bit/footer.html'
+    # include 'bit/script.html'
+    # block scripts
+    # endblock
   </body>
 </html>

main/templates/bit/analytics.html

-{% if not current_user.admin and config.CONFIG_DB.analytics_id %}
+# if not current_user.admin and config.CONFIG_DB.analytics_id
   <script type="text/javascript">
     var _gaq = _gaq || [];
     _gaq.push(['_setAccount', '{{config.CONFIG_DB.analytics_id}}']);
       var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
     })();
   </script>
-{% endif %}
+# endif

main/templates/bit/form_select_field.html

   {{form_field.label(class='control-label')}}
   <div class="controls">
     {{form_field(class='span4')}}
-    {% for error in form_field.errors %}
+    # for error in form_field.errors
       <span class="help-block">{{error}}</span>
-    {% endfor %}
-    {% if form_field.description %}
+    # endfor
+    # if form_field.description
       <span class="help-block">{{form_field.description}}</span>
-    {% endif %}
+    # endif
   </div>
 </div>

main/templates/bit/form_text_field.html

   {{form_field.label(class='control-label')}}
   <div class="controls">
     {{form_field(class='span4')}}
-    {% for error in form_field.errors %}
+    # for error in form_field.errors
       <span class="help-block">{{error}}</span>
-    {% endfor %}
-    {% if form_field.description %}
+    # endfor
+    # if form_field.description
       <span class="help-block">{{form_field.description}}</span>
-    {% endif %}
+    # endif
   </div>
 </div>

main/templates/bit/form_textarea_field.html

   {{form_field.label(class='control-label')}}
   <div class="controls">
     {{form_field(class='span4', rows=8)}}
-    {% for error in form_field.errors %}
+    # for error in form_field.errors
       <span class="help-block">{{error}}</span>
-    {% endfor %}
-    {% if form_field.description %}
+    # endfor
+    # if form_field.description
       <span class="help-block">{{form_field.description}}</span>
-    {% endif %}
+    # endif
   </div>
 </div>

main/templates/bit/notifications.html

-{% with messages = get_flashed_messages(with_categories=True) %}
-  {% for message in messages %}
+# with messages = get_flashed_messages(with_categories=True)
+  # for message in messages
     <div class="alert alert-{{message[0]}}">
       {{message[1]}}
       <a class="close" data-dismiss="alert" href="#">&times;</a>
     </div>
-  {% endfor %}
-{% endwith %}
+  # endfor
+# endwith

main/templates/bit/script.html

   window.PUBNUB_SUBSCRIBE = {{config.CONFIG_DB.pubnub_subscribe|tojson|safe}};
 </script>
 
-{% if config.DEVELOPMENT %}
-  {% for module in config.SCRIPTS_MODULES %}
-    {% for script in config.SCRIPTS[module] %}
+# if config.DEVELOPMENT
+  # for module in config.SCRIPTS_MODULES
+    # for script in config.SCRIPTS[module]
       <script type='text/javascript' src="/p/{{script|replace('.coffee', '.js')|replace('src/coffee', 'dst/js')}}?{{config.CURRENT_VERSION_ID}}"></script>
-    {% endfor %}
-  {% endfor %}
-{% else %}
-  {% for module in config.SCRIPTS_MODULES %}
+    # endfor
+  # endfor
+# else
+  # for module in config.SCRIPTS_MODULES
     <script type='text/javascript' src="/p/min/js/{{module}}.min.js?{{config.CURRENT_VERSION_ID}}"></script>
-  {% endfor %}
-{% endif %}
+  # endfor
+# endif

main/templates/bit/style.html

-{% if config.DEVELOPMENT %}
-  {% for style in config.STYLES %}
+# if config.DEVELOPMENT
+  # for style in config.STYLES
     <link rel="stylesheet" type="text/css" href="/p/{{style|replace('.less', '.css')|replace('src/less', 'dst/css')}}?{{config.CURRENT_VERSION_ID}}">
-  {% endfor %}
-{% else %}
-  {% for style in config.STYLES %}
+  # endfor
+# else
+  # for style in config.STYLES
     <link rel="stylesheet" type="text/css" href="/p/{{style|replace('.less', '.min.css')|replace('src/less', 'min/css')}}?{{config.CURRENT_VERSION_ID}}">
-  {% endfor %}
-{% endif %}
+  # endfor
+# endif

main/templates/bit/top_bar.html

         </li>
       </ul>
       <ul class="nav pull-right">
-        {% if current_user.id > 0 %}
-          {% if current_user.admin %}
-            <li class="{% if html_class == 'admin-config' %} active {% endif %}">
-              <a href="{{url_for('admin_config_update')}}">Config</a>
-            </li>
-          {% endif %}
+        # if current_user.admin
+          <li class="{% if html_class == 'admin-config' %} active {% endif %}">
+            <a href="{{url_for('admin_config_update')}}">Config</a>
+          </li>
+        # endif
+        # if current_user.id > 0
           <li class="{% if html_class == 'profile' %} active {% endif %}">
             <a href="{{url_for('profile')}}">{{current_user.name}}</a>
           </li>
           <li>
             <a href="{{url_for('signout')}}">Sign out</a>
           </li>
-        {% else %}
+        # else
           <li>
             <a href="{{url_for('signin')}}">Sign in</a>
           </li>
-        {% endif %}
+        # endif
       </ul>
     </div>
   </div>

main/templates/chat.html

-{% extends 'base.html' %}
+# extends 'base.html'
 
-{% block content %}
+# block content
   <div class="page-header">
     <h1>
       {{title}}
       </div>
     </div>
   </div>
-{% endblock %}
+# endblock

main/templates/error.html

-{% extends 'base.html' %}
+# extends 'base.html'
 
-{% block content %}
+# block content
   <div class="hero-unit">
     <h2>
       <small>{{error.code}}</small>
         >
     </div>
   </div>
-{% endblock %}
+# endblock

main/templates/extras.html

-{% extends 'base.html' %}
+# extends 'base.html'
 
-{% block content %}
+# block content
   <div class="page-header">
     <h1>
       {{title}}
     <div class="span6">
       <table class="table table-bordered">
         <tbody>
-          {% for extra in extra_info %}
+          # for extra in extra_info
             <tr>
               <th class="span2">{{extra.replace('_', ' ').title()}}</th>
               <td>{{extra_info[extra] or '-'}}</td>
             </tr>
-          {% endfor %}
+          # endfor
         </tbody>
       </table>
     </div>
     <div class="span6">
-      {% set map_lat_long = '55.693403,12.583046' %}
-      {% if extra_info['city_lat_long'] %}
-        {% set map_lat_long = extra_info['city_lat_long'] %}
-      {% endif %}
+      # set map_lat_long = '55.693403,12.583046'
+      # if extra_info['city_lat_long']
+        # set map_lat_long = extra_info['city_lat_long']
+      # endif
       <div class="thumbnail">
         <a href="http://maps.google.com/maps?q={{map_lat_long}}" target="_blank">
           <img src="https://maps.googleapis.com/maps/api/staticmap?center={{map_lat_long}}&amp;zoom=12&amp;size=460x328&amp;sensor=false"
       </div>
     </div>
   </div>
-{% endblock %}
+# endblock

main/templates/feedback.html

-{% extends 'base.html' %}
+# extends 'base.html'
 
-{% block content %}
+# block content
   <div class="page-header">
     <h1>
       {{title}}
         <fieldset>
           {{form.csrf}}
 
-          {% set form_field = form.subject %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.subject
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.message %}
-          {% include 'bit/form_textarea_field.html' %}
+          # set form_field = form.message
+          # include 'bit/form_textarea_field.html'
 
-          {% set form_field = form.email %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.email
+          # include 'bit/form_text_field.html'
 
           <button type="submit" class="btn btn-primary btn-block btn-loading" data-loading-text="Sending Feedback..">
             Send Feedback
       </form>
     </div>
   </div>
-{% endblock %}
+# endblock

main/templates/profile.html

-{% extends 'base.html' %}
+# extends 'base.html'
 
-{% block content %}
+# block content
   <div class="page-header">
     <h1>
       {{user_db.name}}
         <fieldset>
           {{form.csrf}}
 
-          {% set form_field = form.name %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.name
+          # include 'bit/form_text_field.html'
 
-          {% set form_field = form.email %}
-          {% include 'bit/form_text_field.html' %}
+          # set form_field = form.email
+          # include 'bit/form_text_field.html'
 
           <button type="submit" class="btn btn-primary btn-block btn-loading" data-loading-text="Updating Profile..">
             Update Profile
       </form>
     </div>
   </div>
-{% endblock %}
+# endblock

main/templates/signin.html

-{% extends 'base.html' %}
+# extends 'base.html'
 
-{% block content %}
+# block content
   <div class="page-header">
     <h1>
       {{title}}
       </div>
     </div>
 
-    {% if config.CONFIG_DB.facebook_app_id and config.CONFIG_DB.facebook_app_secret %}
+    # if config.CONFIG_DB.facebook_app_id and config.CONFIG_DB.facebook_app_secret
       <div class="span4">
         <div class="well">
           <a class="btn btn-block" href="{{facebook_signin_url}}">
           </a>
         </div>
       </div>
-    {% endif %}
+    # endif
 
-    {% if config.CONFIG_DB.twitter_consumer_key and config.CONFIG_DB.twitter_consumer_secret %}
+    # if config.CONFIG_DB.twitter_consumer_key and config.CONFIG_DB.twitter_consumer_secret
       <div class="span4">
         <div class="well">
           <a class="btn btn-block" href="{{twitter_signin_url}}">
           </a>
         </div>
       </div>
-    {% endif %}
+    # endif
   </div>
-{% endblock %}
+# endblock

main/templates/user_list.html

-{% extends 'base.html' %}
+# extends 'base.html'
 
-{% block content %}
+# block content
   <div class="page-header">
     <h1>
       {{title}}
           </tr>
         </thead>
         <tbody>
-          {% for user_db in user_dbs %}
+          # for user_db in user_dbs
             <tr>
               <td>{{user_db.key.id()}}</td>
               <td>
                 </abbr>
               </td>
             </tr>
-          {% endfor %}
+          # endfor
         </tbody>
       </table>
     </div>
   </div>
-  {% if more_url %}
+  # if more_url
     <div class="row">
       <div class="span12">
         <ul class="pager">
         </ul>
       </div>
     </div>
-  {% endif %}
-{% endblock %}
+  # endif
+# endblock

main/templates/welcome.html

-{% extends 'base.html' %}
+# extends 'base.html'
 
-{% block content %}
+# block content
   <div class="hero-unit">
     <h1>
       <img src="/p/img/brand_logo.png" alt="{{config.CONFIG_DB.brand_name}} Logo">
     </h1>
     <p class="lead">
-      Hello world!
+      Hello, world!
     </p>
   </div>
 
       <p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
     </div>
   </div>
-{% endblock %}
+# endblock