diff --git a/.gitignore b/.gitignore index 004b085..1651a7b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ __pycache__/ app/uploads/** !app/uploads/cover app/mydatabase.db +pyrqlite/ +whoosh/ +sqlalchemy-rqlite/ +rqlite* diff --git a/app/forms.py b/app/forms.py index f314919..c3aacd0 100755 --- a/app/forms.py +++ b/app/forms.py @@ -51,6 +51,7 @@ class ChatForm(FlaskForm): class StackForm(FlaskForm): stack_name = StringField('Stack', validators=[InputRequired()]) stack_description = StringField('Description', validators=[InputRequired()]) + stack_author = StringField('Who made this', validators=[InputRequired()]) create = SubmitField(label='Create') class AddtoStackForm(FlaskForm): @@ -71,7 +72,3 @@ class SearchForm(FlaskForm): grid = SubmitField('Grid') listview = SubmitField('List') randomize = SubmitField('Order differently') - - - - diff --git a/app/models.py b/app/models.py index 8bdc1c2..11d403a 100755 --- a/app/models.py +++ b/app/models.py @@ -100,11 +100,14 @@ class Stack(db.Model): __tablename__ = 'stacks' id = db.Column(db.Integer, primary_key = True) stack_name = db.Column(db.String(50)) - stack_description = db.Column(db.String(500)) + stack_description = db.Column(db.String(1000)) + stack_author = db.Column(db.String(255)) - def __init__(self, stack_name, stack_description): + + def __init__(self, stack_name, stack_description, stack_author): self.stack_name = stack_name self.stack_description = stack_description + self.stack_author = stack_author def __repr__(self): return '' % self.stack_name diff --git a/app/static/css/style.css b/app/static/css/style.css index 6db020c..5573e85 100755 --- a/app/static/css/style.css +++ b/app/static/css/style.css @@ -205,7 +205,11 @@ font-size: 12px; .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 0; background-color: yellow !important; list-style-type: none;} .ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: left; width: 50em; font-size: 12px; list-style-type: none;} +#creator{ + font-size: 12px; + color: grey; +} #newstext{ width: 100%; diff --git a/app/templates/add_stack.html b/app/templates/add_stack.html index 0fe1e5f..c960eb3 100644 --- a/app/templates/add_stack.html +++ b/app/templates/add_stack.html @@ -16,14 +16,14 @@ {% endif %} - {% endwith %} + {% endwith %}
{{form.hidden_tag()}}
{{ render_field(form.stack_name)}} {{ render_field(form.stack_description)}} - +{{ render_field(form.stack_author)}} diff --git a/app/templates/show_books.html b/app/templates/show_books.html index fc4c1da..8ab4350 100755 --- a/app/templates/show_books.html +++ b/app/templates/show_books.html @@ -63,7 +63,7 @@
  • - {{ stack.stack_name }} + {{ stack.stack_name }}
  • {% endfor %} diff --git a/app/templates/show_stack_detail.html b/app/templates/show_stack_detail.html index 0e2d293..f55d6a2 100644 --- a/app/templates/show_stack_detail.html +++ b/app/templates/show_stack_detail.html @@ -6,6 +6,12 @@

    {{ stack.stack_name }}

    {{ stack.stack_description }}

    +

    Created by: +{% if stack.stack_author == None %} anon

    +{% else %} + + {{ stack.stack_author }} +{% endif %}

    Books in this stack:

    {% for book in stack.books %} diff --git a/app/templates/show_stack_detail_tab.html b/app/templates/show_stack_detail_tab.html index afa9b30..cf32045 100644 --- a/app/templates/show_stack_detail_tab.html +++ b/app/templates/show_stack_detail_tab.html @@ -10,6 +10,13 @@

    {{ stack.stack_description }}

    +

    Created by: +{% if stack.stack_author == None %} anon

    +{% else %} + + {{ stack.stack_author }} +{% endif %} +

    Books in this stack: {% for book in stack.books %} diff --git a/app/templates/show_stacks.html b/app/templates/show_stacks.html index f1388a5..705d2f0 100644 --- a/app/templates/show_stacks.html +++ b/app/templates/show_stacks.html @@ -4,8 +4,6 @@

    Stacks

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

    -

    Add a new stack

    - @@ -26,6 +24,8 @@
    +

    Add a new stack

    +

    diff --git a/app/views.py b/app/views.py index 424abff..e9171a3 100755 --- a/app/views.py +++ b/app/views.py @@ -327,9 +327,10 @@ def add_stack(): if form.validate_on_submit(): stack_name = form.stack_name.data stack_description = form.stack_description.data - stack = Stack(stack_name, stack_description) + stack_author = form.stack_author.data + stack = Stack(stack_name, stack_description, stack_author) if form.stack_name.data: - stack = Stack(stack_name, stack_description) + stack = Stack(stack_name, stack_description, stack_author) db.session.add(stack) stacks = db.session.query(Stack).all() return redirect(url_for('show_stacks'))