]> err.no Git - peojumk/commitdiff
Move invoice template into its own included template
authorTollef Fog Heen <tfheen@err.no>
Sun, 10 Jun 2012 18:21:53 +0000 (20:21 +0200)
committerTollef Fog Heen <tfheen@err.no>
Sun, 10 Jun 2012 18:21:53 +0000 (20:21 +0200)
templates/invoice/invoice_detail.html
templates/invoice/invoice_detail_print.html
templates/invoice/invoice_inner_detail.html [new file with mode: 0644]

index 1acff99bbdc3d12b276d0d9a2c21907a51bf341f..f98182b3a9d86a003d6809800f50af399a3ab02c 100644 (file)
@@ -2,17 +2,8 @@
 
 {% block content %}
 
-<ul>
-  <li>Invoice id: {{invoice.id}}</li>
-  <li>Client: {{invoice.customer.name}}</li>
-{% for line in invoice.invoiceline_set.all %}
-<li>{{ line.description }} -
-  {{ line.time }} hours  @
-  {{ line.hourly_rate }} {{ line.amount }}</li>
-{% endfor %}
-
-</ul>
-
+{% include "invoice/invoice_inner_detail.html" with rowclass="row-fluid" %}
 
+<a class="btn" href="{% url invoice:invoice_print_view invoice.id %}">Print</a>
 
 {% endblock %}
index ecbb80b0300f516bb7ce0d316cf8f74946c6541b..11b030d5a560cb8c843de5bc145211d5da92a39b 100644 (file)
   </head>
   <body>
     <div class="container">
-      <div class="page-header">
-       <h1>Invoice #{{invoice.id}}</h1>
-      </div>
-      <div class="row">
-       <div class="span4">
-         <ul class="unstyled">
-           <li><strong>{{invoice.customer.name}}</strong></li>
-           <li><p style="white-space: pre">{{invoice.customer.address}}</p></li>
-         </ul>
-         
-       </div>
-       
-       <div class="span4 offset4" class="border: 5px solid red">
-         <!-- Some metadata -->
-         <ul class="unstyled">
-           <li><big>err.no AS</big></li>
-           <li>Disengrenda 5b</li>
-           <li>0587 Oslo</li>
-           <li>Norway</li>
-           <li>Foretaksregisteret NO 998 270 189</li>
-           <li>info@err.no</li>
-         </ul>
-         <hr>
-         <ul class="unstyled">
-           <li>Invoice no: {{ invoice.id }}</li>
-           <li>Date: {{ invoice.date|date:"Y-m-d" }}</li>
-           <li>Due date: {{ invoice.due_date|date:"Y-m-d" }}</li>
-         </ul>
-         
-       </div>
-      </div>
-      <hr>
-
-      <div class="row">
-       <div class="span4">
-         <strong>Description</strong>
-       </div>
-       <div class="span2 ta-right">
-         <strong>Hours</strong>
-       </div>
-       <div class="span2 ta-right">
-         <strong>Rate ({{ invoice.currency }})</strong>
-       </div>
-       <div class="span2 ta-right">
-         <strong>Total</strong>
-       </div>
-      </div>
-      {% for line in invoice.invoiceline_set.all %}
-      <div class="row">
-       <div class="span4">
-         {{ line.description }}
-       </div>
-       <div class="span2 ta-right">
-           {{ line.time }}
-       </div>
-       <div class="span2 ta-right">
-         {{ line.hourly_rate }}
-       </div>
-       <div class="span2 ta-right">
-         {{ line.amount }}
-       </div>
-      </div>
-      {% endfor %}
-      <div>{{ invoice.comment }}</div>
-
-      <hr>
-      <div>Total: {{ invoice.currency }} {{ invoice.total_sum }}</div>
 
+      {% include "invoice/invoice_inner_detail.html" with rowclass="row" %}
        
-      </div>
     </div>
     <!-- Le javascript
         ================================================== -->
diff --git a/templates/invoice/invoice_inner_detail.html b/templates/invoice/invoice_inner_detail.html
new file mode 100644 (file)
index 0000000..02a6035
--- /dev/null
@@ -0,0 +1,69 @@
+<div class="page-header">
+  <h1>Invoice #{{invoice.id}}</h1>
+</div>
+
+<div class="{{ rowclass }}">
+
+  <div class="span4">
+    <ul class="unstyled">
+      <li><strong>{{invoice.customer.name}}</strong></li>
+      <li><p style="white-space: pre">{{invoice.customer.address}}</p></li>
+    </ul>
+    
+  </div>
+  
+  <div class="span4 offset4" class="border: 5px solid red">
+    <!-- Some metadata -->
+    <ul class="unstyled">
+      <li><big>err.no AS</big></li>
+      <li>Disengrenda 5b</li>
+      <li>0587 Oslo</li>
+      <li>Norway</li>
+      <li>Foretaksregisteret NO 998 270 189</li>
+      <li>info@err.no</li>
+    </ul>
+    <hr>
+    <ul class="unstyled">
+      <li>Invoice no: {{ invoice.id }}</li>
+      <li>Date: {{ invoice.date|date:"Y-m-d" }}</li>
+      <li>Due date: {{ invoice.due_date|date:"Y-m-d" }}</li>
+    </ul>
+    
+  </div>
+  <hr>
+</div>
+
+<div class="{{ rowclass }}">
+  <div class="span4">
+    <strong>Description</strong>
+  </div>
+  <div class="span2 ta-right">
+    <strong>Hours</strong>
+  </div>
+  <div class="span2 ta-right">
+    <strong>Rate ({{ invoice.currency }})</strong>
+  </div>
+  <div class="span2 ta-right">
+    <strong>Total</strong>
+  </div>
+</div>
+{% for line in invoice.invoiceline_set.all %}
+<div class="{{ rowclass }}">
+  <div class="span4">
+    {{ line.description }}
+  </div>
+  <div class="span2 ta-right">
+    {{ line.time }}
+  </div>
+  <div class="span2 ta-right">
+    {{ line.hourly_rate }}
+  </div>
+  <div class="span2 ta-right">
+    {{ line.amount }}
+  </div>
+</div>
+{% endfor %}
+<div>{{ invoice.comment }}</div>
+
+<hr>
+<div>Total: {{ invoice.currency }} {{ invoice.total_sum }}</div>