diff --git a/app/forms.py b/app/forms.py index 6eeb292..0db4fdf 100755 --- a/app/forms.py +++ b/app/forms.py @@ -25,6 +25,7 @@ class EditForm(FlaskForm): author = FieldList(FormField(AuthorForm, default=lambda: Author()), min_entries=1) category = StringField('category', validators=[InputRequired()]) year_published = StringField('year published', [validators.Length(max=4)],default=None) + class ChatForm(FlaskForm): message = StringField('message', validators=[InputRequired()]) send = SubmitField(label='Send') @@ -36,7 +37,11 @@ class StackForm(FlaskForm): class AddtoStackForm(FlaskForm): select_stack = SelectField('Stacks', validators=[InputRequired()]) - + +class EditStackForm(FlaskForm): + edit_stack_name = StringField('Stack', validators=[InputRequired()]) + edit_stack_description = StringField('Description', validators=[InputRequired()]) + class SearchForm(FlaskForm): choices = [('All', 'All'), ('Title', 'Title'), diff --git a/app/templates/add_to_stacks.html b/app/templates/add_to_stacks.html index 144b15b..c2ed248 100644 --- a/app/templates/add_to_stacks.html +++ b/app/templates/add_to_stacks.html @@ -16,22 +16,6 @@ - - -
-
-

Build a stack

- -

Add Stack

- -
-

List of books

-
- -
-

Stack

-
- {% endblock %} diff --git a/app/templates/edit_stack_detail.html b/app/templates/edit_stack_detail.html new file mode 100644 index 0000000..6390e23 --- /dev/null +++ b/app/templates/edit_stack_detail.html @@ -0,0 +1,25 @@ +{% extends 'base.html' %} + +{% block main %} +
+ + +
+ {{ form.csrf_token }} +

+
+ {{ form.edit_stack_name.label }} {{ form.edit_stack_name(size=20, class="form-control") }} +

+
+ {{ form.edit_stack_description.label }} {{ form.edit_stack_description(size=20, class="form-control") }} +
+ +
+ +
+ +
+{% endblock %} diff --git a/app/templates/results.html b/app/templates/results.html index 8114fcd..aa1acf7 100644 --- a/app/templates/results.html +++ b/app/templates/results.html @@ -33,6 +33,8 @@ Filetype Category Stack + Add to stack + {% for book in books %} @@ -51,6 +53,10 @@
  • {{ stack.stack_name }}
  • {% endfor %} + + + ==> + {% endfor %} @@ -68,6 +74,8 @@ Filetype Category Stack + Add to stack + {% for book in books_all %} @@ -86,6 +94,9 @@
  • {{ stack.stack_name }}
  • {% endfor %} + + ==> + {% endfor %}

    diff --git a/app/templates/show_books.html b/app/templates/show_books.html index 4171fef..e4860e7 100755 --- a/app/templates/show_books.html +++ b/app/templates/show_books.html @@ -63,15 +63,8 @@ - \│/
    - ─ ─
    - /│\
    - - - - + ==>
    - {% endfor %} diff --git a/app/templates/show_stack_detail.html b/app/templates/show_stack_detail.html index 01551de..af144cd 100644 --- a/app/templates/show_stack_detail.html +++ b/app/templates/show_stack_detail.html @@ -5,12 +5,14 @@

    {{ stack.stack_name }}

    -

    {{ stack.stack_description }}

    Books in this stack: {% for book in stack.books %}

  • {{book.title}}
  • - + +
    + +
    {% endfor %}

    @@ -18,6 +20,9 @@

    Delete

    + Edit

    + +

    Go back to stacks

    diff --git a/app/templates/show_stack_detail_tab.html b/app/templates/show_stack_detail_tab.html index c8f703a..d074c2c 100644 --- a/app/templates/show_stack_detail_tab.html +++ b/app/templates/show_stack_detail_tab.html @@ -1,15 +1,24 @@ {% block main %}
    -

    {{ stack.stack_name }}

    +

    + + {{ stack.stack_name }} +

    -

    Stack description: {{ stack.stack_description }}

    + + +

    {{ stack.stack_description }}

    Books in this stack: {% for book in stack.books %} -

  • {{book.title}}
  • +
  • {{book.title}}
  • + +

    + Add to another stack +

    {% endfor %}

    diff --git a/app/templates/show_stacks.html b/app/templates/show_stacks.html index 27fd207..f1388a5 100644 --- a/app/templates/show_stacks.html +++ b/app/templates/show_stacks.html @@ -4,6 +4,8 @@

    Stacks

    These are all the stacks that have been built so far.

    +

    Add a new stack

    + @@ -11,7 +13,11 @@