Commits

Anonymous committed b5d52d1

Update URLs in layout template

  • Participants
  • Parent commits 48ae7e9
  • Branches lodgeit

Comments (0)

Files changed (2)

File lodgeit/urls.py

 
     # language
     Rule('/language/<lang>/', endpoint='pastes/set_language'),
+
+    # static
+    Rule('/static/<file>', endpoint='static', build_only=True),
 ])

File lodgeit/views/layout.html

 <html>
   <head>
     <title>{{ page_title|e }} | LodgeIt!</title>
-    <link rel="stylesheet" href="/static/style.css" type="text/css">
-    <link rel="stylesheet" href="/static/print.css" type="text/css" media="print">
-    <script type="text/javascript" src="/static/jquery.js"></script>
-    <script type="text/javascript" src="/static/jquery.autocomplete.js"></script>
-    <script type="text/javascript" src="/static/cookie.js"></script>
-    <script type="text/javascript" src="/static/lodgeit.js"></script>
+    <link rel="stylesheet" href="{{ url ('static', file='style.css') }}" type="text/css">
+    <link rel="stylesheet" href="{{ url('static', file='print.css') }}" type="text/css" media="print">
+    <script type="text/javascript" src="{{ url ('static', file='jquery.js') }}"></script>
+    <script type="text/javascript" src="{{ url ('static', file='jquery.autocomplete.js') }}"></script>
+    <script type="text/javascript" src="{{ url ('static', file='cookie.js') }}"></script>
+    <script type="text/javascript" src="{{ url ('static', file='lodgeit.js') }}"></script>
     {%- if css %}
     <style type="text/css">
       {{ css|e }}
       <div id="header"><h1>Lodge It</h1></div>
       <ul id="navigation">
       {%- for href, id, caption in [
-        ('/', 'new', _('New')),
-        ('/all/', 'all', _('All')),
-        ('/about/', 'about', _('About')),
-        ('/help/', 'help', '?')
+        (url('pastes/new_paste'), 'new', _('New')),
+        (url('pastes/show_all'), 'all', _('All')),
+        (url('static/about'), 'about', _('About')),
+        (url('static/help'), 'help', '?')
       ] %}
         <li{% if active_page == id %} class="active"{% endif %}>
           <a href="{{ href|e }}">{{ caption|e }}</a>