Guest User

Untitled

a guest
Jul 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>{% block title %}{% endblock %}</title>
  5. {% load staticfiles %}
  6. <!-- This area contains all my static files and cdns -->
  7.  
  8. </head>
  9. <body>
  10. {% include 'inventory/snippets/nav.html' %}
  11.  
  12. {% block content %}
  13. {% endblock content %}
  14.  
  15. {% block body %}
  16. {% endblock body %}
  17. </body>
  18. </html>
  19.  
  20. {% load filters %}
  21. {% load el_pagination_tags %}
  22.  
  23. {% with invoices=invoice_list %}
  24. {% paginate invoices %}
  25. {% for invoice in invoices %}
  26. <!-- data stuffs -->
  27. <tr>
  28. <td></td>
  29. </tr>
  30. {% endfor %}
  31. {% show_more %}
  32. {% endwith %}
  33.  
  34. {% extends "inventory/base.html" %}
  35.  
  36. {% load staticfiles %}
  37. {% load filters %}
  38. {% load el_pagination_tags %}
  39.  
  40. {% block title %}
  41. Cool Title
  42. {% endblock %}
  43.  
  44. {% block content %}
  45. <div class="table-responsive-md">
  46. <table class="table table-hover table-sm table-bordered">
  47. <thead>
  48. <tr>
  49. <th></th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. {% include page_template %}
  54.  
  55. {% block js %}
  56. {{ block.super }}
  57. <script src="https://code.jquery.com/jquery-latest.js"></script>
  58. <script src="{% static 'el-pagination/js/el-pagination.js' %}"></script>
  59. <script>$.endlessPaginate();</script>
  60. {% endblock %}
  61. </tbody>
  62. </table>
  63. </div>
  64.  
  65. {% endblock %}
  66.  
  67. def invoice_list_view(request,template='inventory/invoices.html',page_template='inventory/invoices_list.html'):
  68. context = {
  69. 'page_template': page_template,
  70. }
  71. if request.method == 'POST':
  72. if request.is_ajax():
  73. template = page_template
  74.  
  75. # all_invoices is prefetched and what not, super fast.
  76. context['invoice_list'] = all_invoices
  77.  
  78. return render(request, template, context)
Add Comment
Please, Sign In to add comment