This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/templates/components/user-stream-item.hbs
minusfive cdcc5d6174 Extracted/DRYed user-stream-item component CSS from user.css into own files
- Renamed 'stream-item' component to 'user-stream-item'
- Replaced generic 'item' class with clearer 'user-stream-item' class
- Retained 'item' class for backward compatibility, marked as 'DEPRECATED'
- Extracted CSS pertaining 'user-stream-item' component to component CSS files
- Removed unnecessary duplication from 'user-stream-item' CSS
- Removed unnecessary nesting from 'user-stream-item' CSS
2017-08-25 08:38:27 -07:00

43 lines
1.9 KiB
Handlebars

<div class='clearfix info'>
<a href={{item.userUrl}} data-user-card={{item.username}} class='avatar-link'><div class='avatar-wrapper'>{{avatar item imageSize="large" extraClasses="actor" ignoreTitle="true"}}</div></a>
<span class='time'>{{format-date item.created_at}}</span>
{{expand-post item=item}}
{{topic-status topic=item disableActions=true}}
<span class="title">
<a href={{item.postUrl}}>{{{item.title}}}</a>
</span>
<div class="category">{{category-link item.category}}</div>
{{#if item.deleted_by}}
<span class="delete-info">
{{d-icon "trash-o"}}
{{avatar item.deleted_by imageSize="tiny" extraClasses="actor" ignoreTitle="true"}}
{{format-date item.deleted_at leaveAgo="true"}}
</span>
{{/if}}
{{plugin-outlet name="user-stream-item-header" args=(hash item=item)}}
</div>
{{#if actionDescription}}
<p class='excerpt'>{{actionDescription}}</p>
{{/if}}
<p class='excerpt' data-topic-id="{{item.topic_id}}" data-post-id="{{item.post_id}}" data-user-id="{{item.user_id}}">{{{item.excerpt}}}</p>
{{#each item.children as |child|}}
<div class='user-stream-item-actions child-actions'>{{!-- DEPRECATED: 'child-actions' class --}}
{{d-icon child.icon class="icon"}}
{{#each child.items as |grandChild|}}
{{#if grandChild.removableBookmark}}
<button class="btn btn-default remove-bookmark" {{action removeBookmark grandChild}}>
{{d-icon 'times'}} {{i18n "bookmarks.remove"}}
</button>
{{else}}
<a href={{grandChild.userUrl}} data-user-card={{grandChild.username}} class='avatar-link'><div class='avatar-wrapper'>{{avatar grandChild imageSize="tiny" extraClasses="actor" ignoreTitle="true" avatarTemplatePath="acting_avatar_template"}}</div></a>
{{#if grandChild.edit_reason}} &mdash; <span class="edit-reason">{{grandChild.edit_reason}}</span>{{/if}}
{{/if}}
{{/each}}
</div>
{{/each}}