Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % # First declare that output from this template is to be put inside another template after running all the code (rendering)
- % rebase(skinning + '_skin.tpl', title=page_title) # (See note above)
- % # From here, concentrate on the content we would like to show:
- <!-- Lines not starting with % are standard HTML. This HTML code is defined in views/all_items.tpl -->
- <div class="table-responsive">
- <table class="table table-striped">
- <thead>
- <tr>
- <th scope="col">No.</th>
- % for k in displaykeys:
- <th scope="col">{{k.title()}}</th>
- % end # Usual python indention to structure code does not work in .tpl files - "end" is used instead to end a block
- </tr>
- </thead>
- <tbody>
- % for i, d in enumerate(displaydata): # displaydata is expected to be a list of dictionaries
- % link_url = "/events/" + str(i + 1) # relative url to detailed view
- <tr>
- <th scope="row">{{i + 1}}</th>
- % for k in displaykeys: # Go thru the keys in the same order as for the headline row
- <td><a href="{{link_url}}" alt="See details">{{displaydata[i][k]}}</a></td>
- % end # Usual python indention to structure code does not work in .tpl files - "end" is used instead to end a block
- </tr>
- % end
- </tbody>
- </table>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement