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