mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
blog: move to a seperate package
This commit is contained in:
18 files changed
+251
-253
No files matched your search
@@ -0,0 +1,65 @@
|
||||
{% extends "layout/basic.html" %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
<div class="section">
|
||||
<div class="section__body">
|
||||
<ul class="supplementary list">
|
||||
<li>
|
||||
<a class="discussion-node-tag" href="{{ url('blog_main', uid=udoc._id) }}">
|
||||
<span class="v-center icon icon-flag"></span>
|
||||
{{ _("{0}'s blog").format(udoc.uname) }}
|
||||
</a>
|
||||
</li>
|
||||
<li><h2>{{ ddoc.title }}</h2></li>
|
||||
<li>
|
||||
{{ user.render_inline(udoc) }}
|
||||
@
|
||||
{{ datetimeSpan(ddoc._id)|safe }}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="typo topic__content" data-emoji-enabled>
|
||||
{{ ddoc['content']|markdown|safe }}
|
||||
</div>
|
||||
</div>
|
||||
<ul class="section__footer supplementary dot list">
|
||||
{% 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>
|
||||
{% endif %}
|
||||
<li>{{ _('{0} views').format(ddoc.views) }}</li>
|
||||
{% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
|
||||
<li><form class="form--inline" method="post">
|
||||
<input type="hidden" name="operation" value="{% if not dsdoc['star'] %}star{% else %}unstar{% endif %}">
|
||||
<button class="star{% if dsdoc['star'] %} activated{% endif %}" type="submit">
|
||||
<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 %}
|
||||
<li><a href="{{ url('wiki_help', anchor='contact') }}">
|
||||
<span class="icon icon-warning"></span> {{ _('Report') }}
|
||||
</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="medium-3 columns">
|
||||
<div class="section side">
|
||||
<div class="profile__bg user-profile-bg--1"></div>
|
||||
<div class="section__body">
|
||||
<div class="media sidebar-user-profile">
|
||||
<div class="media__left">
|
||||
<img src="{{ avatarUrl(udoc.avatar, 80) }}" width="80" height="80" class="medium user-profile-avatar">
|
||||
</div>
|
||||
<div class="media__body">
|
||||
<p>
|
||||
{{ user.render_inline(udoc, avatar=false, modbadge=false) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,52 @@
|
||||
{% import "components/form.html" as form with context %}
|
||||
{% extends "layout/basic.html" %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
<div class="section">
|
||||
<div class="section__body">
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="medium-12 columns">
|
||||
<label>
|
||||
{{ _('Title') }}
|
||||
<input
|
||||
name="title" placeholder="{{ _('title') }}"
|
||||
value="{{ ddoc.title|default('') }}"
|
||||
class="textbox" autofocus>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{{ form.form_textarea({
|
||||
columns:12,
|
||||
label:'Content',
|
||||
name:'content',
|
||||
value:ddoc.content|default(''),
|
||||
hotkeys:'ctrl+enter:submit',
|
||||
markdown:true,
|
||||
required:true,
|
||||
extra_style:'height: 500px',
|
||||
extra_textarea_class:'auto-resize'
|
||||
}) }}
|
||||
<div class="row"><div class="columns">
|
||||
<button name="operation" value="{{ 'update' if ddoc else 'create' }}" data-default-submit type="submit" class="rounded primary button">
|
||||
{{ _('Update') if ddoc else _('Create') }} (Ctrl+Enter)
|
||||
</button>
|
||||
{% 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>
|
||||
{% endif %}
|
||||
<button type="button" class="rounded button" onclick="window.history.go(-1)">
|
||||
{{ _('Cancel') }}
|
||||
</button>
|
||||
</div></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="medium-3 columns">
|
||||
{% include 'components/md_hint.html' %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,51 @@
|
||||
{% import "components/nothing.html" as nothing with context %}
|
||||
{% import "components/user.html" as user with context %}
|
||||
{% import "components/paginator.html" as paginator with context %}
|
||||
{% extends "layout/basic.html" %}
|
||||
{% block content %}
|
||||
<div class="row">
|
||||
<div class="medium-9 columns">
|
||||
<div class="section">
|
||||
{% if not ddocs.length %}
|
||||
{{ nothing.render('no blog yet...') }}
|
||||
{% else %}
|
||||
<ol class="section__list discussion__list">
|
||||
{%- for ddoc in ddocs -%}
|
||||
<li class="section__list__item discussion__item">
|
||||
<div class="media">
|
||||
<div class="media__left">
|
||||
<div class="discussion__replies numbox">
|
||||
<div class="numbox__num large">{{ datetimeSpan(ddoc._id, false, 'D')|safe }}</div>
|
||||
<div class="numbox__text">{{ datetimeSpan(ddoc._id, false, 'YYYY-M')|safe }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="media__body top">
|
||||
<h1 class="discussion__title"><a href="{{ url('blog_detail', uid=udoc._id, did=ddoc._id, anchor=ddoc.updateAt.getTime()) }}" data-emoji-enabled>{{ ddoc['title'] }}</a></h1>
|
||||
<ul class="supplementary list">
|
||||
<li>{{ _('{0} views').format(ddoc.views) }}</li>
|
||||
<li>{{ datetimeSpan(ddoc.updateAt)|safe }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{%- endfor -%}
|
||||
</ol>
|
||||
{% if page and dpcount %}{{ paginator.render(page, dpcount) }}{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="medium-3 columns">
|
||||
<div class="section side">
|
||||
{% if udoc.blogpic %}<div class="discussion-node__bg {{ udoc.blogpic }}"></div>{% endif %}
|
||||
<div class="section__header">
|
||||
<h1 class="section__title">{{ _("{0}'s blog").format(udoc.uname) }}</h1>
|
||||
</div>
|
||||
<div class="section__body">
|
||||
{% 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>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
Reference in new issue
Block a user