Advertisement
DragonOsman

index.html template, pset7 Finance

Mar 13th, 2017
486
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.76 KB | None | 0 0
  1. {% extends "layout.html" %}
  2.  
  3. {% block title %}
  4.     Portfolio
  5. {% endblock %}
  6.  
  7. {% block main %}
  8.     <table class="table table-striped">
  9.         <thead>
  10.             <tr>
  11.                 <th>Symbol</th>
  12.                 <th>Name</th>
  13.                 <th>Shares</th>
  14.                 <th>Price</th>
  15.                 <th>TOTAL</th>
  16.             </tr>
  17.         </thead>
  18.         <tfoot>
  19.             <tr>
  20.                 <td colspan="4"></td>
  21.                 <td><b>{{ grand_total|usd }}</b></td>
  22.             </tr>
  23.         </tfoot>
  24.         <tbody>
  25.             {% for key in stock_names_dict %}
  26.                 {% if no_of_shares_dict.get(key) == 0 %}
  27.                     <tr>
  28.                         <td>{{ key|e }}</td>
  29.                         <td>{{ stock_names_dict.get(key)|e }}</td>
  30.                         <td>{{ no_of_shares_dict.get(key)|e }}</td>
  31.                         <td>{{ current_price_dict.get(key)|e }}</td>
  32.                         <td>{{ (current_price_dict.get(key) * no_of_shares_dict.get(key))|e }}</td>
  33.                     </tr>
  34.                 {% else %}
  35.                     <tr>
  36.                         <td>{{ key }}</td>
  37.                         <td>{{ stock_names_dict.get(key) }}</td>
  38.                         <td>{{ no_of_shares_dict.get(key) }}</td>
  39.                         <td>{{ current_price_dict.get(key)|usd }}</td>
  40.                         <td>{{ (current_price_dict.get(key) * no_of_shares_dict.get(key))|usd }}</td>
  41.                     </tr>
  42.                 {% endif %}
  43.             {% endfor %}
  44.             <tr>
  45.                 <td colspan="4">CASH</td>
  46.                 {% for i in users_info %}
  47.                     <td>{{ i.cash|usd }}</td>
  48.                 {% endfor %}
  49.             </tr>
  50.         </tbody>
  51.     </table>
  52. {% endblock %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement