mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
添加功能:pretest discuss user dashboard statistics
This commit is contained in:
1 parent
61cba6f180
commit
15d43636c0
41 files changed
+920
-523
No files matched your search
@@ -1,6 +1,24 @@
|
||||
{% import "components/form.html" as form with context %}
|
||||
{% if ddoc['highlight'] or handler.hasPerm(perm.PERM_HIGHLIGHT_DISCUSSION) %}
|
||||
{{ form.form_checkbox(label='Highlight', name='highlight', value=ddoc['highlight']|default(false)) }}
|
||||
{% if ddoc.highlight or handler.hasPerm(perm.PERM_HIGHLIGHT_DISCUSSION) %}
|
||||
{{ form.form_checkbox({
|
||||
label:'Highlight',
|
||||
name:'highlight',
|
||||
value:ddoc.highlight|default(false))
|
||||
}) }}
|
||||
{% endif %}
|
||||
{{ form.form_text(label='Title', name='title', value=ddoc['title']|default(''), autofocus=true, required=true) }}
|
||||
{{ form.form_textarea(columns=12, label='Content', name='content', value=ddoc['content']|default(''), hotkeys='ctrl+enter:submit', markdown=true, required=true) }}
|
||||
{{ form.form_text({
|
||||
label:'Title',
|
||||
name:'title',
|
||||
value:ddoc.title|default(''),
|
||||
autofocus:true,
|
||||
required:true
|
||||
}) }}
|
||||
{{ form.form_textarea({
|
||||
columns:12,
|
||||
label:'Content',
|
||||
name:'content',
|
||||
value:ddoc.content|default(''),
|
||||
hotkeys:'ctrl+enter:submit',
|
||||
markdown:true,
|
||||
required:true
|
||||
}) }}
|
||||
@@ -1,46 +1,46 @@
|
||||
{% import "components/nothing.html" as nothing with context %}
|
||||
{% import "components/user.html" as user with context %}
|
||||
{% import "components/paginator.html" as paginator with context %}
|
||||
{% if not ddocs %}
|
||||
{{ nothing.render('no discussion yet...') }}
|
||||
{% else %}
|
||||
<ol class="section__list discussion__list">
|
||||
{% for ddoc in ddocs %}
|
||||
<li class="section__list__item discussion__item{% if ddoc['highlight'] %} highlight{% endif %}">
|
||||
<div class="media">
|
||||
<div class="media__left">
|
||||
<div class="discussion__replies numbox">
|
||||
<div class="numbox__num large">{{ ddoc['num_replies'] }}</div>
|
||||
<div class="numbox__text">{{ _('Comments') }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="media__body top">
|
||||
<h1 class="discussion__title"><a href="{{ reverse_url('discussion_detail', did=ddoc['doc_id']) }}#{{ handler.datetime_stamp(ddoc['update_at']) if ddoc['update_at'] else '' }}" data-emoji-enabled>{{ ddoc['title'] }}</a></h1>
|
||||
<ul class="supplementary list">
|
||||
<li>
|
||||
<a class="discussion-node-tag" href="{{ vj4.handler.discussion.node_url(handler, 'discussion_node', vj4.model.adaptor.discussion.node_id(ddoc)) }}">
|
||||
{% if ddoc['parent_doc_type'] == vj4.model.document.TYPE_DISCUSSION_NODE %}
|
||||
<span class="v-center icon icon-tag"></span>
|
||||
{% elif ddoc['parent_doc_type'] == vj4.model.document.TYPE_CONTEST %}
|
||||
<span class="v-center icon icon-award"></span>
|
||||
{% else %}
|
||||
<span class="v-center icon icon-flag"></span>
|
||||
{% endif %}
|
||||
{{ vndict[vj4.model.adaptor.discussion.node_id(ddoc)]['title']|default(_('(missing)')) }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ user.render_inline(udict[ddoc['owner']], badge=false) }}
|
||||
@
|
||||
{{ datetime_span(ddoc['update_at'] or ddoc['_id'].generationTime) }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if not ddocs.length %}
|
||||
{{ nothing.render('no discussion yet...') }}
|
||||
{% else %}
|
||||
<ol class="section__list discussion__list">
|
||||
{% for ddoc in ddocs %}
|
||||
<li class="section__list__item discussion__item{% if ddoc.highlight %} highlight{% endif %}">
|
||||
<div class="media">
|
||||
<div class="media__left">
|
||||
<div class="discussion__replies numbox">
|
||||
<div class="numbox__num large">{{ ddoc.nReply }}</div>
|
||||
<div class="numbox__text">{{ _('Comments') }}</div>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% if page != undefined and dpcount != undefined %}
|
||||
{{ paginator.render(page, dpcount) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="media__body top">
|
||||
<h1 class="discussion__title"><a href="/discuss/{{ ddoc._id }}#{{ handler.datetime_stamp(ddoc.updateAt) if ddoc.update_at else '' }}" data-emoji-enabled>{{ ddoc['title'] }}</a></h1>
|
||||
<ul class="supplementary list">
|
||||
<li>
|
||||
<a class="discussion-node-tag" href="/discuss/{{ ddoc.parentType }}/{{ ddoc.parentId }}">
|
||||
{% if ddoc.parentType == 'node' %}
|
||||
<span class="v-center icon icon-tag"></span>
|
||||
{% elif ddoc.parentType == 'contest' %}
|
||||
<span class="v-center icon icon-award"></span>
|
||||
{% else %}
|
||||
<span class="v-center icon icon-flag"></span>
|
||||
{% endif %}
|
||||
{{ vndict[ddoc.parentId].title|default(_('(missing)')) }}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ user.render_inline(udict[ddoc.owner], badge=false) }}
|
||||
@
|
||||
{{ datetime_span(ddoc.updateAt)|safe }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% if page != undefined and dpcount != undefined %}
|
||||
{{ paginator.render(page, dpcount) }}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
@@ -1,10 +1,10 @@
|
||||
<div data-fragment-id="problem_lucky">
|
||||
<p>
|
||||
<a href="/problem/random{% if category %}?category={{ category }}{% endif %}" class="expanded button" target="_blank">
|
||||
<span class="icon icon-feeling-lucky"></span> {{ _('Lucky') }}
|
||||
</a>
|
||||
</p>
|
||||
<div class="typo supplementary">
|
||||
<p>{{ _('Pick a problem randomly based on current filter') }}</p>
|
||||
</div>
|
||||
<p>
|
||||
<a href="/problem/random{% if category %}?category={{ category }}{% endif %}" class="expanded button" target="_blank">
|
||||
<span class="icon icon-feeling-lucky"></span> {{ _('Lucky') }}
|
||||
</a>
|
||||
</p>
|
||||
<div class="typo supplementary">
|
||||
<p>{{ _('Pick a problem randomly based on current filter') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,3 +1,3 @@
|
||||
<div class="section__body" data-fragment-id="problem_stat">
|
||||
<p>{{ _('{0} problems').format(pcount) }}</p>
|
||||
<p>{{ _('{0} problems').format(pcount) }}</p>
|
||||
</div>
|
||||
@@ -2,13 +2,13 @@
|
||||
{
|
||||
"_id": 1,
|
||||
"title": "最初的最初 - A+B Problem",
|
||||
"require_nids": [],
|
||||
"requireNids": [],
|
||||
"pids": [1000, "56c52ade2fefd90539000005"]
|
||||
},
|
||||
{
|
||||
"_id": 2,
|
||||
"title": "最初的进阶",
|
||||
"require_nids": [1],
|
||||
"requireNids": [1],
|
||||
"pids": [1001, 1002]
|
||||
}
|
||||
]
|
||||
Reference in new issue
Block a user