Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented endorse post backend + Fixed Anon Refresh #34

Merged
merged 8 commits into from
Feb 26, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<div class="post-author d-flex align-items-center gap-1">
<a class="lh-1 text-decoration-none" href="{config.relative_path}/user/{./user.userslug}">{buildAvatar(./user, "16px", true, "not-responsive")}</a>
<a class="lh-1 fw-semibold" href="{config.relative_path}/user/{./user.userslug}">{../user.displayname}</a>
<a> Test! </a>
</div>
<span class="timeago text-muted lh-1" title="{./timestampISO}"></span>
</div>
Expand Down
27 changes: 20 additions & 7 deletions nodebb-theme-harmony/templates/partials/topic/post.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,42 @@
</div>
{{{ end }}}
<div class="d-flex align-items-start gap-3">


<div class="bg-body d-none d-sm-block rounded-circle" style="outline: 2px solid var(--bs-body-bg);">
<a class="d-inline-block position-relative text-decoration-none" href="{{{ if ./user.userslug }}}{config.relative_path}/user/{./user.userslug}{{{ else }}}#{{{ end }}}" aria-label="[[aria:user-avatar-for, {./user.username}]]">
{{{ if !posts.anonymous }}}
{buildAvatar(posts.user, "48px", true, "", "user/picture")}
<span component="user/status" class="position-absolute translate-middle-y border border-white border-2 rounded-circle status {posts.user.status}"><span class="visually-hidden">[[global:{posts.user.status}]]</span></span>
{{{ end }}}
</a>
</div>


<div class="post-container d-flex flex-grow-1 flex-column w-100" style="min-width:0;">
<div class="d-flex align-items-center gap-1 flex-wrap w-100 post-header mt-1" itemprop="author" itemscope itemtype="https://schema.org/Person">

<meta itemprop="name" content="{./user.username}">

{{{ if ./user.userslug }}}<meta itemprop="url" content="{config.relative_path}/user/{./user.userslug}">{{{ end }}}


<div class="bg-body d-sm-none">
<a class="d-inline-block position-relative text-decoration-none" href="{{{ if ./user.userslug }}}{config.relative_path}/user/{./user.userslug}{{{ else }}}#{{{ end }}}">
{{{ if !posts.anonymous }}}
{buildAvatar(posts.user, "20px", true, "", "user/picture")}
<span component="user/status" class="position-absolute translate-middle-y border border-white border-2 rounded-circle status {posts.user.status}"><span class="visually-hidden">[[global:{posts.user.status}]]</span></span>
{{{ end }}}
</a>
</div>


<!-- changes here -->

{{{if !posts.quickreplaycreator }}}
<a class="fw-bold text-nowrap" href="{{{ if ./user.userslug }}}{config.relative_path}/user/{./user.userslug}{{{ else }}}#{{{ end }}}" data-username="{posts.user.username}" data-uid="{posts.user.uid}">{posts.user.displayname}</a>

{{{ else }}}
<a class="fw-bold text-nowrap" href="{{{ if ./user.userslug }}}{config.relative_path}/user/{./user.userslug}{{{ else }}}#{{{ end }}}" data-username="{posts.user.username}" data-uid="{posts.user.uid}">{posts.quickreplaycreator}</a>

{{{ if posts.anonymous }}}
<span>ANONYMOUS</span>
{{{ else }}}
<a class="fw-bold text-nowrap" href="{{{ if ./user.userslug }}}{config.relative_path}/user/{./user.userslug}{{{ else }}}#{{{ end }}}" data-username="{posts.user.username}" data-uid="{posts.user.uid}">{posts.user.displayname}</a>
{{{ end }}}


Expand Down Expand Up @@ -67,6 +75,11 @@
</div>
{{{ end }}}
<div class="d-flex align-items-center gap-1 flex-grow-1 justify-content-end">
<a> Flag ID: {posts.flagId}</a>
{{{ if posts.flag }}}
<a> Test post </a>
{{{ end }}}

<span class="bookmarked opacity-0 text-primary"><i class="fa fa-bookmark-o"></i></span>
<a href="{config.relative_path}/post/{./pid}" class="post-index text-muted d-none d-md-inline">#{increment(./index, "1")}</a>
</div>
Expand Down Expand Up @@ -137,4 +150,4 @@
{widgets.mainpost-footer.html}
{{{ end }}}
</div>
{{{ end }}}
{{{ end }}}
1 change: 1 addition & 0 deletions public/language/en-GB/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@

"modal-title": "Report Content",
"modal-body": "Please specify your reason for flagging %1 %2 for review. Alternatively, use one of the quick report buttons if applicable.",
"modal-reason-new": "Endorsed by Admins",
"modal-reason-spam": "Spam",
"modal-reason-offensive": "Offensive",
"modal-reason-other": "Other (specify below)",
Expand Down
1 change: 1 addition & 0 deletions public/language/en-US/flags.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@

"modal-title": "Report Content",
"modal-body": "Please specify your reason for flagging %1 %2 for review. Alternatively, use one of the quick report buttons if applicable.",
"modal-reason-new": "Endorsed by Admins",
"modal-reason-spam": "Spam",
"modal-reason-offensive": "Offensive",
"modal-reason-other": "Other (specify below)",
Expand Down
6 changes: 6 additions & 0 deletions src/views/modals/flag.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
[[flags:modal-body, {type}, {id}]]
</p>
<div>
<div class="radio mb-2">
<label for="flag-reason-new">
<input type="radio" name="flag-reason" id="flag-reason-new" value="[[flags:modal-reason-new]]">
[[flags:modal-reason-new]]
</label>
</div>
<div class="radio mb-2">
<label for="flag-reason-spam">
<input type="radio" name="flag-reason" id="flag-reason-spam" value="[[flags:modal-reason-spam]]">
Expand Down
Loading