diff --git a/data_static/Tag.csv b/data_static/Tag.csv new file mode 100644 index 0000000..e596e2c --- /dev/null +++ b/data_static/Tag.csv @@ -0,0 +1,20 @@ +name +English +"Български" +"политика" +politics +technology +"технологии" +hacks +"мнения" +opinions +projects +"проекти" +"есета" +essays +"лични" +personal +university +learning +life +"живот" diff --git a/data_static/_process_order b/data_static/_process_order index 942a1ea..cdf738e 100644 --- a/data_static/_process_order +++ b/data_static/_process_order @@ -1,2 +1,5 @@ +Tag +BlogPost +blog_post__tag Role User \ No newline at end of file diff --git a/data_static/blog_post__tag.csv b/data_static/blog_post__tag.csv new file mode 100644 index 0000000..0ab320e --- /dev/null +++ b/data_static/blog_post__tag.csv @@ -0,0 +1,156 @@ +blog_post_id,tag_id +1,2 +1,3 +51,2 +51,3 +50,1 +51,6 +51,8 +1,8 +2,1 +2,9 +30,1 +30,5 +30,9 +34,2 +34,12 +43,2 +43,3 +43,8 +53,2 +53,3 +44,2 +44,3 +44,12 +47,2 +47,3 +47,8 +48,1 +48,13 +45,2 +45,11 +31,1 +31,15 +4,1 +4,16 +6,1 +6,16 +9,1 +9,16 +10,1 +10,16 +11,1 +11,16 +12,1 +12,16 +15,1 +15,16 +16,1 +16,16 +17,1 +17,16 +18,1 +18,16 +19,1 +19,16 +20,1 +20,16 +23,1 +23,16 +24,1 +24,16 +25,1 +25,16 +26,1 +26,16 +27,1 +27,16 +29,1 +29,16 +32,1 +32,16 +37,1 +37,16 +39,1 +39,16 +40,1 +40,16 +41,1 +41,16 +42,1 +42,7 +50,4 +49,1 +49,17 +21,1 +21,5 +21,7 +28,2 +28,3 +3,1 +3,5 +3,13 +5,1 +5,5 +5,13 +7,1 +7,13 +7,18 +8,1 +8,5 +8,7 +13,1 +13,16 +14,1 +14,5 +14,7 +22,1 +22,13 +22,18 +33,2 +33,8 +38,1 +38,9 +35,1 +35,5 +35,10 +35,17 +36,1 +36,13 +36,15 +36,18 +46,2 +46,6 +46,8 +52,2 +54,2 +54,8 +55,2 +56,2 +57,2 +57,12 +57,14 +57,19 +58,2 +58,14 +59,2 +59,8 +59,19 +60,2 +60,3 +60,8 +61,2 +61,6 +61,8 +62,2 +62,6 +62,8 +63,2 +63,14 +64,2 +64,14 +64,19 +65,2 +65,12 +66,2 +66,8 diff --git a/data_static/media/20120322_matura/maturatest.png b/data_static/media/20120322_matura/maturatest.png new file mode 100644 index 0000000..4de8580 Binary files /dev/null and b/data_static/media/20120322_matura/maturatest.png differ diff --git a/data_static/media/20120322_matura/timeline.png b/data_static/media/20120322_matura/timeline.png new file mode 100644 index 0000000..8eef1cd Binary files /dev/null and b/data_static/media/20120322_matura/timeline.png differ diff --git a/migrations/versions/28f9ab4fc8b0_002.py b/migrations/versions/28f9ab4fc8b0_002.py deleted file mode 100644 index 1e5952b..0000000 --- a/migrations/versions/28f9ab4fc8b0_002.py +++ /dev/null @@ -1,41 +0,0 @@ -"""002 - -Revision ID: 28f9ab4fc8b0 -Revises: d08a068031c3 -Create Date: 2020-07-08 14:27:11.649888 - -""" -from alembic import op -import sqlalchemy as sa - - -# revision identifiers, used by Alembic. -revision = '28f9ab4fc8b0' -down_revision = 'd08a068031c3' -branch_labels = None -depends_on = None - - -def upgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.create_table('blog_post', - sa.Column('created_dt', sa.UnicodeText(), nullable=True), - sa.Column('updated_dt', sa.UnicodeText(), nullable=True), - sa.Column('id', sa.Integer(), nullable=False), - sa.Column('uuid', sa.Unicode(), nullable=True), - sa.Column('filename', sa.UnicodeText(), nullable=True), - sa.Column('title', sa.UnicodeText(), nullable=True), - sa.Column('body', sa.UnicodeText(), nullable=True), - sa.Column('user_id', sa.Integer(), nullable=True), - sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), - sa.PrimaryKeyConstraint('id') - ) - op.create_index(op.f('ix_blog_post_uuid'), 'blog_post', ['uuid'], unique=False) - # ### end Alembic commands ### - - -def downgrade(): - # ### commands auto generated by Alembic - please adjust! ### - op.drop_index(op.f('ix_blog_post_uuid'), table_name='blog_post') - op.drop_table('blog_post') - # ### end Alembic commands ### diff --git a/migrations/versions/d08a068031c3_001.py b/migrations/versions/d091fbf48f6f_001.py similarity index 60% rename from migrations/versions/d08a068031c3_001.py rename to migrations/versions/d091fbf48f6f_001.py index fb9df37..985ea69 100644 --- a/migrations/versions/d08a068031c3_001.py +++ b/migrations/versions/d091fbf48f6f_001.py @@ -1,8 +1,8 @@ """001 -Revision ID: d08a068031c3 +Revision ID: d091fbf48f6f Revises: -Create Date: 2020-07-08 11:48:15.369556 +Create Date: 2021-05-01 11:54:58.288320 """ from alembic import op @@ -10,7 +10,7 @@ import sqlalchemy as sa # revision identifiers, used by Alembic. -revision = 'd08a068031c3' +revision = 'd091fbf48f6f' down_revision = None branch_labels = None depends_on = None @@ -53,18 +53,51 @@ def upgrade(): sa.UniqueConstraint('email') ) op.create_index(op.f('ix_user_uuid'), 'user', ['uuid'], unique=False) + op.create_table('blog_post', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('uuid', sa.Unicode(), nullable=True), + sa.Column('filename', sa.UnicodeText(), nullable=True), + sa.Column('title', sa.UnicodeText(), nullable=True), + sa.Column('body', sa.UnicodeText(), nullable=True), + sa.Column('created_dt', sa.UnicodeText(), nullable=True), + sa.Column('updated_dt', sa.UnicodeText(), nullable=True), + sa.Column('user_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_blog_post_uuid'), 'blog_post', ['uuid'], unique=False) op.create_table('roles_users', sa.Column('user_id', sa.Integer(), nullable=True), sa.Column('role_id', sa.Integer(), nullable=True), sa.ForeignKeyConstraint(['role_id'], ['role.id'], ), sa.ForeignKeyConstraint(['user_id'], ['user.id'], ) ) + op.create_table('tag', + sa.Column('id', sa.Integer(), nullable=False), + sa.Column('uuid', sa.Unicode(), nullable=True), + sa.Column('name', sa.UnicodeText(), nullable=True), + sa.Column('user_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['user_id'], ['user.id'], ), + sa.PrimaryKeyConstraint('id') + ) + op.create_index(op.f('ix_tag_uuid'), 'tag', ['uuid'], unique=False) + op.create_table('blog_post__tag', + sa.Column('blog_post_id', sa.Integer(), nullable=True), + sa.Column('tag_id', sa.Integer(), nullable=True), + sa.ForeignKeyConstraint(['blog_post_id'], ['blog_post.id'], ), + sa.ForeignKeyConstraint(['tag_id'], ['tag.id'], ) + ) # ### end Alembic commands ### def downgrade(): # ### commands auto generated by Alembic - please adjust! ### + op.drop_table('blog_post__tag') + op.drop_index(op.f('ix_tag_uuid'), table_name='tag') + op.drop_table('tag') op.drop_table('roles_users') + op.drop_index(op.f('ix_blog_post_uuid'), table_name='blog_post') + op.drop_table('blog_post') op.drop_index(op.f('ix_user_uuid'), table_name='user') op.drop_table('user') op.drop_table('task') diff --git a/webapp/models/__init__.py b/webapp/models/__init__.py index 2f0e777..569feb8 100644 --- a/webapp/models/__init__.py +++ b/webapp/models/__init__.py @@ -1,2 +1,3 @@ from oshipka.persistance import db +from webapp.models.tag import Tag from webapp.models.blog_post import BlogPost diff --git a/webapp/models/_blog_post.py b/webapp/models/_blog_post.py index b008aa7..9e15c7e 100644 --- a/webapp/models/_blog_post.py +++ b/webapp/models/_blog_post.py @@ -1,5 +1,10 @@ from oshipka.persistance import db, ModelController, index_service, LiberalBoolean, Ownable +blog_post__tag = db.Table('blog_post__tag', + db.Column('blog_post_id', db.Integer(), db.ForeignKey('blog_post.id')), + db.Column('tag_id', db.Integer(), db.ForeignKey('tag.id')), + ) + class BlogPost(db.Model, ModelController, Ownable): __searchable__ = ['body', ] @@ -7,6 +12,11 @@ class BlogPost(db.Model, ModelController, Ownable): filename = db.Column(db.UnicodeText,) title = db.Column(db.UnicodeText,) body = db.Column(db.UnicodeText,) + tags = db.relationship('Tag', secondary=blog_post__tag, + backref=db.backref("blog_posts"), + ) + + _m_n_table_tags = 'Tag' created_dt = db.Column(db.UnicodeText,) updated_dt = db.Column(db.UnicodeText,) diff --git a/webapp/models/_tag.py b/webapp/models/_tag.py new file mode 100644 index 0000000..11ba1c5 --- /dev/null +++ b/webapp/models/_tag.py @@ -0,0 +1,8 @@ +from oshipka.persistance import db, ModelController, index_service, LiberalBoolean, Ownable + + +class Tag(db.Model, ModelController, Ownable): + name = db.Column(db.UnicodeText,) + + def __repr__(self): + return "{}".format(self.name) diff --git a/webapp/models/tag.py b/webapp/models/tag.py new file mode 100644 index 0000000..ddd6278 --- /dev/null +++ b/webapp/models/tag.py @@ -0,0 +1 @@ +from webapp.models._tag import Tag \ No newline at end of file diff --git a/webapp/routes/__init__.py b/webapp/routes/__init__.py index 0db7492..191e322 100644 --- a/webapp/routes/__init__.py +++ b/webapp/routes/__init__.py @@ -1 +1,2 @@ +from webapp.routes.tag import * from webapp.routes.blog_post import * diff --git a/webapp/routes/tag.py b/webapp/routes/tag.py new file mode 100644 index 0000000..320ba4b --- /dev/null +++ b/webapp/routes/tag.py @@ -0,0 +1,68 @@ +""" +!!!AUTOGENERATED: DO NOT EDIT!!! + +Edit the hooks in webapp/routes/tag_hooks.py instead +""" + +from oshipka.webapp import app +from oshipka.webapp.views import ModelView +from webapp.models import Tag +from webapp.routes.tag_hooks import * + +tag = ModelView(app, Tag) + +tag.register_verb(view_context=get_view_context, + verb="get", + methods=['GET'], + per_item=True, + is_login_required=False, + the_roles_required=[], + ) + +tag.register_verb(view_context=list_view_context, + verb="list", + methods=['GET'], + per_item=False, + is_login_required=False, + the_roles_required=[], + ) + +tag.register_verb(view_context=table_view_context, + verb="table", + methods=['GET'], + per_item=False, + is_login_required=False, + the_roles_required=[], + ) + +tag.register_verb(view_context=search_view_context, + verb="search", + methods=['GET'], + per_item=False, + is_login_required=False, + the_roles_required=[], + ) + +tag.register_verb(view_context=create_view_context, + verb="create", + methods=['GET', 'POST'], + per_item=False, + is_login_required=True, + the_roles_required=['admin'], + ) + +tag.register_verb(view_context=update_view_context, + verb="update", + methods=['GET', 'POST'], + per_item=True, + is_login_required=True, + the_roles_required=['admin'], + ) + +tag.register_verb(view_context=delete_view_context, + verb="delete", + methods=['GET', 'POST'], + per_item=True, + is_login_required=True, + the_roles_required=['admin'], + ) diff --git a/webapp/routes/tag_hooks.py b/webapp/routes/tag_hooks.py new file mode 100644 index 0000000..164439a --- /dev/null +++ b/webapp/routes/tag_hooks.py @@ -0,0 +1,71 @@ +from oshipka.webapp.views import ViewContext, default_get_args_func, default_get_func, default_list_func, \ + default_get_form_func, default_create_func, default_update_func, default_delete_func, default_search_func + + +def get_template(vc): + vc.template = "{}/get.html".format(vc.model_view.model_name) + + +def list_template(vc): + vc.template = "{}/list.html".format(vc.model_view.model_name) + + +def table_template(vc): + vc.template = "{}/table.html".format(vc.model_view.model_name) + + +def search_template(vc): + vc.template = "{}/search.html".format(vc.model_view.model_name) + + +def create_template(vc): + vc.template = "{}/create.html".format(vc.model_view.model_name) + + +def update_template(vc): + vc.template = "{}/update.html".format(vc.model_view.model_name) + + +def delete_template(vc): + vc.template = "delete_instance.html".format(vc.model_view.model_name) + + +get_view_context = ViewContext( + filter_func=default_get_func, + template_func=get_template, +) + +list_view_context = ViewContext( + filter_func=default_list_func, + template_func=list_template, +) + +table_view_context = ViewContext( + filter_func=default_list_func, + template_func=table_template, +) + +search_view_context = ViewContext( + filter_func=default_search_func, + template_func=list_template, +) + +create_view_context = ViewContext( + args_get_func=default_get_form_func, + template_func=create_template, + execute_func=default_create_func, +) + +update_view_context = ViewContext( + args_get_func=default_get_form_func, + filter_func=default_get_func, + template_func=update_template, + execute_func=default_update_func, +) + +delete_view_context = ViewContext( + args_get_func=default_get_form_func, + filter_func=default_get_func, + template_func=delete_template, + execute_func=default_delete_func, +) diff --git a/webapp/templates/blog_post/_create.html b/webapp/templates/blog_post/_create.html index 840025e..f9df3fc 100644 --- a/webapp/templates/blog_post/_create.html +++ b/webapp/templates/blog_post/_create.html @@ -25,6 +25,24 @@ + + {% endif %} + {% if "tag" not in disabled_columns %} + + : + + + {% endif %} {% if "created_dt" not in disabled_columns %} diff --git a/webapp/templates/blog_post/_get.html b/webapp/templates/blog_post/_get.html index a925ddf..a966370 100644 --- a/webapp/templates/blog_post/_get.html +++ b/webapp/templates/blog_post/_get.html @@ -8,6 +8,9 @@ {% if "body" not in skip_list %}
  • {{ _("body") }}: {{ instance.body }}
  • {% endif %} +{% if "tag" not in skip_list %} +
  • {{ _("tags") }}: {{ instance.tags }}
  • +{% endif %} {% if "created_dt" not in skip_list %}
  • {{ _("created_dt") }}: {{ instance.created_dt }}
  • {% endif %} diff --git a/webapp/templates/blog_post/_list_item.html b/webapp/templates/blog_post/_list_item.html index 5cf2b63..47dff3d 100644 --- a/webapp/templates/blog_post/_list_item.html +++ b/webapp/templates/blog_post/_list_item.html @@ -2,4 +2,13 @@ {% include "blog_post/_title.html" %} {% include "blog_post/_actions.html" %} + {% if instance.tags %} + + {% endif %} \ No newline at end of file diff --git a/webapp/templates/blog_post/_table.html b/webapp/templates/blog_post/_table.html index 7dd56e2..08bbdb6 100644 --- a/webapp/templates/blog_post/_table.html +++ b/webapp/templates/blog_post/_table.html @@ -10,6 +10,9 @@ {% if "body" not in skip_columns %} {{ _("body") }} {% endif %} + {% if "tag" not in skip_columns %} + {{ _("tag") }} + {% endif %} {% if "created_dt" not in skip_columns %} {{ _("created_dt") }} {% endif %} @@ -37,6 +40,11 @@ {{ instance.body }} {% endif %} + {% if "tag" not in skip_columns %} + + {{ instance.tags }} + + {% endif %} {% if "created_dt" not in skip_columns %} {{ instance.created_dt }} diff --git a/webapp/templates/blog_post/_update.html b/webapp/templates/blog_post/_update.html index 102def7..1d7696a 100644 --- a/webapp/templates/blog_post/_update.html +++ b/webapp/templates/blog_post/_update.html @@ -27,6 +27,19 @@ + + {% endif %} + {% if "tag" not in disabled_columns %} + + : + + + {% endif %} {% if "created_dt" not in disabled_columns %} diff --git a/webapp/templates/blog_post/get_single.html b/webapp/templates/blog_post/get_single.html index 504c928..79e3c95 100644 --- a/webapp/templates/blog_post/get_single.html +++ b/webapp/templates/blog_post/get_single.html @@ -1,3 +1,7 @@

    {{ instance.title }}

    -{{ _("Created on") }} {{ instance.created_dt }} +{% if instance.tags %} + {{ _("Tags") }}: {% for tag in instance.tags %} + {{ tag.name }}{% if not loop.last %},{% endif %} {% endfor %}
    +{% endif %} +{{ _("Created on") }} {{ instance.created_dt|to_dt|format_dt }} {{ instance.body|markdown|rawhtmlparse|safe }} \ No newline at end of file diff --git a/webapp/templates/navigation.html b/webapp/templates/navigation.html index 450b066..5545b69 100644 --- a/webapp/templates/navigation.html +++ b/webapp/templates/navigation.html @@ -1,4 +1,9 @@ {{ _("PiSquared Blog") }} | {{ _("Index") }} | +{{ _("Tags") }} | {{ _("RSS") }} | -{{ _("About Me") }} \ No newline at end of file +{{ _("About Me") }} + +{% if current_user.is_authenticated %} + | {{ _("Admin") }} +{% endif %} \ No newline at end of file diff --git a/webapp/templates/tag/_action_delete.html b/webapp/templates/tag/_action_delete.html new file mode 100644 index 0000000..75a6546 --- /dev/null +++ b/webapp/templates/tag/_action_delete.html @@ -0,0 +1 @@ +x \ No newline at end of file diff --git a/webapp/templates/tag/_action_edit.html b/webapp/templates/tag/_action_edit.html new file mode 100644 index 0000000..6be69bd --- /dev/null +++ b/webapp/templates/tag/_action_edit.html @@ -0,0 +1 @@ +e \ No newline at end of file diff --git a/webapp/templates/tag/_actions.html b/webapp/templates/tag/_actions.html new file mode 100644 index 0000000..da7efd6 --- /dev/null +++ b/webapp/templates/tag/_actions.html @@ -0,0 +1,4 @@ +[ +{% include "tag/_action_edit.html" %} | +{% include "tag/_action_delete.html" %} +] \ No newline at end of file diff --git a/webapp/templates/tag/_create.html b/webapp/templates/tag/_create.html new file mode 100644 index 0000000..6bad297 --- /dev/null +++ b/webapp/templates/tag/_create.html @@ -0,0 +1,15 @@ +
    + + + {% if "name" not in disabled_columns %} + + {% endif %} +
    + : + + +
    + +
    \ No newline at end of file diff --git a/webapp/templates/tag/_get.html b/webapp/templates/tag/_get.html new file mode 100644 index 0000000..026f572 --- /dev/null +++ b/webapp/templates/tag/_get.html @@ -0,0 +1,4 @@ + +{% if "name" not in skip_list %} +
  • {{ _("name") }}: {{ instance.name }}
  • +{% endif %} \ No newline at end of file diff --git a/webapp/templates/tag/_list.html b/webapp/templates/tag/_list.html new file mode 100644 index 0000000..43eb805 --- /dev/null +++ b/webapp/templates/tag/_list.html @@ -0,0 +1,3 @@ +{% for instance in instances %} +{% include "tag/_list_item.html" %} +{% endfor %} \ No newline at end of file diff --git a/webapp/templates/tag/_list_item.html b/webapp/templates/tag/_list_item.html new file mode 100644 index 0000000..83661c6 --- /dev/null +++ b/webapp/templates/tag/_list_item.html @@ -0,0 +1,7 @@ +
  • + + {% include "tag/_title.html" %} ({{ instance.blog_posts|count }}) + {% if current_user.is_authenticated %} + {% include "tag/_actions.html" %} + {% endif %} +
  • \ No newline at end of file diff --git a/webapp/templates/tag/_search.html b/webapp/templates/tag/_search.html new file mode 100644 index 0000000..b20ca58 --- /dev/null +++ b/webapp/templates/tag/_search.html @@ -0,0 +1,11 @@ +{% for instance in instances %} +
  • + + {% include "tag/_title.html" %} + | + [ + e | + x + ] +
  • +{% endfor %} \ No newline at end of file diff --git a/webapp/templates/tag/_table.html b/webapp/templates/tag/_table.html new file mode 100644 index 0000000..0d9f5bb --- /dev/null +++ b/webapp/templates/tag/_table.html @@ -0,0 +1,25 @@ + + + + {% if "name" not in skip_columns %} + + {% endif %} + + + + + {% for instance in instances %} + + {% if "name" not in skip_columns %} + + {% endif %} + + + {% endfor %} + +
    {{ _("name") }}{{ _("Actions") }}
    + {{ instance.name }} + + e | + x +
    \ No newline at end of file diff --git a/webapp/templates/tag/_title.html b/webapp/templates/tag/_title.html new file mode 100644 index 0000000..affb025 --- /dev/null +++ b/webapp/templates/tag/_title.html @@ -0,0 +1,2 @@ + + {{ instance.name }} \ No newline at end of file diff --git a/webapp/templates/tag/_update.html b/webapp/templates/tag/_update.html new file mode 100644 index 0000000..7be058e --- /dev/null +++ b/webapp/templates/tag/_update.html @@ -0,0 +1,16 @@ +
    + + + {% if "name" not in disabled_columns %} + + {% endif %} +
    + : + + +
    + +
    \ No newline at end of file diff --git a/webapp/templates/tag/create.html b/webapp/templates/tag/create.html new file mode 100644 index 0000000..46a11c3 --- /dev/null +++ b/webapp/templates/tag/create.html @@ -0,0 +1,6 @@ +{% extends "layout.html" %} + +{% block content %} +

    {{ _("Create") }} {{_("Tag") }}

    + {% include "tag/_create.html" %} +{% endblock %} \ No newline at end of file diff --git a/webapp/templates/tag/get.html b/webapp/templates/tag/get.html new file mode 100644 index 0000000..bd3732e --- /dev/null +++ b/webapp/templates/tag/get.html @@ -0,0 +1,12 @@ +{% extends "layout.html" %} + +{% block content %} + {{ _("list") }} +

    {% include "tag/_title.html" %}

    + + +{% endblock %} \ No newline at end of file diff --git a/webapp/templates/tag/list.html b/webapp/templates/tag/list.html new file mode 100644 index 0000000..d6a04fe --- /dev/null +++ b/webapp/templates/tag/list.html @@ -0,0 +1,10 @@ +{% extends "layout.html" %} + +{% block content %} +

    {{ _("Tags") }}

    + {% if current_user.is_authenticated %} + {{ _("Create") }} + {% endif %} +
    + {% include "tag/_list.html" %} +{% endblock %} \ No newline at end of file diff --git a/webapp/templates/tag/search.html b/webapp/templates/tag/search.html new file mode 100644 index 0000000..4d963b6 --- /dev/null +++ b/webapp/templates/tag/search.html @@ -0,0 +1,8 @@ +{% extends "layout.html" %} + +{% block content %} +

    {{ _("Search results for") }} {{ _("Tags") }}

    + {{ _("Create") }} +
    + {% include "tag/_search.html" %} +{% endblock %} \ No newline at end of file diff --git a/webapp/templates/tag/table.html b/webapp/templates/tag/table.html new file mode 100644 index 0000000..7ba99d8 --- /dev/null +++ b/webapp/templates/tag/table.html @@ -0,0 +1,8 @@ +{% extends "layout.html" %} + +{% block content %} +

    {{ _("Tags") }}

    + {{ _("Create") }} +
    + {% include "tag/_table.html" %} +{% endblock %} \ No newline at end of file diff --git a/webapp/templates/tag/update.html b/webapp/templates/tag/update.html new file mode 100644 index 0000000..8796ee8 --- /dev/null +++ b/webapp/templates/tag/update.html @@ -0,0 +1,6 @@ +{% extends "layout.html" %} + +{% block content %} +

    {{ _("Edit") }} {% include "tag/_title.html" %}

    + {% include "tag/_update.html" %} +{% endblock %} \ No newline at end of file diff --git a/webapp/view_models/BlogPost.yaml b/webapp/view_models/BlogPost.yaml index e581d10..2c745fa 100644 --- a/webapp/view_models/BlogPost.yaml +++ b/webapp/view_models/BlogPost.yaml @@ -21,6 +21,9 @@ columns: - name: title - name: body type: long_text + - name: tag + type: relationship + multiple: yes - name: created_dt - name: updated_dt display: diff --git a/webapp/view_models/Tag.yaml b/webapp/view_models/Tag.yaml new file mode 100644 index 0000000..b8e0b51 --- /dev/null +++ b/webapp/view_models/Tag.yaml @@ -0,0 +1,20 @@ +name: Tag +interits: + - Ownable +access: + - verb: all + login_required: true + roles_required: + - admin + - verb: get + login_required: false + - verb: list + login_required: false + - verb: table + login_required: false + - verb: search + login_required: false +columns: + - name: name +display: + primary: name \ No newline at end of file