Merge remote-tracking branch 'gsoc2016/Subtitle-1'
[mediagoblin.git] / mediagoblin / media_types / blog / templates / mediagoblin / blog / blog_admin_dashboard.html
CommitLineData
06aca6af
A
1{#
2# GNU MediaGoblin -- federated, autonomous media hosting
3# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
4#
5# This program is free software: you can redistribute it and/or modify
6# it under the terms of the GNU Affero General Public License as published by
7# the Free Software Foundation, either version 3 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU Affero General Public License for more details.
14#
15# You should have received a copy of the GNU Affero General Public License
16# along with this program. If not, see <http://www.gnu.org/licenses/>.
17#}
18
19{% extends "mediagoblin/base.html" %}
8762609f 20{% from "mediagoblin/utils/pagination.html" import render_pagination %}
06aca6af
A
21
22{% block title -%}
23{{blog.title}} Dashboard &mdash; {{ super() }}
24{%- endblock title %}
25
e70fcc00
A
26{% block mediagoblin_head%}
27<style type = "text/css">
28 td > a { text-decoration:none; font-weight: bold; }
29</style>
30{% endblock %}
31
32
06aca6af 33{% block mediagoblin_content %}
a46c23e0 34<h1 style="text-transform:capitalize"> {{blog.title}}</h1>
06aca6af 35<p>
a46c23e0
AM
36 {{blog.description|safe}}
37</p>
47b0c316 38<p>
a46c23e0
AM
39 {% set blogpost_create_url = request.urlgen('mediagoblin.media_types.blog.blogpost.create',
40 blog_slug=blog.slug,
ec1d5a4e
A
41 user=request.user.username) %}
42<a class="button_action" href="{{ blogpost_create_url }}">
9a5f8b37
A
43{%- trans %}Add Blog Post{% endtrans -%}
44</a>
47b0c316 45&middot;
a46c23e0
AM
46 {% set blog_edit_url = request.urlgen('mediagoblin.media_types.blog.edit',
47 blog_slug=blog.slug,
ec1d5a4e
A
48 user=request.user.username) %}
49<a class="button_action" href="{{ blog_edit_url }}">
47b0c316 50{%- trans %}Edit Blog{% endtrans -%}
3357b8a3
AM
51</a>
52&middot;
a46c23e0
AM
53 {% set blog_delete_url = request.urlgen('mediagoblin.media_types.blog.blog_delete',
54 blog_slug=blog.slug,
3357b8a3 55 user=request.user.username) %}
12c0872b 56<a class="button_action button_warning" href="{{ blog_delete_url }}">
3357b8a3 57{%- trans %}Delete Blog{% endtrans -%}
47b0c316
A
58</a>
59</p>
06aca6af 60<h2> Blog Post Entries </h2>
8762609f 61 {% if blog_posts_list.count() %}
06aca6af
A
62 <table class="media_panel processing">
63 <tr>
06aca6af
A
64 <th>Title</th>
65 <th>submitted</th>
ec1d5a4e 66 <th></th>
06aca6af
A
67 </tr>
68 {% for blog_post in blog_posts_list %}
69 <tr>
d6a456b5
A
70 {% if blog_post.state == 'processed' %}
71 <td><a href="{{ blog_post.url_for_self(request.urlgen) }}">{{ blog_post.title }}</a></td>
72 {% else %}
a46c23e0
AM
73 {% set draft_url = request.urlgen('mediagoblin.media_types.blog.blogpost_draft_view',
74 blog_slug=blog.slug, user=request.user.username,
d6a456b5
A
75 blog_post_slug=blog_post.slug) %}
76 <td><a href="{{ draft_url }}">{{ blog_post.title }}</a></td>
77 {% endif %}
06aca6af 78 <td>{{ blog_post.created.strftime("%F %R") }}</td>
a46c23e0 79
d6a456b5
A
80 {% if blog_post.state == 'processed' %}
81 <td><h6><em>Published</em></h6></td>
82 {% else %}
83 <td><h6><em>Draft</em></h6></td>
84 {% endif %}
a46c23e0
AM
85 {% set blogpost_edit_url = request.urlgen('mediagoblin.media_types.blog.blogpost.edit',
86 blog_slug=blog.slug, user=request.user.username,
2e9f60d2 87 blog_post_slug=blog_post.slug) %}
2a5f2690 88 {% set blogpost_delete_url = request.urlgen('mediagoblin.user_pages.media_confirm_delete',
beb5a4a1 89 user= blog_post.get_actor.username,
2a5f2690
A
90 media_id=blog_post.id) %}
91 <td>
92 <a class="button_action" href="{{ blogpost_edit_url }}">{% trans %}Edit{% endtrans %}</a>
12c0872b 93 <a class="button_action button_warning" href="{{ blogpost_delete_url }}">{% trans %}Delete{% endtrans %}</a>
47b0c316 94 </td>
06aca6af
A
95 </tr>
96 {% endfor %}
a46c23e0 97 </table>
f793af64
AM
98 {% set blogpost_listing_url = request.urlgen('mediagoblin.media_types.blog.blog_post_listing',
99 blog_slug=blog_slug, user=user.username) %}
100 <br/>
101 <br/>
8189f6c7 102 <a href="{{ blogpost_listing_url}}">{% trans %}<em> Go to list view </em>{% endtrans %}</a>
06aca6af
A
103 {% else %}
104 {% trans %} No blog post yet. {% endtrans %}
105 {% endif %}
8762609f 106 {{ render_pagination(request, pagination) }}
06aca6af 107{% endblock %}
a46c23e0 108
06aca6af
A
109
110