Skip to content

Commit

Permalink
Creating the urgent button next to the urgent posts (#81)
Browse files Browse the repository at this point in the history
* In this commit I implented the isResolved button that is placed next to the posted posts to check if the post is reolved or not

* In this commit I implented the isResolved button that is placed next to the posted posts, to check if the post is reolved or not

* In this commit i Have added the urgent button in the topic section so the student can click if the topic is urgent

* In this commit I have added the commit symbol to indicate if a button is an urgent button

* In this commit I have added the commit symbol to indicate if a button is an urgent button

* Update post.tpl

I noticed there were issues with the feature, thus some edits were made. 

Signed-off-by: mbfannan <[email protected]>

---------

Signed-off-by: LujainAlMansoori <[email protected]>
Signed-off-by: mbfannan <[email protected]>
Co-authored-by: LujainAlMansoori <[email protected]>
Co-authored-by: mbfannan <[email protected]>
  • Loading branch information
3 people authored Oct 4, 2023
1 parent 18cc399 commit 8327f91
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 12 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 26 additions & 12 deletions themes/nodebb-theme-persona/templates/partials/topic/post.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,16 @@ document.addEventListener('DOMContentLoaded', function() {
</script>

<div class="clearfix post-header">

<div style="background-color: red; color: white; text-align: center; padding: 10px; font-size: 20px; font-weight: bold;">
THIS POST IS URGENT
<h2 style="text-align: center;">
⚠️
</h2>
</div>

<!-- IF !privileges.isAdminOrMod -->

<!-- IF (!isAnonymous || posts.selfPost) -->
<div class="icon pull-left">
<a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->">
Expand All @@ -48,7 +57,16 @@ document.addEventListener('DOMContentLoaded', function() {
<!-- ENDIF !posts.selfPost -->
<!-- ENDIF isAnonymous -->

<button id="resolveButton" style="color: white; float: right;" component="post/resolve" class="btn btn-primary btn-sm no-select">Mark as Resolved</button>
<!-- IF posts.selfPost -->
<button id="resolveButton"
style="color: white;
float: right;"
component="post/resolve"
class="btn btn-primary btn-sm no-select">Mark as Resolved</button>

<!-- ENDIF posts.selfPost -->



<!-- IF posts.selfPost -->
<strong>
Expand All @@ -57,7 +75,6 @@ document.addEventListener('DOMContentLoaded', function() {
<!-- ENDIF posts.selfPost -->






Expand All @@ -73,17 +90,19 @@ document.addEventListener('DOMContentLoaded', function() {


<!-- IF privileges.isAdminOrMod -->
<div class="icon pull-left">


<button id="resolveButton"
style="color: white;
float: right;"
component="post/resolve"
class="btn btn-primary btn-sm no-select">Mark as Resolved</button>

<div class="icon pull-left">
<a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->">
{buildAvatar(posts.user, "sm2x", true, "", "user/picture")}
<i component="user/status" class="fa fa-circle status {posts.user.status}" title="[[global:{posts.user.status}]]"></i>
</a>
</div>
<strong>

<a href="<!-- IF posts.user.userslug -->{config.relative_path}/user/{posts.user.userslug}<!-- ELSE -->#<!-- ENDIF posts.user.userslug -->" itemprop="author" data-username="{posts.user.username}" data-uid="{posts.user.uid}">{posts.user.displayname}</a>
</strong>
<!-- ENDIF privileges.isAdminOrMod -->
Expand Down Expand Up @@ -142,14 +161,11 @@ document.addEventListener('DOMContentLoaded', function() {
</div>

<div class="post-footer">


{{{ if posts.user.signature }}}
<div component="post/signature" data-uid="{posts.user.uid}" class="post-signature">{posts.user.signature}</div>
{{{ end }}}

<div class="clearfix">

{{{ if !hideReplies }}}
<a component="post/reply-count" data-target-component="post/replies/container" href="#" class="threaded-replies no-select pull-left {{{ if !posts.replies.count }}}hidden{{{ end }}}">
<span component="post/reply-count/avatars" class="avatars {{{ if posts.replies.hasMore }}}hasMore{{{ end }}}">
Expand All @@ -170,8 +186,6 @@ document.addEventListener('DOMContentLoaded', function() {
<small class="pull-right">
<!-- IMPORT partials/topic/reactions.tpl -->
<span class="post-tools">


<a component="post/reply" href="#" class="no-select <!-- IF !privileges.topics:reply -->hidden<!-- ENDIF !privileges.topics:reply -->">[[topic:reply]]</a>
<a component="post/quote" href="#" class="no-select <!-- IF !privileges.topics:reply -->hidden<!-- ENDIF !privileges.topics:reply -->">[[topic:quote]]</a>
</span>
Expand All @@ -196,4 +210,4 @@ document.addEventListener('DOMContentLoaded', function() {
</small>
</div>
<div component="post/replies/container"></div>
</div>
</div>

0 comments on commit 8327f91

Please sign in to comment.