core: feat: blog

This commit is contained in:
undefined committed 2021-12-19 20:55:48 +08:00
1 parent f43c1bc8c9
commit 79aca189d1
10 files changed
+36 -31

No files matched your search

@@ -13,7 +13,7 @@
</li>
<li><h2>{{ ddoc.title }}</h2></li>
<li>
{{ user.render_inline(udict[ddoc.owner]) }}
{{ user.render_inline(udoc) }}
@
{{ datetimeSpan(ddoc._id)|safe }}
</li>
@@ -23,7 +23,7 @@
</div>
</div>
<ul class="section__footer supplementary dot list">
{% if handler.user.hasPerm(perm.PERM_EDIT_DISCUSSION) or (handler.user.own(ddoc) and handler.user.hasPerm(perm.PERM_EDIT_DISCUSSION_SELF)) %}
{% if handler.user.hasPriv(PRIV.PRIV_EDIT_SYSTEM) or handler.user.own(ddoc) %}
<li><a href="{{ url('blog_edit', uid=udoc._id, did=ddoc.docId) }}">
<span class="icon icon-edit"></span> {{ _('Edit') }}
</a></li>
@@ -34,8 +34,8 @@
<input type="hidden" name="operation" value="{% if not dsdoc['star'] %}star{% else %}unstar{% endif %}">
<input type="hidden" name="csrfToken" value="{{ handler.csrfToken }}">
<button class="star{% if dsdoc['star'] %} activated{% endif %}" type="submit">
<span class="starred--hide"><span class="icon icon-star--outline"></span> {{ _('Star Topic') }}</span>
<span class="starred--show"><span class="icon icon-star"></span> {{ _('Unstar Topic') }}</span>
<span class="starred--hide"><span class="icon icon-star--outline"></span> {{ _('Star') }}</span>
<span class="starred--show"><span class="icon icon-star"></span> {{ _('Unstar') }}</span>
</button>
</form></li>
{% endif %}
+1 -1
View File
@@ -32,7 +32,7 @@
<button name="operation" value="{{ 'update' if ddoc else 'create' }}" type="submit" class="rounded primary button">
{{ _('Update') if ddoc else _('Create') }} (Ctrl+Enter)
</button>
{% if ddoc and (handler.user.own(ddoc) or handler.user.hasPerm(perm.PERM_DELETE_DISCUSSION)) %}
{% if ddoc and (handler.user.hasPriv(PRIV.PRIV_EDIT_SYSTEM) or handler.user.own(ddoc)) %}
<button name="operation" value="delete" type="submit" class="rounded button">
{{ _('Delete') }}
</button>
+2 -2
View File
@@ -41,8 +41,8 @@
<h1 class="section__title">{{ _("{0}'s blog").format(udoc.uname) }}</h1>
</div>
<div class="section__body">
{% if handler.user.hasPerm(perm.PERM_CREATE_DISCUSSION) and handler.user._id == udoc._id %}
<p><a href="{{ url('blog_create', uid=udoc._id) }}" class="expanded primary button">{{ _('Create a Post') }}</a></p>
{% if handler.user._id == udoc._id %}
<p><a href="{{ url('blog_create', uid=udoc._id) }}" class="expanded primary button">{{ _('Create a Post') }}</a></p>
{% endif %}
</div>
</div>
@@ -71,13 +71,19 @@
</a>
</li>
{% if handler.user.hasPriv(PRIV.PRIV_CREATE_FILE) %}
<li class="menu__seperator"></li>
<li class="menu__item">
<a href="{{ url('home_files') }}" class="menu__link">
<span class="icon icon-file"></span> {{ _('My Files') }}
</a>
</li>
{% endif %}
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) and model.system.get('server.blog') %}
<li class="menu__item">
<a href="{{ url('blog_main', uid=handler.user._id) }}" class="menu__link">
<span class="icon icon-book"></span> {{ _('Blog') }}
</a>
</li>
{% endif %}
<li class="menu__seperator"></li>
{% if handler.user.hasPriv(PRIV.PRIV_EDIT_SYSTEM) %}
<li class="menu__item nojs--hide">