github.com/Azareal/Gosora@v0.0.0-20210729070923-553e66b59003/templates/topic_inner.html (about)

     1  <main id="topicPage">
     2  
     3  {{if gt .Page 1}}<link rel="prev" href="{{.Topic.Link}}?page={{subtract .Page 1}}"/>
     4  <div id="prevFloat" class="prev_button"><a class="prev_link" aria-label="{{lang "paginator.prev_page_aria"}}" rel="prev"href="{{.Topic.Link}}?page={{subtract .Page 1}}">{{lang "paginator.less_than"}}</a></div>{{end}}
     5  
     6  {{if ne .LastPage .Page}}<link rel="prerender next" href="{{.Topic.Link}}?page={{add .Page 1}}"/>
     7  <div id="nextFloat" class="next_button">
     8  	<a class="next_link" aria-label="{{lang "paginator.next_page_aria"}}" rel="next"href="{{.Topic.Link}}?page={{add .Page 1}}">{{lang "paginator.greater_than"}}</a>
     9  </div>{{end}}
    10  {{if not .CurrentUser.Loggedin}}<link rel="canonical" href="//{{.Site.URL}}{{.Topic.Link}}{{if gt .Page 1}}?page={{.Page}}{{end}}"/>{{end}}
    11  
    12  <div {{scope "topic_title_block"}} class="rowblock rowhead topic_block" aria-label="{{lang "topic.topic_info_aria"}}">
    13  	<div class="rowitem topic_item{{if .Topic.Sticky}} topic_sticky_head{{else if .Topic.IsClosed}} topic_closed_head{{end}}">
    14  		<h1 class='topic_name hide_on_edit' title='{{.Topic.Title}}'>{{.Topic.Title}}</h1>
    15  		{{if .Topic.IsClosed}}<span class='username hide_on_micro topic_status_e topic_status_closed hide_on_edit' title='{{lang "status.closed_tooltip"}}' aria-label='{{lang "topic.status_closed_aria"}}'>&#x1F512;&#xFE0E</span>{{end}}
    16  		{{/** TODO: Does this need to be guarded by a permission? It's only visible in edit mode anyway, which can't be triggered, if they don't have the permission **/}}
    17  		{{if not .Topic.IsClosed or .CurrentUser.Perms.CloseTopic}}
    18  		{{if .CurrentUser.Perms.EditTopic}}
    19  		<form id="edit_topic_form" action='/topic/edit/submit/{{.Topic.ID}}?s={{.CurrentUser.Session}}' method="post"></form>
    20  		<input form='edit_topic_form' class='show_on_edit topic_name_input' name="topic_name" value='{{.Topic.Title}}' type="text" aria-label="{{lang "topic.title_input_aria"}}">
    21  		<button form='edit_topic_form' name="topic-button" class="formbutton show_on_edit submit_edit">{{lang "topic.update_button"}}</button>
    22  		{{end}}
    23  		{{end}}
    24  	</div>
    25  </div>
    26  {{if .Poll}}{{template "topic_poll.html" . }}{{end}}
    27  
    28  <article {{scope "opening_post"}} itemscope itemtype="http://schema.org/CreativeWork" class="rowblock post_container top_post" aria-label="{{lang "topic.opening_post_aria"}}">
    29  	<div class="rowitem passive editable_parent post_item {{.Topic.ClassName}}" style="background-image:url({{.Topic.Avatar}}),url(/s/{{.Header.Theme.Name}}/post-avatar-bg.jpg);background-position:0px {{if le .Topic.ContentLines 5}}-1{{end}}0px;background-repeat:no-repeat,repeat-y;">
    30  		<div class="hide_on_edit topic_content user_content"itemprop="text">{{.Topic.ContentHTML}}</div>
    31  		{{if .CurrentUser.Loggedin}}<textarea name="topic_content" class="show_on_edit topic_content_input edit_source">{{.Topic.Content}}</textarea>{{end}}
    32  
    33  		<span class="controls{{if .Topic.LikeCount}} has_likes{{end}}" aria-label="{{lang "topic.post_controls_aria"}}">
    34  
    35  		<a href="{{.Topic.UserLink}}"class="username real_username"rel="author">{{.Topic.CreatedByName}}</a>&nbsp;&nbsp;
    36  
    37  		{{if .CurrentUser.Loggedin}}
    38  		{{if .CurrentUser.Perms.LikeItem}}{{if ne .CurrentUser.ID .Topic.CreatedBy}}
    39  
    40  		{{if .Topic.Liked}}
    41  		<a href="/topic/unlike/submit/{{.Topic.ID}}?s={{.CurrentUser.Session}}" class="mod_button"title="{{lang "topic.unlike_tooltip"}}"aria-label="{{lang "topic.unlike_aria"}}">
    42  		<button class="username like_label remove_like"></button></a>{{else}}
    43  		<a href="/topic/like/submit/{{.Topic.ID}}?s={{.CurrentUser.Session}}" class="mod_button"title="{{lang "topic.like_tooltip"}}"aria-label="{{lang "topic.like_aria"}}">
    44  		<button class="username like_label add_like"></button></a>{{end}}
    45  		
    46  		{{end}}{{end}}
    47  
    48  		<a href=""class="mod_button quote_item"title="{{lang "topic.quote_tooltip"}}" aria-label="{{lang "topic.quote_aria"}}"><button class="username quote_label"></button></a>
    49  
    50  		{{if not .Topic.IsClosed or .CurrentUser.Perms.CloseTopic}}
    51  		{{if .CurrentUser.Perms.EditTopic}}<a href='/topic/edit/{{.Topic.ID}}' class="mod_button open_edit"title="{{lang "topic.edit_tooltip"}}" aria-label="{{lang "topic.edit_aria"}}"><button class="username edit_label"></button></a>{{end}}
    52  		{{end}}
    53  
    54  		{{if .Topic.Deletable}}<a href='/topic/delete/submit/{{.Topic.ID}}?s={{.CurrentUser.Session}}' class="mod_button"title="{{lang "topic.delete_tooltip"}}" aria-label="{{lang "topic.delete_aria"}}"><button class="username delete_label"></button></a>{{end}}
    55  
    56  		{{if .CurrentUser.Perms.CloseTopic}}{{if .Topic.IsClosed}}<a class="mod_button" href='/topic/unlock/submit/{{.Topic.ID}}?s={{.CurrentUser.Session}}'title="{{lang "topic.unlock_tooltip"}}" aria-label="{{lang "topic.unlock_aria"}}"><button class="username unlock_label"></button></a>{{else}}<a href='/topic/lock/submit/{{.Topic.ID}}?s={{.CurrentUser.Session}}' class="mod_button"title="{{lang "topic.lock_tooltip"}}" aria-label="{{lang "topic.lock_aria"}}"><button class="username lock_label"></button></a>{{end}}{{end}}
    57  
    58  		{{if .CurrentUser.Perms.PinTopic}}{{if .Topic.Sticky}}<a class="mod_button" href='/topic/unstick/submit/{{.Topic.ID}}?s={{.CurrentUser.Session}}'title="{{lang "topic.unpin_tooltip"}}" aria-label="{{lang "topic.unpin_aria"}}"><button class="username unpin_label"></button></a>{{else}}<a href='/topic/stick/submit/{{.Topic.ID}}?s={{.CurrentUser.Session}}' class="mod_button"title="{{lang "topic.pin_tooltip"}}" aria-label="{{lang "topic.pin_aria"}}"><button class="username pin_label"></button></a>{{end}}{{end}}
    59  		{{if .CurrentUser.Perms.ViewIPs}}<a class="mod_button"href='/users/ips/?ip={{.Topic.IP}}'title="{{lang "topic.ip_tooltip"}}" aria-label="The poster's IP is {{.Topic.IP}}"><button class="username ip_label"></button></a>{{end}}
    60  		{{end}}
    61  
    62  		<a href="/report/submit/{{.Topic.ID}}?s={{.CurrentUser.Session}}&type=topic" class="mod_button report_item"title="{{lang "topic.flag_tooltip"}}" aria-label="{{lang "topic.flag_aria"}}" rel="nofollow"><button class="username flag_label"></button></a>
    63  
    64  		<a class="username hide_on_micro like_count" aria-label="{{lang "topic.like_count_aria"}}">{{.Topic.LikeCount}}</a><a class="username hide_on_micro like_count_label" title="{{lang "topic.like_count_tooltip"}}"></a>
    65  
    66  		{{if .Topic.Tag}}<a class="username hide_on_micro user_tag">{{.Topic.Tag}}</a>{{else}}<a class="username hide_on_micro level" aria-label="{{lang "topic.level_aria"}}" title="{{lang "topic.level_tooltip"}}">{{level .Topic.Level}}</a><a class="username hide_on_micro level_label" title="{{lang "topic.level_tooltip"}}"></a>{{end}}
    67  
    68  		</span>
    69  	</div>
    70  </article>
    71  
    72  {{template "topic_posts.html" . }}
    73  
    74  {{if .CurrentUser.Perms.CreateReply}}
    75  {{if not .Topic.IsClosed or .CurrentUser.Perms.CloseTopic}}
    76  <div class="rowblock topic_reply_form quick_create_form" aria-label="{{lang "topic.reply_aria"}}">
    77  	<form id="quick_post_form" enctype="multipart/form-data" action="/reply/create/?s={{.CurrentUser.Session}}" method="post"></form>
    78  	<input form="quick_post_form" name="tid" value='{{.Topic.ID}}' type="hidden">
    79  	<input form="quick_post_form" id="has_poll_input" name="has_poll" value=0 type="hidden">
    80  	<div class="formrow real_first_child">
    81  		<div class="formitem">
    82  			<textarea id="input_content" form="quick_post_form" name="content" placeholder="{{lang "topic.reply_content"}}" required></textarea>
    83  		</div>
    84  	</div>
    85  	<div class="formrow poll_content_row auto_hide">
    86  		<div class="formitem">
    87  			<div class="pollinput" data-pollinput=0>
    88  				<input type="checkbox" disabled>
    89  				<label class="pollinputlabel"></label>
    90  				<input form="quick_post_form" name="pollinputitem[0]" class="pollinputinput" type="text" placeholder="{{lang "topic.reply_add_poll_option_first"}}">
    91  			</div>
    92  		</div>
    93  	</div>
    94  	<div class="formrow quick_button_row">
    95  		<div class="formitem">
    96  			<button form="quick_post_form" name="reply-button" class="formbutton">{{lang "topic.reply_button"}}</button>
    97  			<button form="quick_post_form" class="formbutton" id="add_poll_button">{{lang "topic.reply_add_poll_button"}}</button>
    98  			{{if .CurrentUser.Perms.UploadFiles}}
    99  			<input name="upload_files" form="quick_post_form" id="upload_files" multiple type="file" class="auto_hide">
   100  			<label for="upload_files" class="formbutton add_file_button">{{lang "topic.reply_add_file_button"}}</label>
   101  			<div id="upload_file_dock"></div>{{end}}
   102  		</div>
   103  	</div>
   104  </div>
   105  {{end}}
   106  {{end}}
   107  
   108  </main>