added description next to each stack tab
This commit is contained in:
parent
cc191859bd
commit
ba58a895fb
@ -1,3 +1,4 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block main %}
|
||||
<div class="container">
|
||||
@ -5,13 +6,7 @@
|
||||
<h1 class="header">{{ stack.stack_name }}</h1>
|
||||
|
||||
|
||||
<p>Stack description:
|
||||
{% for stack in stacks %}
|
||||
|
||||
<a href="{{url_for('show_stack_by_id', id=stack.id)}}">{{ stack.stack_description }}</a>
|
||||
|
||||
{% endfor %}
|
||||
</p>
|
||||
<p>Stack description: {{ stack.stack_description }} </p>
|
||||
<p>Books in this stack: {% for book in stack.books %}
|
||||
|
||||
<li> <a href="{{url_for('show_book_by_id', id=book.id)}}">{{book.title}}</a> </li>
|
||||
|
@ -11,8 +11,7 @@
|
||||
<ul>
|
||||
{% for stack in stacks %}
|
||||
|
||||
|
||||
<li> <a href="stacks/{{ stack.id }}">{{ stack.stack_name }}</a></td>
|
||||
<li> <a href="stacks/tab/{{ stack.id }}">{{ stack.stack_name }}</a></td>
|
||||
|
||||
|
||||
|
||||
|
11
app/views.py
11
app/views.py
@ -294,15 +294,22 @@ def add_stack():
|
||||
flash("%s stack created" % (stack_name))
|
||||
return render_template('add_stack.html', stacks=stacks, form=form)
|
||||
|
||||
@app.route('/stacks/tab/<int:id>', methods=['POST', 'GET'])
|
||||
def show_stack_in_tab(id):
|
||||
return show_stack_by_id(id, is_tab=True)
|
||||
|
||||
|
||||
@app.route('/stacks/<int:id>', methods=['POST', 'GET'])
|
||||
def show_stack_by_id(id):
|
||||
def show_stack_by_id(id, is_tab=False):
|
||||
|
||||
stack = Stack.query.get(id)
|
||||
if not stack:
|
||||
abort (404)
|
||||
else:
|
||||
return render_template('show_stack_detail.html', stack=stack)
|
||||
if is_tab == False:
|
||||
return render_template('show_stack_detail.html', stack=stack)
|
||||
else:
|
||||
return render_template('show_stack_detail_tab.html', stack=stack)
|
||||
|
||||
## search
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user