Skip to content

Commit

Permalink
REFACTOR: Update structure, fix for ember-cli (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomerobot committed Aug 10, 2021
1 parent b9c1b61 commit 0482a6c
Show file tree
Hide file tree
Showing 4 changed files with 87 additions and 95 deletions.
6 changes: 3 additions & 3 deletions desktop/desktop.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

.topic-list .badge-wrapper.bar {
.badge-category {
color: #9a9a9a !important;
color: var(--primary-medium) !important;
font-weight: 600;
font-size: 12px;
padding: 2px 6px;
Expand All @@ -109,6 +109,7 @@
.last-post {
.poster-avatar {
margin-right: 10px;
margin-top: 5px;
}
.poster-avatar,
.poster-info {
Expand All @@ -123,7 +124,7 @@
/* topic page */

nav.post-controls button.has-like {
color: #08c;
color: var(--tertiary);
}

.creator .badge-wrapper.bullet span.badge-category {
Expand All @@ -144,7 +145,6 @@ img.avatar {

.topic-list-item .discourse-tags {
font-size: 0.75em;
display: inline-block;
margin-left: 5px;
}

Expand Down
92 changes: 0 additions & 92 deletions desktop/header.html

This file was deleted.

67 changes: 67 additions & 0 deletions javascripts/discourse/templates/list/topic-list-item.hbr
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{{~raw-plugin-outlet name="topic-list-before-columns"}}

{{#if bulkSelectEnabled}}
<td class="bulk-select">
<label for="bulk-select-{{topic.id}}">
<input type="checkbox" class="bulk-select" id="bulk-select-{{topic.id}}">
</label>
</td>
{{/if}}

<td class='main-link clearfix'>
{{~raw-plugin-outlet name="topic-list-before-status"}}
{{raw "topic-status" topic=topic}}
{{~topic-link topic class="raw-link raw-topic-link"}}
{{~#if showTopicPostBadges}}
{{~raw "topic-post-badges" unreadPosts=topic.unread_posts unseen=topic.unseen url=topic.lastUnreadUrl newDotText=newDotText}}
{{~/if}}
{{discourse-tags topic mode="list" tagsForUser=tagsForUser}}
{{#if expandPinned}}
{{raw "list/topic-excerpt" topic=topic}}
{{/if}}
<div class='creator'>
{{#unless hideCategory}}
{{#unless topic.isPinnedUncategorized}}
{{category-link topic.category}}
{{/unless}}
{{/unless}}
{{~#if topic.creator ~}}
<a href="/users/{{topic.creator.username}}" data-auto-route="true" data-user-card="{{topic.creator.username}}">{{topic.creator.username}}</a> <a href={{topic.url}}>{{format-date topic.createdAt format="tiny"}}</a>
{{~/if ~}}
{{raw "list/action-list" topic=topic postNumbers=topic.liked_post_numbers className="likes" icon="heart"}}
</div>
</td>

{{#if showLikes}}
<td class="num likes">
{{#if hasLikes}}
<a href='{{topic.summaryUrl}}'>
{{number topic.like_count}} {{d-icon "heart"}}
</a>
{{/if}}
</td>
{{/if}}

{{#if showOpLikes}}
<td class="num likes">
{{#if hasOpLikes}}
<a href='{{topic.summaryUrl}}'>
{{number topic.op_like_count}} {{d-icon "heart"}}
</a>
{{/if}}
</td>
{{/if}}

{{raw "list/posts-count-column" topic=topic}}

<td class="last-post">
<div class='poster-avatar'>
<a href="{{topic.lastPostUrl}}" data-user-card="{{topic.last_poster_username}}">{{avatar topic.lastPosterUser imageSize="medium"}}</a>
</div>
<div class='poster-info'>
<a href="{{topic.lastPostUrl}}">
{{format-date topic.bumpedAt format="tiny"}}
</a>
<span class='editor'><a href="/users/{{topic.last_poster_username}}" data-auto-route="true" data-user-card="{{topic.last_poster_username}}">{{topic.last_poster_username}}</a></span>
</div>
</td>
17 changes: 17 additions & 0 deletions javascripts/discourse/templates/topic-list-header.hbr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{~raw-plugin-outlet name="topic-list-header-before"~}}
{{#if bulkSelectEnabled}}
<th class="bulk-select">
{{#if canBulkSelect}}
{{raw "flat-button" class="bulk-select" icon="list" title="topics.bulk.toggle"}}
{{/if}}
</th>
{{/if}}
{{raw "topic-list-header-column" order='default' name='topic.title' bulkSelectEnabled=bulkSelectEnabled showBulkToggle=toggleInTitle canBulkSelect=canBulkSelect}}
{{#if showLikes}}
{{raw "topic-list-header-column" sortable='true' order='likes' number='true' forceName=(theme-i18n 'likes')}}
{{/if}}
{{#if showOpLikes}}
{{raw "topic-list-header-column" sortable='true' order='op_likes' number='true' forceName=(theme-i18n 'likes')}}
{{/if}}
{{raw "topic-list-header-column" sortable='true' number='true' order='posts' forceName=(theme-i18n 'replies') }}
{{raw "topic-list-header-column" sortable='true' order='activity' forceName=(theme-i18n 'last_post')}}

0 comments on commit 0482a6c

Please sign in to comment.