-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtopic_question.tpl
executable file
·110 lines (89 loc) · 6.74 KB
/
topic_question.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{assign var="oBlog" value=$oTopic->getBlog()}
{assign var="oUser" value=$oTopic->getUser()}
{assign var="oVote" value=$oTopic->getVote()}
<div class="topic">
<h2 class="title">
{if $oTopic->getPublish()==0}
<img src="{cfg name='path.static.skin'}/images/draft.png" title="{$aLang.topic_unpublish}" alt="{$aLang.topic_unpublish}" />
{/if}
<a href="{$oTopic->getUrl()}" class="title-topic">{$oTopic->getTitle()|escape:'html'}</a>
</h2>
<p class="info-short">
{$aLang.topic_pub} <a href="{router page='archive'}{date_format format="Y" date=$oTopic->getDateAdd()}/{date_format format="m" date=$oTopic->getDateAdd()}/{date_format format="d" date=$oTopic->getDateAdd()}/" class="title-topic" title="{date_format date=$oTopic->getDateAdd() format="H:i"}">{date_format date=$oTopic->getDateAdd() format="j F Y"}</a> {$aLang.topic_by} <a href="{router page='my'}{$oUser->getLogin()}/">{$oUser->getLogin()}</a>
</p>
<ul class="actions">
{if $oUserCurrent and ($oUserCurrent->getId()==$oTopic->getUserId() or $oUserCurrent->isAdministrator() or $oBlog->getUserIsAdministrator() or $oBlog->getUserIsModerator() or $oBlog->getOwnerId()==$oUserCurrent->getId())}
<li><a href="{cfg name='path.root.web'}/{$oTopic->getType()}/edit/{$oTopic->getId()}/" title="{$aLang.topic_edit}" class="edit">{$aLang.topic_edit}</a></li>
{/if}
{if $oUserCurrent and ($oUserCurrent->isAdministrator() or $oBlog->getUserIsAdministrator() or $oBlog->getOwnerId()==$oUserCurrent->getId())}
<li><a href="{router page='topic'}delete/{$oTopic->getId()}/?security_ls_key={$LIVESTREET_SECURITY_KEY}" title="{$aLang.topic_delete}" onclick="return confirm('{$aLang.topic_delete_confirm}');" class="delete">{$aLang.topic_delete}</a></li>
{/if}
</ul>
<div class="content">
<div id="topic_question_area_{$oTopic->getId()}" class="poll">
{if !$oTopic->getUserQuestionIsVote()}
<ul class="poll-vote">
{foreach from=$oTopic->getQuestionAnswers() key=key item=aAnswer}
<li><label><input type="radio" id="topic_answer_{$oTopic->getId()}_{$key}" name="topic_answer_{$oTopic->getId()}" value="{$key}" onchange="$('#topic_answer_{$oTopic->getId()}_value').val($(this).val());" /> {$aAnswer.text|escape:'html'}</label></li>
{/foreach}
</ul>
<input type="submit" value="{$aLang.topic_question_vote}" onclick="ls.poll.vote({$oTopic->getId()},$('#topic_answer_{$oTopic->getId()}_value').val());" />
<input type="submit" value="{$aLang.topic_question_abstain}" onclick="ls.poll.vote({$oTopic->getId()},-1)" />
<input type="hidden" id="topic_answer_{$oTopic->getId()}_value" value="-1" />
<p class="poll-total">{$aLang.topic_question_vote_result}: {$oTopic->getQuestionCountVote()} | {$aLang.topic_question_abstain_result}: {$oTopic->getQuestionCountVoteAbstain()}</p>
{else}
<ul class="poll-result">
{foreach from=$oTopic->getQuestionAnswers() key=key item=aAnswer}
<li {if $oTopic->getQuestionAnswerMax()==$aAnswer.count}class="most"{/if}>
<dl>
<dt>
<strong>{$oTopic->getQuestionAnswerPercent($key)}%</strong><br />
<span>({$aAnswer.count})</span>
</dt>
<dd>{$aAnswer.text|escape:'html'}<div style="width: {$oTopic->getQuestionAnswerPercent($key)}%;" ></div></dd>
</dl>
</li>
{/foreach}
</ul>
<p class="poll-total">{$aLang.topic_question_vote_result}: {$oTopic->getQuestionCountVote()} | {$aLang.topic_question_abstain_result}: {$oTopic->getQuestionCountVoteAbstain()}</p>
{/if}
</div>
{if $bTopicList}
{$oTopic->getTextShort()}
{if $oTopic->getTextShort()!=$oTopic->getText()}
<a href="{$oTopic->getUrl()}#cut" title="{$aLang.topic_read_more}">
{if $oTopic->getCutText()}
{$oTopic->getCutText()}
{else}
{$aLang.topic_read_more}
{/if}
</a>
{/if}
{else}
{$oTopic->getText()}
{/if}
</div>
<div class="info">
{if $oBlog->getType()!='personal'}
{$aLang.topic_pub_in} <a href="{$oBlog->getUrlFull()}" class="title-blog">{$oBlog->getTitle()|escape:'html'}</a> |
{/if}
{$aLang.topic_tags}:
{foreach from=$oTopic->getTagsArray() item=sTag name=tags_list}
<a href="{router page='tag'}{$sTag|escape:'html'}/">{$sTag|escape:'html'}</a>{if !$smarty.foreach.tags_list.last}, {/if}
{/foreach}
{if !$tSingle}
| <span class="comments-link">
<a href="{$oTopic->getUrl()}#comments" title="{$aLang.topic_comment_read}">{$aLang.topic_comments}:
{if $oTopic->getCountComment()>0}
{$oTopic->getCountComment()} <span>{if $oTopic->getCountCommentNew()}+{$oTopic->getCountCommentNew()}{/if}</span>
{else}{$aLang.topic_comments_no}{/if}</a></span>
{/if}
{if $oTopic->getType()=='link'}
<a href="{router page='link'}go/{$oTopic->getId()}/" title="{$aLang.topic_link_count_jump} {$oTopic->getLinkCountJump()}" class="link">{$oTopic->getLinkUrl(true)}</a>
{/if}
{hook run='topic_show_info' topic=$oTopic}
</div>
{if !$bTopicList}
{hook run='topic_show_end' topic=$oTopic}
{/if}
</div>