2022-09-13 13:14:49 +00:00
{% extends 'forum/master.twig' %}
{% from 'macros.twig' import avatar %}
{% from 'forum/macros.twig' import forum_header %}
{% from '_layout/input.twig' import input_hidden , input_csrf , input_text , input_button , input_select , input_checkbox %}
{% set title = 'Posting' %}
{% set is_reply = posting_topic is defined %}
2023-08-28 01:17:34 +00:00
{% set is_opening = not is_reply or posting_post .isOriginalPost | default ( false ) %}
2022-09-13 13:14:49 +00:00
{% block content %}
2023-03-09 21:05:37 +00:00
<form method="post" action=" {{ url ( 'forum-' ~ ( is_reply ? 'post' : 'topic' ) ~ '-create' ) }} " class="js-forum-posting">
2023-08-28 01:17:34 +00:00
{{ input_hidden ( 'post[' ~ ( is_reply ? 'topic' : 'forum' ) ~ ']' , is_reply ? posting_topic .id : posting_forum .id ) }}
2022-09-13 13:14:49 +00:00
{{ input_hidden ( 'post[mode]' , posting_mode ) }}
{{ input_csrf ( ) }}
{{ forum_header (
is_reply and not is_opening
2023-08-28 01:17:34 +00:00
? posting_topic.title
2022-09-13 13:14:49 +00:00
: input_text(
'post[title]',
'forum__header__input',
2023-08-28 01:17:34 +00:00
posting_defaults.title|default(posting_topic.title|default('')),
2022-09-13 13:14:49 +00:00
'text',
'Enter your title here...'
),
posting_breadcrumbs,
false,
is_reply and not is_opening
2023-08-28 01:17:34 +00:00
? url('forum-topic', { 'topic': posting_topic.id})
2022-09-13 13:14:49 +00:00
: ''
) }}
{% if posting_post is defined %}
2023-08-28 01:17:34 +00:00
{{ input_hidden ( 'post[id]' , posting_post .info .id ) }}
2022-09-13 13:14:49 +00:00
{% endif %}
{% if posting_notices | length > 0 %}
<div class="warning">
<div class="warning__content">
{% for notice in posting_notices %}
<p> {{ notice }} </p>
{% endfor %}
</div>
</div>
{% endif %}
2023-08-28 01:17:34 +00:00
<div class="container forum__post" style=" {{ posting_post .colour | default ( posting_user_colour ) | html_colour ( '--accent-colour' ) }} ">
2022-09-13 13:14:49 +00:00
<div class="forum__post__info">
<div class="forum__post__info__background"></div>
<div class="forum__post__info__content">
2023-08-28 01:17:34 +00:00
<span class="forum__post__avatar"> {{ avatar ( posting_post .user .id | default ( posting_user .id ) , 1 2 0 , posting_post .user .name | default ( posting_user .name ) ) }} </span>
2022-09-13 13:14:49 +00:00
2023-08-28 01:17:34 +00:00
<span class="forum__post__username"> {{ posting_post .user .name | default ( posting_user .name ) }} </span>
2022-09-13 13:14:49 +00:00
<div class="forum__post__icons">
2023-08-28 01:17:34 +00:00
<div class="flag flag-- {{ posting_post .user .countryCode | default ( posting_user .countryCode ) | lower }} " title=" {{ posting_post .user .countryCode | default ( posting_user .countryCode ) | country_name }} "></div>
<div class="forum__post__posts-count"> {{ posting_post .postsCount | default ( posting_user_posts_count ) | number_format }} posts</div>
2022-09-13 13:14:49 +00:00
</div>
<div class="forum__post__joined">
2023-08-28 01:17:34 +00:00
joined <time datetime=" {{ posting_post .user .createdTime | default ( posting_user .createdTime ) | date ( 'c' ) }} " title=" {{ posting_post .user .createdTime | default ( posting_user .createdTime ) | date ( 'r' ) }} "> {{ posting_post .user .createdTime | default ( posting_user .createdTime ) | time_format }} </time>
2022-09-13 13:14:49 +00:00
</div>
</div>
</div>
<div class="forum__post__content">
<div class="forum__post__details">
<span class="forum__post__mode js-forum-posting-mode">
{% if posting_post is defined %}
Editing
{% elseif is_reply %}
Replying
{% else %}
Creating
{% endif %}
</span>
</div>
2023-08-28 01:17:34 +00:00
<textarea name="post[text]" class="forum__post__text forum__post__text--edit js-forum-posting-text js-ctrl-enter-submit" placeholder="Type your post content here..."> {{ posting_defaults .text | default ( posting_post .info .body | default ( '' ) ) }} </textarea>
2022-09-13 13:14:49 +00:00
<div class="forum__post__text js-forum-posting-preview" hidden></div>
<div class="forum__post__actions forum__post__actions--bbcode" hidden>
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-bold" title="Bold [b]<text>[/b]" data-tag-open="[b]" data-tag-close="[/b]">
<i class="fas fa-bold fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-italic" title="Italic [i]<text>[/i]" data-tag-open="[i]" data-tag-close="[/i]">
<i class="fas fa-italic fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-underline" title="Underline [u]<text>[/u]" data-tag-open="[u]" data-tag-close="[/u]">
<i class="fas fa-underline fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-strike" title="Strikethrough [s]<text>[/s]" data-tag-open="[s]" data-tag-close="[/s]">
<i class="fas fa-strikethrough fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-link" title="Link [url]<url>[/url] or [url=<url>]<text>[/url]" data-tag-open="[url=]" data-tag-close="[/url]">
<i class="fas fa-link fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-image" title="Image [img]<url>[/img]" data-tag-open="[img]" data-tag-close="[/img]">
<i class="fas fa-image fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-audio" title="Audio [audio]<url>[/url]" data-tag-open="[audio]" data-tag-close="[/audio]">
<i class="fas fa-music fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-video" title="Video [video]<url>[/video]" data-tag-open="[video]" data-tag-close="[/video]">
<i class="fas fa-video fa-fw"></i>
</div>
2023-03-09 16:27:43 +00:00
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-code" title="Code [code]<code>[/code]" data-tag-open="[code]" data-tag-close="[/code]">
<i class="fas fa-code fa-fw"></i>
</div>
2022-09-13 13:14:49 +00:00
<div class="forum__post__action forum__post__action--tag forum__post__action--bb-zalgo" title="Zalgo [zalgo]<text>[/zalgo]" data-tag-open="[zalgo]" data-tag-close="[/zalgo]">
<i class="fas fa-frog fa-fw"></i>
</div>
</div>
<div class="forum__post__actions forum__post__actions--markdown" hidden>
<div class="forum__post__action forum__post__action--tag forum__post__action--md-bold" title="Bold **<text>**" data-tag-open="**" data-tag-close="**">
<i class="fas fa-bold fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--md-italic" title="Italic *<text>* or _<text>_" data-tag-open="*" data-tag-close="*">
<i class="fas fa-italic fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--md-underline" title="Underline __<text>__" data-tag-open="__" data-tag-close="__">
<i class="fas fa-underline fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--md-strike" title="Strikethrough ~~<text>~~" data-tag-open="~~" data-tag-close="~~">
<i class="fas fa-strikethrough fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--md-link" title="Link [<text>](<url>)" data-tag-open="[](" data-tag-close=")">
<i class="fas fa-link fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--md-image" title="Image ![<alt text>](<url>)" data-tag-open="![](" data-tag-close=")">
<i class="fas fa-image fa-fw"></i>
</div>
2023-03-09 16:27:43 +00:00
<div class="forum__post__action forum__post__action--tag forum__post__action--md-audio" title="Audio ![<alt text>](<url>)" data-tag-open="![](" data-tag-close=")">
<i class="fas fa-music fa-fw"></i>
</div>
<div class="forum__post__action forum__post__action--tag forum__post__action--md-video" title="Video ![<alt text>](<url>)" data-tag-open="![](" data-tag-close=")">
<i class="fas fa-video fa-fw"></i>
</div>
2022-09-13 13:14:49 +00:00
<div class="forum__post__action forum__post__action--tag forum__post__action--md-code" title="Code `<code>` or ```<code>```" data-tag-open="```" data-tag-close="```">
<i class="fas fa-code fa-fw"></i>
</div>
</div>
<div class="forum__post__options">
<div class="forum__post__settings">
{{ input_select (
'post[parser]',
constant('\\Misuzu\\Parsers\\Parser::NAMES'),
2023-08-28 01:17:34 +00:00
posting_defaults.parser|default(posting_post.info.parser|default(posting_user_preferred_parser)),
2022-09-13 13:14:49 +00:00
null, null, false, 'forum__post__dropdown js-forum-posting-parser'
) }}
{% if is_opening and posting_types | length > 1 %}
2023-08-28 01:17:34 +00:00
<select class="input__select forum__post__dropdown" name="post[type]">
{% for type_name , type_title in posting_types %}
2023-08-28 01:41:13 +00:00
<option value=" {{ type_name }} " {% if type_name == posting_topic .typeString | default ( 'discussion' ) %} selected {% endif %} > {{ type_title }} </option>
2023-08-28 01:17:34 +00:00
{% endfor %}
</select>
2022-09-13 13:14:49 +00:00
{% endif %}
{{ input_checkbox (
'post[signature]',
'Display Signature',
posting_defaults.signature is not null
? posting_defaults.signature : (
2023-08-28 01:17:34 +00:00
posting_post.info.shouldDisplaySignature is defined
? posting_post.info.shouldDisplaySignature
2022-09-13 13:14:49 +00:00
: true
)
) }}
</div>
<div class="forum__post__buttons js-forum-posting-buttons">
<button class="input__button" onclick="forumPostingCloseOK = true;">Submit</button>
</div>
</div>
</div>
</div>
</form>
2023-03-09 21:05:37 +00:00
{% if globals .eeprom .path is not empty %}
<script type="text/javascript">
const peepPath = ' {{ globals .eeprom .path }} ', peepApp = ' {{ globals .eeprom .app }} ';
</script>
{% endif %}
2022-09-13 13:14:49 +00:00
{% endblock %}