mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 02:40:53 -06:00
ES6: All components ported over
This commit is contained in:
parent
80fd714b23
commit
bb0cf87684
@ -1,4 +1,4 @@
|
||||
Discourse.RadioButton = Ember.Component.extend({
|
||||
export default Ember.Component.extend({
|
||||
tagName : "input",
|
||||
type : "radio",
|
||||
attributeBindings : [ "name", "type", "value", "checked:checked" ],
|
||||
@ -7,7 +7,5 @@ Discourse.RadioButton = Ember.Component.extend({
|
||||
},
|
||||
checked : function() {
|
||||
return this.get("value") === this.get("selection");
|
||||
}.property('selection')
|
||||
}.property('selection'),
|
||||
});
|
||||
|
||||
Em.Handlebars.helper('radio-button', Discourse.RadioButton);
|
@ -6,7 +6,7 @@
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.SortableHeadingComponent = Ember.Component.extend({
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'th',
|
||||
classNameBindings: ['number:num', 'sortBy', 'iconSortClass:sorting', 'sortable:sortable'],
|
||||
attributeBindings: ['colspan'],
|
@ -6,7 +6,7 @@
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.ToggleSummaryComponent = Ember.Component.extend({
|
||||
export default Ember.Component.extend({
|
||||
layoutName: 'components/toggle-summary',
|
||||
tagName: 'section',
|
||||
classNames: ['information'],
|
@ -1,4 +1,4 @@
|
||||
Discourse.TopicParticipantComponent = Ember.Component.extend({
|
||||
export default Ember.Component.extend({
|
||||
|
||||
postStream: Em.computed.alias('participant.topic.postStream'),
|
||||
|
@ -6,7 +6,7 @@
|
||||
@namespace Discourse
|
||||
@module Discourse
|
||||
**/
|
||||
Discourse.TopicStatusComponent = Ember.Component.extend({
|
||||
export default Ember.Component.extend({
|
||||
classNames: ['topic-statuses'],
|
||||
|
||||
hasDisplayableStatus: Em.computed.or('topic.archived','topic.closed', 'topic.pinned', 'topic.unpinned', 'topic.invisible', 'topic.archetypeObject.notDefault'),
|
@ -1,4 +1,4 @@
|
||||
Discourse.UserBadgeComponent = Ember.Component.extend({
|
||||
export default Ember.Component.extend({
|
||||
tagName: 'span',
|
||||
|
||||
badgeTypeClassName: function() {
|
@ -22,7 +22,7 @@
|
||||
{{#groupedEach topic in topics}}
|
||||
<tr {{bind-attr class="archived"}}>
|
||||
<td class='main-link'>
|
||||
{{topicStatus topic=topic}}
|
||||
{{topic-status topic=topic}}
|
||||
<a class='title' href="{{unbound topic.lastUnreadUrl}}">{{{unbound topic.fancy_title}}}</a>
|
||||
{{#if unread}}
|
||||
<a href="{{unbound topic.lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unbound topic.unread}}</a>
|
||||
|
@ -55,7 +55,7 @@
|
||||
<td {{bind-attr class="archived :latest"}}>
|
||||
{{#each featuredTopics}}
|
||||
<div class="featured-topic">
|
||||
{{topicStatus topic=this}}
|
||||
{{topic-status topic=this}}
|
||||
<a class='title' href="{{unbound lastUnreadUrl}}">{{{unbound fancy_title}}}</a>
|
||||
{{#if unread}}
|
||||
<a href="{{unbound lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unread}}</a>
|
||||
|
@ -25,7 +25,7 @@
|
||||
<tr {{bind-attr class="archived"}}>
|
||||
<td class='main-link'>
|
||||
<div class='topic-inset'>
|
||||
{{topicStatus topic=this}}
|
||||
{{topic-status topic=this}}
|
||||
{{{topicLink this}}}
|
||||
|
||||
{{#if unread}}
|
||||
|
@ -18,7 +18,7 @@
|
||||
{{/if}}
|
||||
{{boundCategoryLink topic.category}}
|
||||
{{#if topic.details.loaded}}
|
||||
{{topicStatus topic=topic}}
|
||||
{{topic-status topic=topic}}
|
||||
<a class='topic-link' href='{{unbound topic.url}}' {{action jumpToTopPost}}>{{{topic.fancy_title}}}</a>
|
||||
{{else}}
|
||||
{{#if topic.errorLoading}}
|
||||
|
@ -11,7 +11,7 @@
|
||||
{{/if}}
|
||||
|
||||
<td class='main-link clearfix' {{bind-attr colspan="titleColSpan"}}>
|
||||
{{topicStatus topic=this.model}}
|
||||
{{topic-status topic=this.model}}
|
||||
{{{topicLink this}}}
|
||||
{{#if unread}}
|
||||
<a href="{{lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unread}}</a>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<tr {{bind-attr class="archived"}}>
|
||||
<td>
|
||||
<div class='main-link clearfix'>
|
||||
{{topicStatus topic=this}}
|
||||
{{topic-status topic=this}}
|
||||
{{{topicLink this}}}
|
||||
{{#if unread}}
|
||||
<a href="{{lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unread}}</a>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<td>
|
||||
<div class='main-link clearfix'>
|
||||
{{topicStatus topic=this}}
|
||||
{{topic-status topic=this}}
|
||||
{{{topicLink this}}}
|
||||
{{#if unread}}
|
||||
<a href="{{lastUnreadUrl}}" class='badge unread badge-notification' title='{{i18n topic.unread_posts count="unread"}}'>{{unread}}</a>
|
||||
|
@ -32,7 +32,7 @@
|
||||
{{/if}}
|
||||
{{boundCategoryLink category}}
|
||||
{{#if details.loaded}}
|
||||
{{topicStatus topic=model}}
|
||||
{{topic-status topic=model}}
|
||||
<a href='{{unbound url}}' {{action jumpTop}}>
|
||||
{{#if topicSaving}}
|
||||
{{fancy_title}}
|
||||
|
@ -9,6 +9,7 @@
|
||||
**/
|
||||
import PrivateMessageMapComponent from 'discourse/components/private-message-map';
|
||||
import TopicMapComponent from 'discourse/components/topic-map';
|
||||
import ToggleSummaryComponent from 'discourse/components/toggle-summary';
|
||||
|
||||
export default Discourse.ContainerView.extend({
|
||||
classNameBindings: ['hidden', ':topic-map'],
|
||||
@ -39,7 +40,7 @@ export default Discourse.ContainerView.extend({
|
||||
container.attachViewWithArgs({
|
||||
topic: topic,
|
||||
filterBinding: 'controller.filter'
|
||||
}, Discourse.ToggleSummaryComponent);
|
||||
}, ToggleSummaryComponent);
|
||||
}
|
||||
|
||||
// If we have a private message
|
||||
|
Loading…
Reference in New Issue
Block a user