~homeworkprod/byceps

cfa40550ce5ca82acdc780d926a92b397c6d6f2d — Jochen Kupperschmidt 1 year, 1 month ago 6bf1030
Move board blueprint into `site` subpackage
33 files changed, 79 insertions(+), 79 deletions(-)

M byceps/application.py
M byceps/blueprints/admin/board/views.py
R byceps/blueprints/{board/__init__.py => site/board/__init__.py}
R byceps/blueprints/{board/_helpers.py => site/board/_helpers.py}
R byceps/blueprints/{board/authorization.py => site/board/authorization.py}
R byceps/blueprints/{board/blueprint.py => site/board/blueprint.py}
R byceps/blueprints/{board/forms.py => site/board/forms.py}
R byceps/blueprints/{board/models.py => site/board/models.py}
R byceps/blueprints/{board/service.py => site/board/service.py}
R byceps/blueprints/{board/templates/macros/board.html => site/board/templates/macros/board.html}
R byceps/blueprints/{board/templates/board/_posting_form_body_supplement.html => site/board/templates/site/board/_posting_form_body_supplement.html}
R byceps/blueprints/{board/templates/board/_posting_inline_create_form.html => site/board/templates/site/board/_posting_inline_create_form.html}
R byceps/blueprints/{board/templates/board/_posting_view.html => site/board/templates/site/board/_posting_view.html}
R byceps/blueprints/{board/templates/board/_posting_view_actions.html => site/board/templates/site/board/_posting_view_actions.html}
R byceps/blueprints/{board/templates/board/_posting_view_aside.html => site/board/templates/site/board/_posting_view_aside.html}
R byceps/blueprints/{board/templates/board/_posting_view_meta.html => site/board/templates/site/board/_posting_view_meta.html}
R byceps/blueprints/{board/templates/board/category_index.html => site/board/templates/site/board/category_index.html}
R byceps/blueprints/{board/templates/board/category_view.html => site/board/templates/site/board/category_view.html}
R byceps/blueprints/{board/templates/board/posting_create_form.html => site/board/templates/site/board/posting_create_form.html}
R byceps/blueprints/{board/templates/board/posting_moderate_form.html => site/board/templates/site/board/posting_moderate_form.html}
R byceps/blueprints/{board/templates/board/posting_update_form.html => site/board/templates/site/board/posting_update_form.html}
R byceps/blueprints/{board/templates/board/topic_create_form.html => site/board/templates/site/board/topic_create_form.html}
R byceps/blueprints/{board/templates/board/topic_index.html => site/board/templates/site/board/topic_index.html}
R byceps/blueprints/{board/templates/board/topic_moderate_form.html => site/board/templates/site/board/topic_moderate_form.html}
R byceps/blueprints/{board/templates/board/topic_update_form.html => site/board/templates/site/board/topic_update_form.html}
R byceps/blueprints/{board/templates/board/topic_view.html => site/board/templates/site/board/topic_view.html}
R byceps/blueprints/{board/views.py => site/board/views.py}
R byceps/blueprints/{board/views_category.py => site/board/views_category.py}
R byceps/blueprints/{board/views_posting.py => site/board/views_posting.py}
R byceps/blueprints/{board/views_topic.py => site/board/views_topic.py}
M byceps/services/board/models/__init__.py
M byceps/services/board/models/posting.py
M byceps/services/board/models/topic.py
M byceps/application.py => byceps/application.py +1 -1
@@ 112,7 112,7 @@ def _get_blueprints_common() -> Iterator[BlueprintReg]:
def _get_blueprints_site() -> Iterator[BlueprintReg]:
    yield from [
        ('site.attendance',             '/attendance'               ),
        ('board',                       '/board'                    ),
        ('site.board',                  '/board'                    ),
        ('consent',                     '/consent'                  ),
        ('news',                        '/news'                     ),
        ('newsletter',                  '/newsletter'               ),

M byceps/blueprints/admin/board/views.py => byceps/blueprints/admin/board/views.py +1 -1
@@ 26,7 26,7 @@ from ....util.views import redirect_to, respond_no_content

from ...authorization.decorators import permission_required
from ...authorization.registry import permission_registry
from ...board.authorization import BoardPermission
from ...site.board.authorization import BoardPermission

from .authorization import BoardCategoryPermission
from .forms import BoardCreateForm, CategoryCreateForm, CategoryUpdateForm

R byceps/blueprints/board/__init__.py => byceps/blueprints/site/board/__init__.py +0 -0
R byceps/blueprints/board/_helpers.py => byceps/blueprints/site/board/_helpers.py +4 -4
@@ 1,6 1,6 @@
"""
byceps.blueprints.board._helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board._helpers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.


@@ 8,13 8,13 @@ byceps.blueprints.board._helpers

from flask import abort, g, url_for

from ...services.board import (
from ....services.board import (
    access_control_service,
    category_query_service as board_category_query_service,
    posting_query_service as board_posting_query_service,
    topic_query_service as board_topic_query_service,
)
from ...services.site import service as site_service
from ....services.site import service as site_service


def get_board_id():

R byceps/blueprints/board/authorization.py => byceps/blueprints/site/board/authorization.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.authorization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.authorization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/board/blueprint.py => byceps/blueprints/site/board/blueprint.py +5 -5
@@ 1,15 1,15 @@
"""
byceps.blueprints.board.blueprint
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.blueprint
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""

from ...services.text_markup.service import render_html
from ...util.framework.blueprint import create_blueprint
from ....services.text_markup.service import render_html
from ....util.framework.blueprint import create_blueprint

from ..authorization.registry import permission_registry
from ...authorization.registry import permission_registry

from .authorization import (
    BoardPermission,

R byceps/blueprints/board/forms.py => byceps/blueprints/site/board/forms.py +3 -3
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.forms
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.


@@ 9,7 9,7 @@ byceps.blueprints.board.forms
from wtforms import StringField, TextAreaField
from wtforms.validators import InputRequired, Length

from ...util.l10n import LocalizedForm
from ....util.l10n import LocalizedForm


class PostingCreateForm(LocalizedForm):

R byceps/blueprints/board/models.py => byceps/blueprints/site/board/models.py +5 -5
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.


@@ 10,9 10,9 @@ from __future__ import annotations
from dataclasses import dataclass
from typing import Optional, Set

from ...services.board.transfer.models import CategoryWithLastUpdate
from ...services.user.transfer.models import User
from ...services.user_badge.transfer.models import Badge
from ....services.board.transfer.models import CategoryWithLastUpdate
from ....services.user.transfer.models import User
from ....services.user_badge.transfer.models import Badge


@dataclass(frozen=True)

R byceps/blueprints/board/service.py => byceps/blueprints/site/board/service.py +14 -14
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.service
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.


@@ 11,21 11,21 @@ from typing import Dict, Optional, Sequence, Set

from flask import g

from ...services.authentication.session.models.current_user import CurrentUser
from ...services.board.models.topic import Topic as DbTopic
from ...services.board.models.posting import Posting as DbPosting
from ...services.board import (
from ....services.authentication.session.models.current_user import CurrentUser
from ....services.board.models.topic import Topic as DbTopic
from ....services.board.models.posting import Posting as DbPosting
from ....services.board import (
    last_view_service as board_last_view_service,
    posting_query_service as board_posting_query_service,
)
from ...services.board.transfer.models import CategoryWithLastUpdate
from ...services.party import service as party_service
from ...services.site import settings_service as site_settings_service
from ...services.ticketing import ticket_service
from ...services.user import service as user_service
from ...services.user_badge import awarding_service as badge_awarding_service
from ...services.user_badge.transfer.models import Badge
from ...typing import BrandID, PartyID, UserID
from ....services.board.transfer.models import CategoryWithLastUpdate
from ....services.party import service as party_service
from ....services.site import settings_service as site_settings_service
from ....services.ticketing import ticket_service
from ....services.user import service as user_service
from ....services.user_badge import awarding_service as badge_awarding_service
from ....services.user_badge.transfer.models import Badge
from ....typing import BrandID, PartyID, UserID

from .models import CategoryWithLastUpdateAndUnseenFlag, Creator, Ticket


R byceps/blueprints/board/templates/macros/board.html => byceps/blueprints/site/board/templates/macros/board.html +0 -0
R byceps/blueprints/board/templates/board/_posting_form_body_supplement.html => byceps/blueprints/site/board/templates/site/board/_posting_form_body_supplement.html +0 -0
R byceps/blueprints/board/templates/board/_posting_inline_create_form.html => byceps/blueprints/site/board/templates/site/board/_posting_inline_create_form.html +1 -1
@@ 13,7 13,7 @@
          <fieldset>
            {{ form.body(class='collapsible collapsed wide', required='required') }}
            <div class="collapsible-neighbor">
            {%- include 'board/_posting_form_body_supplement.html' -%}
            {%- include 'site/board/_posting_form_body_supplement.html' -%}
            {{ form_buttons('Hinzufügen', cancel_button=True) }}
            </div>
          </fieldset>

R byceps/blueprints/board/templates/board/_posting_view.html => byceps/blueprints/site/board/templates/site/board/_posting_view.html +3 -3
@@ 4,12 4,12 @@

<article class="user-comment{% if posting.hidden %} dimmed{% endif %}" id="posting-{{ posting.id }}">
  <aside class="user-comment-aside">
{%- include 'board/_posting_view_aside.html' %}
{%- include 'site/board/_posting_view_aside.html' %}
  </aside>
  <div class="user-comment-main">
    <header>
{%- include 'board/_posting_view_meta.html' %}
{%- include 'board/_posting_view_actions.html' %}
{%- include 'site/board/_posting_view_meta.html' %}
{%- include 'site/board/_posting_view_actions.html' %}
    </header>
    <div class="body">
{{ posting.body|bbcode|safe }}

R byceps/blueprints/board/templates/board/_posting_view_actions.html => byceps/blueprints/site/board/templates/site/board/_posting_view_actions.html +0 -0
R byceps/blueprints/board/templates/board/_posting_view_aside.html => byceps/blueprints/site/board/templates/site/board/_posting_view_aside.html +0 -0
R byceps/blueprints/board/templates/board/_posting_view_meta.html => byceps/blueprints/site/board/templates/site/board/_posting_view_meta.html +0 -0
R byceps/blueprints/board/templates/board/category_index.html => byceps/blueprints/site/board/templates/site/board/category_index.html +0 -0
R byceps/blueprints/board/templates/board/category_view.html => byceps/blueprints/site/board/templates/site/board/category_view.html +0 -0
R byceps/blueprints/board/templates/board/posting_create_form.html => byceps/blueprints/site/board/templates/site/board/posting_create_form.html +1 -1
@@ 18,7 18,7 @@
  <form action="{{ url_for('.posting_create', topic_id=topic.id) }}" method="post">
    {%- call form_fieldset() %}
      {{ form_field(form.body, required='required', autofocus='autofocus') }}
      <li>{%- include 'board/_posting_form_body_supplement.html' %}</li>
      <li>{%- include 'site/board/_posting_form_body_supplement.html' %}</li>
    {%- endcall %}

    {{ form_buttons('Hinzufügen', cancel_url=url_for('.topic_view', topic_id=topic.id)) }}

R byceps/blueprints/board/templates/board/posting_moderate_form.html => byceps/blueprints/site/board/templates/site/board/posting_moderate_form.html +0 -0
R byceps/blueprints/board/templates/board/posting_update_form.html => byceps/blueprints/site/board/templates/site/board/posting_update_form.html +1 -1
@@ 23,7 23,7 @@
  <form action="{{ url_for('.posting_update', posting_id=posting.id) }}" method="post">
    {% call form_fieldset() %}
      {{ form_field(form.body, required='required', autofocus='autofocus') }}
      <li>{%- include 'board/_posting_form_body_supplement.html' %}</li>
      <li>{%- include 'site/board/_posting_form_body_supplement.html' %}</li>
    {% endcall %}

    {{ form_buttons('Speichern', cancel_url=url_for('.topic_view', topic_id=posting.topic.id)) }}

R byceps/blueprints/board/templates/board/topic_create_form.html => byceps/blueprints/site/board/templates/site/board/topic_create_form.html +1 -1
@@ 18,7 18,7 @@
    {%- call form_fieldset() %}
      {{ form_field(form.title, required='required', maxlength=80, autofocus='autofocus') }}
      {{ form_field(form.body, required='required') }}
      <li>{%- include 'board/_posting_form_body_supplement.html' %}</li>
      <li>{%- include 'site/board/_posting_form_body_supplement.html' %}</li>
    {%- endcall %}

    {{ form_buttons('Hinzufügen', cancel_url=url_for('.category_view', slug=category.slug)) }}

R byceps/blueprints/board/templates/board/topic_index.html => byceps/blueprints/site/board/templates/site/board/topic_index.html +0 -0
R byceps/blueprints/board/templates/board/topic_moderate_form.html => byceps/blueprints/site/board/templates/site/board/topic_moderate_form.html +0 -0
R byceps/blueprints/board/templates/board/topic_update_form.html => byceps/blueprints/site/board/templates/site/board/topic_update_form.html +1 -1
@@ 24,7 24,7 @@
    {% call form_fieldset() %}
      {{ form_field(form.title, required='required', maxlength=80, autofocus='autofocus') }}
      {{ form_field(form.body, required='required') }}
      <li>{%- include 'board/_posting_form_body_supplement.html' %}</li>
      <li>{%- include 'site/board/_posting_form_body_supplement.html' %}</li>
    {% endcall %}

    {{ form_buttons('Speichern', cancel_url=url_for('.topic_view', topic_id=topic.id)) }}

R byceps/blueprints/board/templates/board/topic_view.html => byceps/blueprints/site/board/templates/site/board/topic_view.html +2 -2
@@ 37,7 37,7 @@
  <div class="user-comments">

  {%- for posting in postings.items %}
{%- include 'board/_posting_view.html' %}
{%- include 'site/board/_posting_view.html' %}
  {%- endfor %}

  {%- if topic.posting_limited_to_moderators %}


@@ 67,7 67,7 @@
    <span class="button button--disabled">{{ render_icon('reply') }} <span>Antworten</span></span>
  </div>
  {%- elif is_last_page %}
{%- include 'board/_posting_inline_create_form.html' %}
{%- include 'site/board/_posting_inline_create_form.html' %}
  {%- else %}
  <div class="button-row button-row--right">
    <a class="button" href="{{ url_for('.posting_create_form', topic_id=topic.id) }}">{{ render_icon('reply') }} <span>Antworten</span></a>

R byceps/blueprints/board/views.py => byceps/blueprints/site/board/views.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.views
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

R byceps/blueprints/board/views_category.py => byceps/blueprints/site/board/views_category.py +6 -6
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.views_category
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.views_category
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.


@@ 8,14 8,14 @@ byceps.blueprints.board.views_category

from flask import abort, g, url_for

from ...services.board import (
from ....services.board import (
    category_query_service as board_category_query_service,
    last_view_service as board_last_view_service,
    topic_query_service as board_topic_query_service,
)
from ...util.framework.flash import flash_success
from ...util.framework.templating import templated
from ...util.views import respond_no_content_with_location
from ....util.framework.flash import flash_success
from ....util.framework.templating import templated
from ....util.views import respond_no_content_with_location

from .blueprint import blueprint
from . import _helpers as h, service

R byceps/blueprints/board/views_posting.py => byceps/blueprints/site/board/views_posting.py +11 -11
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.views_posting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.views_posting
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.


@@ 10,19 10,19 @@ import dataclasses

from flask import g, redirect, request

from ...services.board import (
from ....services.board import (
    last_view_service as board_last_view_service,
    posting_command_service as board_posting_command_service,
    posting_query_service as board_posting_query_service,
)
from ...services.text_markup.service import get_smileys
from ...services.user import service as user_service
from ...signals import board as board_signals
from ...util.framework.flash import flash_error, flash_success
from ...util.framework.templating import templated
from ...util.views import respond_no_content_with_location

from ..authorization.decorators import permission_required
from ....services.text_markup.service import get_smileys
from ....services.user import service as user_service
from ....signals import board as board_signals
from ....util.framework.flash import flash_error, flash_success
from ....util.framework.templating import templated
from ....util.views import respond_no_content_with_location

from ...authorization.decorators import permission_required

from .authorization import BoardPermission, BoardPostingPermission
from .blueprint import blueprint

R byceps/blueprints/board/views_topic.py => byceps/blueprints/site/board/views_topic.py +11 -11
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.views_topic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.views_topic
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.


@@ 10,21 10,21 @@ import dataclasses

from flask import abort, g, redirect, request

from ...services.board import (
from ....services.board import (
    category_query_service as board_category_query_service,
    last_view_service as board_last_view_service,
    posting_query_service as board_posting_query_service,
    topic_command_service as board_topic_command_service,
    topic_query_service as board_topic_query_service,
)
from ...services.text_markup.service import get_smileys
from ...services.user import service as user_service
from ...signals import board as board_signals
from ...util.framework.flash import flash_error, flash_success
from ...util.framework.templating import templated
from ...util.views import respond_no_content_with_location

from ..authorization.decorators import permission_required
from ....services.text_markup.service import get_smileys
from ....services.user import service as user_service
from ....signals import board as board_signals
from ....util.framework.flash import flash_error, flash_success
from ....util.framework.templating import templated
from ....util.views import respond_no_content_with_location

from ...authorization.decorators import permission_required

from .authorization import BoardPermission, BoardTopicPermission
from .blueprint import blueprint

M byceps/services/board/models/__init__.py => byceps/services/board/models/__init__.py +2 -2
@@ 1,6 1,6 @@
"""
byceps.blueprints.board.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
byceps.blueprints.site.board.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.

M byceps/services/board/models/posting.py => byceps/services/board/models/posting.py +1 -1
@@ 8,7 8,7 @@ byceps.services.board.models.posting

from datetime import datetime

from ....blueprints.board.authorization import (
from ....blueprints.site.board.authorization import (
    BoardPermission,
    BoardPostingPermission,
)

M byceps/services/board/models/topic.py => byceps/services/board/models/topic.py +1 -1
@@ 10,7 10,7 @@ from datetime import datetime

from sqlalchemy.ext.associationproxy import association_proxy

from ....blueprints.board.authorization import (
from ....blueprints.site.board.authorization import (
    BoardPermission,
    BoardTopicPermission,
)