discourse-legacysite-perl/site/forum/include_post_display_infobar.html
2024-06-17 22:24:05 +10:00

94 lines
5.3 KiB
HTML

<div id="post_info_<%post_id || 'preview'%>" class="post-info<%if post_user_is_moderator%> moderator<%endif%><%loop user_groups%> ug-<%if group_id == $config.id_group_guest%>guest<%elsif group_id == $config.id_group_moderator%>moderator<%elsif group_id == $config.id_group_not_validated%>not-validated<%elsif group_id == $config.id_group_registered%>registered<%else%><%group_id%><%endif%><%endloop%>">
<div class="username">
<%~set include_username_display = $post_username%>
<%~include include_username.html~%>
</div>
<%~if post_anonymous_email%>
<div class="anonymous-email">
<a href="mailto:<%post_anonymous_email%>"><%post_anonymous_email%></a>
</div>
<%~endif%>
<div class="post-date">
<%post_date%>
</div>
<div class="post-num">
<%~if this_do eq post_view_flat or this_do eq post_view_printable%>
<a href="<%GForum::SEO::url(params => "post=$post_id#p$post_id")%>">Post #<%post_num%> of <%num_posts%></a>
<%~endif%>
<%if post_views or post_views eq 0%>
<span class="post-views">
<%if this_do eq post_view_flat%>(<%post_views%> views)<%else%>Views: <%post_views%><%endif%>
</span>
<%endif%>
</div>
<%-- Moderator/Administrator functionality --%>
<%~if user_perm_moderator and not preview and not hide_post_menu%>
<div class="moderator-controls">
<%~if post_ip%>
<div class="ip"><label>IP:</label> <a href="<%GForum::SEO::url(params => "do=ip_summary;ip=$post_ip")%>" title="View IP summary for <%post_ip%>"><%post_ip%></a></div>
<%~endif%>
<div class="ban">
<label>Ban:</label>
<%~if user_status != $ADMINISTRATOR and user_status != $ANONYMOUS%>
<%~set url_param_username = escape_url unescape_html $user_username%>
<a href="<%GForum::SEO::url(params => "do=forum_preban;forum=$forum_id;ban_type=user_id_fk;ban_value=$user_id;ban_username=$url_param_username")%>" title="Ban user from this forum">User</a>
<span class="sep">|</span>
<%~endif%>
<a href="<%GForum::SEO::url(params => "do=forum_preban;forum=$forum_id;ban_type=ban_ip;ban_value=$post_ip")%>" title="Ban IP address from this forum">IP</a>
<%~if current.user_status == 3%><%-- An administrator --%>
<span class="sep">|</span>
<a href="<%GForum::SEO::url(params => "do=ban_ip;redo=$this_do;post=$post_id;ip=$post_ip$hidden_sort$hidden_page")%>" title="Ban IP address from <%site_title%>" rel="post-only">Site IP</a>
<%~endif%>
</div>
<%~if current.user_status == $ADMINISTRATOR and user_status != $ADMINISTRATOR and user_status != $ANONYMOUS%>
<%~if user_enabled%>
<div class="enable-disable disable">
<label>Disable:</label>
<a href="<%GForum::SEO::url(params => "do=disable_user;user_id=$user_id;redo=$this_do;post=$post_id$hidden_sort$hidden_page")%>" title="Disable user's account" rel="post-only">User</a>
</div>
<%~else%>
<div class="enable-disable enable">
<label>Enable:</label>
<a href="<%GForum::SEO::url(params => "do=enable_user;user_id=$user_id;redo=$this_do;post=$post_id$hidden_sort$hidden_page")%>" title="User is currently disabled &mdash; Reenable user's account" rel="post-only">User</a>
</div>
<%~endif%>
<%~endif%>
<%~set url_param_root_id = $post_root_id || $post_id%>
<div class="thread">
<label>Thread:</label>
<%~set url_param_keep = ""%>
<%~if post_keep%><%~set url_param_keep = "un"%><%endif%>
<a href="<%GForum::SEO::url(params => "do=post_${url_param_keep}keep;root_id=$url_param_root_id;redo=$this_do;post=$post_id$hidden_sort")%>" title="<%if post_keep%>Allow thread to be<%else%>Keep thread from being<%endif%> deleted when deleting old posts" rel="post-only"><%if post_keep%>Unkeep<%else%>Keep<%endif%></a>
<span class="sep">|</span>
<%~set url_param_lock = ""%>
<%~if post_locked%><%~set url_param_lock = "un"%><%endif%>
<a href="<%GForum::SEO::url(params => "do=post_${url_param_lock}lock;root_id=$url_param_root_id;redo=$this_do;post=$post_id$hidden_sort")%>" title="<%if post_locked%>Unlock thread (allows new replies)<%else%>Lock thread (prevents further replies)<%endif%>" rel="post-only"><%if post_locked%>Unlock<%else%>Lock<%endif%></a>
<span class="sep sep1">|</span>
<a href="<%GForum::SEO::url(params => "do=post_move_select;root_id=$url_param_root_id")%>" title="Move this thread to another forum">Move</a>
<span class="sep">|</span>
<%~set url_param_sticky = ""%>
<%~if post_sticky%><%~set url_param_sticky = "un"%><%endif%>
<a href="<%GForum::SEO::url(params => "do=post_${url_param_sticky}stick;root_id=$url_param_root_id;redo=$this_do;post=$post_id$hidden_sort")%>" title="<%if post_sticky%>Unstick this thread (stops showing up before other threads)<%else%>Make this thread sticky (show up before other threads)<%endif%>" rel="post-only"><%if post_sticky%>Unstick<%else%>Stick<%endif%></a>
<span class="sep">|</span>
<a href="<%GForum::SEO::url(params => "do=threadtag;thread=$url_param_root_id")%>">Tag This Thread</a>
</div>
<%~if post_root_id%>
<div class="detach-move">
<label>Post:</label>
<a href="<%GForum::SEO::url(params => "do=post_detach_select;redo=$this_do;post_id=$post_id")%>" title="Make this a new thread in this or another forum">Detach &amp; Move</a>
</div>
<%~endif%>
</div>
<%~endif%>
</div>