~homeworkprod/byceps

98694cc28f8df680da3a8e93f79595641058f02d — Jochen Kupperschmidt 1 year, 2 months ago fc529e7
Show if viewed news item version is current, link to current version if not
M byceps/blueprints/admin/news/templates/admin/news/item_view_version.html => byceps/blueprints/admin/news/templates/admin/news/item_view_version.html +9 -1
@@ 64,7 64,15 @@
      </tr>
      <tr>
        <th>Version:</th>
        <td>{{ version.id }}</td>
        <td>
          {{- version.id -}}
          {%- if is_current_version %}
          {{ render_tag('aktuell', class='color-success') }}
          {%- else %}
          {{ render_tag('veraltet', class='color-warning') }}<br>
          (<a href="{{ url_for('.item_view', item_id=item.id) }}">zur aktuellen Version</a>)
          {%- endif %}
        </td>
      </tr>
      <tr>
        <th>Erstellt:</th>

M byceps/blueprints/admin/news/views.py => byceps/blueprints/admin/news/views.py +4 -0
@@ 269,9 269,13 @@ def _render_item_version(version, item):
    channel = item.channel
    brand = brand_service.find_brand(channel.brand_id)

    current_version = news_item_service.get_current_item_version(item.id)
    is_current_version = version.id == current_version.id

    context = {
        'version': version,
        'brand': brand,
        'is_current_version': is_current_version,
    }

    try: