added add to stack first part
parent
11f82645bf
commit
7beca18eb7
@ -0,0 +1,36 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block main %}
|
||||
<div class="container">
|
||||
|
||||
<!-- {% from "_formhelpers.html" import render_field %}
|
||||
|
||||
<h1 class="page-header">Add Stack</h1>
|
||||
{% with messages = get_flashed_messages() %}
|
||||
{% if messages %}
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
{% for message in messages %}
|
||||
<li>{{ message }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endwith %} -->
|
||||
|
||||
<form method="POST" action="{{ url_for('add_stack') }}" enctype=multipart/form-data>
|
||||
{{form.hidden_tag()}}
|
||||
<br>
|
||||
{{ render_field(form.stack_name)}}
|
||||
{{ render_field(form.stack_description)}}
|
||||
|
||||
<button type="submit" class='button'>Create</button>
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
@ -0,0 +1,44 @@
|
||||
{% extends 'base.html' %}
|
||||
|
||||
{% block main %}
|
||||
<div class="container">
|
||||
|
||||
<div> Chosen book:
|
||||
|
||||
<h1 class="header">{{ book.title }}</h1>
|
||||
<img class="no_cover" id="{{ book.title }}" src="../uploads/cover/{{ book.cover }}" width="150" onerror="if (this.src != '../static/img/{{ book.cover }}') this.src = '../static/img/default_cover.png';">
|
||||
|
||||
</div>
|
||||
<p>These are all the stacks that have been built so far.</p>
|
||||
|
||||
<table style="width:100%">
|
||||
|
||||
|
||||
<ul>
|
||||
{% for stack in stacks %}
|
||||
|
||||
<li> <a href="stacks/tab/{{ stack.id }}">{{ stack.stack_name }}</a></td>
|
||||
|
||||
|
||||
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<h1 class="page-header">Build a stack</h1>
|
||||
|
||||
<p><a href= {{ url_for('add_stack') }}>Add Stack</a></p>
|
||||
|
||||
<div id="draggable" class="ui-widget-content">
|
||||
<p>List of books</p>
|
||||
</div>
|
||||
|
||||
<div id="droppable" class="ui-widget-header">
|
||||
<p>Stack</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
@ -0,0 +1,18 @@
|
||||
{% block main %}
|
||||
<div class="container">
|
||||
|
||||
<h1 class="header">{{ stack.stack_name }}</h1>
|
||||
|
||||
|
||||
<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>
|
||||
|
||||
{% endfor %}</p>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
Loading…
Reference in New Issue