mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 03:06:53 +08:00
Migrate createViewWithBodyClass
helper to components
This commit is contained in:
45
app/assets/javascripts/discourse/components/d-section.js.es6
Normal file
45
app/assets/javascripts/discourse/components/d-section.js.es6
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
|
// Can add a body class from within a component, also will scroll to the top automatically.
|
||||||
|
export default Ember.Component.extend({
|
||||||
|
tagName: 'section',
|
||||||
|
|
||||||
|
_scrollTop() {
|
||||||
|
if (Ember.testing) { return; }
|
||||||
|
$(document).scrollTop(0);
|
||||||
|
},
|
||||||
|
|
||||||
|
didInsertElement() {
|
||||||
|
this._super();
|
||||||
|
|
||||||
|
const pageClass = this.get('pageClass');
|
||||||
|
if (pageClass) {
|
||||||
|
$('body').addClass(`${pageClass}-page`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const bodyClass = this.get('bodyClass');
|
||||||
|
if (bodyClass) {
|
||||||
|
$('body').addClass(bodyClass);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.get('scrollTop') === "false") {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DiscourseURL.isJumpScheduled()) { return; }
|
||||||
|
Ember.run.scheduleOnce('afterRender', this, this._scrollTop);
|
||||||
|
},
|
||||||
|
|
||||||
|
willDestroyElement() {
|
||||||
|
this._super();
|
||||||
|
const pageClass = this.get('pageClass');
|
||||||
|
if (pageClass) {
|
||||||
|
$('body').removeClass(`${pageClass}-page`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const bodyClass = this.get('bodyClass');
|
||||||
|
if (bodyClass) {
|
||||||
|
$('body').removeClass(bodyClass);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
@ -1,15 +0,0 @@
|
|||||||
import { on } from 'ember-addons/ember-computed-decorators';
|
|
||||||
|
|
||||||
export function createViewWithBodyClass(body_class) {
|
|
||||||
return Ember.View.extend({
|
|
||||||
@on("didInsertElement")
|
|
||||||
addBodyClass() {
|
|
||||||
$('body').addClass(body_class);
|
|
||||||
},
|
|
||||||
|
|
||||||
@on("willDestroyElement")
|
|
||||||
removeBodyClass() {
|
|
||||||
$('body').removeClass(body_class);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
@ -1,97 +1,99 @@
|
|||||||
<div class='container'>
|
{{#d-section pageClass="about"}}
|
||||||
<div class='contents clearfix body-page'>
|
<div class='container'>
|
||||||
|
<div class='contents clearfix body-page'>
|
||||||
|
|
||||||
<ul class="nav-pills">
|
<ul class="nav-pills">
|
||||||
<li class="nav-item-about">{{#link-to 'about' class="active"}}{{i18n 'about.simple_title'}}{{/link-to}}</li>
|
<li class="nav-item-about">{{#link-to 'about' class="active"}}{{i18n 'about.simple_title'}}{{/link-to}}</li>
|
||||||
{{#if faqOverriden}}
|
{{#if faqOverriden}}
|
||||||
<li class="nav-item-guidelines">{{#link-to 'guidelines'}}{{i18n 'guidelines'}}{{/link-to}}</li>
|
<li class="nav-item-guidelines">{{#link-to 'guidelines'}}{{i18n 'guidelines'}}{{/link-to}}</li>
|
||||||
<li class="nav-item-faq">{{#link-to 'faq'}}{{i18n 'faq'}}{{/link-to}}</li>
|
<li class="nav-item-faq">{{#link-to 'faq'}}{{i18n 'faq'}}{{/link-to}}</li>
|
||||||
{{else}}
|
{{else}}
|
||||||
<li class="nav-item-faq">{{#link-to 'faq'}}{{i18n 'faq'}}{{/link-to}}</li>
|
<li class="nav-item-faq">{{#link-to 'faq'}}{{i18n 'faq'}}{{/link-to}}</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<li class="nav-item-tos">{{#link-to 'tos'}}{{i18n 'terms_of_service'}}{{/link-to}}</li>
|
<li class="nav-item-tos">{{#link-to 'tos'}}{{i18n 'terms_of_service'}}{{/link-to}}</li>
|
||||||
<li class="nav-item-privacy">{{#link-to 'privacy'}}{{i18n 'privacy'}}{{/link-to}}</li>
|
<li class="nav-item-privacy">{{#link-to 'privacy'}}{{i18n 'privacy'}}{{/link-to}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<section class='about'>
|
|
||||||
<h2>{{i18n 'about.title' title=model.title}}</h2>
|
|
||||||
<p>{{model.description}}</p>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{{#if model.admins}}
|
|
||||||
<section class='about admins'>
|
|
||||||
<h3>{{i18n 'about.our_admins'}}</h3>
|
|
||||||
|
|
||||||
{{#each model.admins as |a|}}
|
|
||||||
{{user-info user=a}}
|
|
||||||
{{/each}}
|
|
||||||
<div class='clearfix'></div>
|
|
||||||
|
|
||||||
|
<section class='about'>
|
||||||
|
<h2>{{i18n 'about.title' title=model.title}}</h2>
|
||||||
|
<p>{{model.description}}</p>
|
||||||
</section>
|
</section>
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if model.moderators}}
|
{{#if model.admins}}
|
||||||
<section class='about moderators'>
|
<section class='about admins'>
|
||||||
<h3>{{i18n 'about.our_moderators'}}</h3>
|
<h3>{{i18n 'about.our_admins'}}</h3>
|
||||||
|
|
||||||
<div class='users'>
|
{{#each model.admins as |a|}}
|
||||||
{{#each model.moderators as |m|}}
|
{{user-info user=a}}
|
||||||
{{user-info user=m}}
|
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
<div class='clearfix'></div>
|
||||||
<div class='clearfix'></div>
|
|
||||||
|
</section>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if model.moderators}}
|
||||||
|
<section class='about moderators'>
|
||||||
|
<h3>{{i18n 'about.our_moderators'}}</h3>
|
||||||
|
|
||||||
|
<div class='users'>
|
||||||
|
{{#each model.moderators as |m|}}
|
||||||
|
{{user-info user=m}}
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
<div class='clearfix'></div>
|
||||||
|
</section>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<section class='about stats'>
|
||||||
|
<h3>{{i18n 'about.stats'}}</h3>
|
||||||
|
|
||||||
|
<table class='table'>
|
||||||
|
<tr>
|
||||||
|
<th> </th>
|
||||||
|
<th>{{i18n 'about.stat.all_time'}}</th>
|
||||||
|
<th>{{i18n 'about.stat.last_7_days'}}</th>
|
||||||
|
<th>{{i18n 'about.stat.last_30_days'}}</th>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class='title'>{{i18n 'about.topic_count'}}</td>
|
||||||
|
<td>{{number model.stats.topic_count}}</td>
|
||||||
|
<td>{{number model.stats.topics_7_days}}</td>
|
||||||
|
<td>{{number model.stats.topics_30_days}}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{{i18n 'about.post_count'}}</td>
|
||||||
|
<td>{{number model.stats.post_count}}</td>
|
||||||
|
<td>{{number model.stats.posts_7_days}}</td>
|
||||||
|
<td>{{number model.stats.posts_30_days}}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{{i18n 'about.user_count'}}</td>
|
||||||
|
<td>{{number model.stats.user_count}}</td>
|
||||||
|
<td>{{number model.stats.users_7_days}}</td>
|
||||||
|
<td>{{number model.stats.users_30_days}}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{{i18n 'about.active_user_count'}}</td>
|
||||||
|
<td>—</td>
|
||||||
|
<td>{{number model.stats.active_users_7_days}}</td>
|
||||||
|
<td>{{number model.stats.active_users_30_days}}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>{{i18n 'about.like_count'}}</td>
|
||||||
|
<td>{{number model.stats.like_count}}</td>
|
||||||
|
<td>{{number model.stats.likes_7_days}}</td>
|
||||||
|
<td>{{number model.stats.likes_30_days}}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
</section>
|
</section>
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
<section class='about stats'>
|
{{#if contactInfo}}
|
||||||
<h3>{{i18n 'about.stats'}}</h3>
|
<section class='about contact'>
|
||||||
|
<h3>{{i18n 'about.contact'}}</h3>
|
||||||
<table class='table'>
|
<p>{{{contactInfo}}}</p>
|
||||||
<tr>
|
</section>
|
||||||
<th> </th>
|
{{/if}}
|
||||||
<th>{{i18n 'about.stat.all_time'}}</th>
|
|
||||||
<th>{{i18n 'about.stat.last_7_days'}}</th>
|
|
||||||
<th>{{i18n 'about.stat.last_30_days'}}</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td class='title'>{{i18n 'about.topic_count'}}</td>
|
|
||||||
<td>{{number model.stats.topic_count}}</td>
|
|
||||||
<td>{{number model.stats.topics_7_days}}</td>
|
|
||||||
<td>{{number model.stats.topics_30_days}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{{i18n 'about.post_count'}}</td>
|
|
||||||
<td>{{number model.stats.post_count}}</td>
|
|
||||||
<td>{{number model.stats.posts_7_days}}</td>
|
|
||||||
<td>{{number model.stats.posts_30_days}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{{i18n 'about.user_count'}}</td>
|
|
||||||
<td>{{number model.stats.user_count}}</td>
|
|
||||||
<td>{{number model.stats.users_7_days}}</td>
|
|
||||||
<td>{{number model.stats.users_30_days}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{{i18n 'about.active_user_count'}}</td>
|
|
||||||
<td>—</td>
|
|
||||||
<td>{{number model.stats.active_users_7_days}}</td>
|
|
||||||
<td>{{number model.stats.active_users_30_days}}</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>{{i18n 'about.like_count'}}</td>
|
|
||||||
<td>{{number model.stats.like_count}}</td>
|
|
||||||
<td>{{number model.stats.likes_7_days}}</td>
|
|
||||||
<td>{{number model.stats.likes_30_days}}</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
{{#if contactInfo}}
|
|
||||||
<section class='about contact'>
|
|
||||||
<h3>{{i18n 'about.contact'}}</h3>
|
|
||||||
<p>{{{contactInfo}}}</p>
|
|
||||||
</section>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{/d-section}}
|
||||||
|
@ -1,17 +1,19 @@
|
|||||||
<div class='container badges'>
|
{{#d-section pageClass="badges"}}
|
||||||
<h1>{{i18n 'badges.title'}}</h1>
|
<div class='container badges'>
|
||||||
|
<h1>{{i18n 'badges.title'}}</h1>
|
||||||
|
|
||||||
<div class='badge-groups'>
|
<div class='badge-groups'>
|
||||||
{{#each badgeGroups as |bg|}}
|
{{#each badgeGroups as |bg|}}
|
||||||
<div class='badge-grouping'>
|
<div class='badge-grouping'>
|
||||||
<div class='title'>
|
<div class='title'>
|
||||||
<h3>{{bg.badgeGrouping.displayName}}</h3>
|
<h3>{{bg.badgeGrouping.displayName}}</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#each bg.badges as |b|}}
|
||||||
|
{{badge-card badge=b navigateOnClick="true"}}
|
||||||
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
{{/each}}
|
||||||
{{#each bg.badges as |b|}}
|
</div>
|
||||||
{{badge-card badge=b navigateOnClick="true"}}
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{/d-section}}
|
||||||
|
@ -1,132 +1,134 @@
|
|||||||
<div class="search row clearfix">
|
{{#d-section pageClass="search" class="search-container"}}
|
||||||
{{search-text-field value=searchTerm class="full-page-search input-xxlarge search no-blur" action="search" hasAutofocus=hasAutofocus}}
|
<div class="search row clearfix">
|
||||||
{{d-button action="search" icon="search" class="btn-primary" disabled=searching}}
|
{{search-text-field value=searchTerm class="full-page-search input-xxlarge search no-blur" action="search" hasAutofocus=hasAutofocus}}
|
||||||
|
{{d-button action="search" icon="search" class="btn-primary" disabled=searching}}
|
||||||
|
|
||||||
<div class='search-advanced'>
|
<div class='search-advanced'>
|
||||||
<button class="search-advanced-btn btn" {{action "toggleAdvancedSearch"}}>
|
<button class="search-advanced-btn btn" {{action "toggleAdvancedSearch"}}>
|
||||||
{{{searchAdvancedIcon}}}
|
{{{searchAdvancedIcon}}}
|
||||||
{{i18n "search.advanced.title"}}
|
{{i18n "search.advanced.title"}}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{{#if expanded}}
|
{{#if expanded}}
|
||||||
{{search-advanced-options searchTerm=searchTerm isExpanded=expanded}}
|
{{search-advanced-options searchTerm=searchTerm isExpanded=expanded}}
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#if canCreateTopic}}
|
||||||
|
<span class="new-topic-btn">{{d-button id="create-topic" class="btn-default" action="createTopic" actionParam=searchTerm icon="plus" label="topic.create"}}</span>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if canBulkSelect}}
|
||||||
|
{{d-button icon="list" class="bulk-select" title="topics.bulk.toggle" action="toggleBulkSelect"}}
|
||||||
|
{{bulk-select-button selected=selected action="search"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#if canCreateTopic}}
|
{{#if bulkSelectEnabled}}
|
||||||
<span class="new-topic-btn">{{d-button id="create-topic" class="btn-default" action="createTopic" actionParam=searchTerm icon="plus" label="topic.create"}}</span>
|
<div class='fps-select'>
|
||||||
{{/if}}
|
<a {{action "selectAll"}}>{{i18n "search.select_all"}}</a>
|
||||||
|
<a {{action "clearAll"}}>{{i18n "search.clear_all"}}</a>
|
||||||
{{#if canBulkSelect}}
|
|
||||||
{{d-button icon="list" class="bulk-select" title="topics.bulk.toggle" action="toggleBulkSelect"}}
|
|
||||||
{{bulk-select-button selected=selected action="search"}}
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{#if bulkSelectEnabled}}
|
|
||||||
<div class='fps-select'>
|
|
||||||
<a {{action "selectAll"}}>{{i18n "search.select_all"}}</a>
|
|
||||||
<a {{action "clearAll"}}>{{i18n "search.clear_all"}}</a>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if invalidSearch}}
|
|
||||||
<div class='fps-invalid'>
|
|
||||||
{{i18n "search.too_short"}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if context}}
|
|
||||||
<div class='fps-search-context'>
|
|
||||||
<label>
|
|
||||||
{{input type="checkbox" name="searchContext" checked=searchContextEnabled}} {{searchContextDescription}}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#conditional-loading-spinner condition=loading}}
|
|
||||||
|
|
||||||
{{#unless hasResults}}
|
|
||||||
<h3>
|
|
||||||
{{#if searchActive}}
|
|
||||||
{{i18n "search.no_results"}}
|
|
||||||
{{/if}}
|
|
||||||
</h3>
|
|
||||||
{{/unless}}
|
|
||||||
|
|
||||||
{{#if hasResults}}
|
|
||||||
<div class='search-title clearfix'>
|
|
||||||
<div class='result-count'>
|
|
||||||
<span>
|
|
||||||
{{{i18n "search.result_count" count=resultCount term=noSortQ}}}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class='sort-by'>
|
|
||||||
<span class='desc'>
|
|
||||||
{{i18n "search.sort_by"}}
|
|
||||||
</span>
|
|
||||||
{{combo-box value=sortOrder content=sortOrders castInteger="true"}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#each model.posts as |result|}}
|
{{#if invalidSearch}}
|
||||||
<div class='fps-result'>
|
<div class='fps-invalid'>
|
||||||
<div class='author'>
|
{{i18n "search.too_short"}}
|
||||||
<a href={{result.userPath}} data-user-card="{{unbound result.username}}">
|
</div>
|
||||||
{{avatar result imageSize="large"}}
|
{{/if}}
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='fps-topic'>
|
{{#if context}}
|
||||||
<div class='topic'>
|
<div class='fps-search-context'>
|
||||||
{{#if bulkSelectEnabled}}
|
<label>
|
||||||
{{track-selected selectedList=selected selectedId=result.topic}}
|
{{input type="checkbox" name="searchContext" checked=searchContextEnabled}} {{searchContextDescription}}
|
||||||
{{/if}}
|
</label>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<a class='search-link' href='{{unbound result.url}}'>
|
{{#conditional-loading-spinner condition=loading}}
|
||||||
{{topic-status topic=result.topic disableActions=true}}<span class='topic-title'>{{#highlight-text highlight=q}}{{{unbound result.topic.fancyTitle}}}{{/highlight-text}}</span>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<div class='search-category'>
|
{{#unless hasResults}}
|
||||||
{{category-link result.topic.category}}
|
<h3>
|
||||||
{{#each result.topic.tags as |tag|}}
|
{{#if searchActive}}
|
||||||
{{discourse-tag tag}}
|
{{i18n "search.no_results"}}
|
||||||
{{/each}}
|
|
||||||
{{plugin-outlet "full-page-search-category"}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='blurb container'>
|
|
||||||
<span class='date'>
|
|
||||||
{{format-age result.created_at}}
|
|
||||||
{{#if result.blurb}}
|
|
||||||
-
|
|
||||||
{{/if}}
|
|
||||||
</span>
|
|
||||||
|
|
||||||
{{#if result.blurb}}
|
|
||||||
{{#highlight-text highlight=q}}
|
|
||||||
{{{unbound result.blurb}}}
|
|
||||||
{{/highlight-text}}
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{#if showLikeCount}}
|
|
||||||
{{#if result.like_count}}
|
|
||||||
<span class='like-count'>
|
|
||||||
{{result.like_count}} {{fa-icon "heart"}}
|
|
||||||
</span>
|
|
||||||
{{/if}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
</h3>
|
||||||
|
{{/unless}}
|
||||||
|
|
||||||
|
{{#if hasResults}}
|
||||||
|
<div class='search-title clearfix'>
|
||||||
|
<div class='result-count'>
|
||||||
|
<span>
|
||||||
|
{{{i18n "search.result_count" count=resultCount term=noSortQ}}}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
<div class='sort-by'>
|
||||||
|
<span class='desc'>
|
||||||
|
{{i18n "search.sort_by"}}
|
||||||
|
</span>
|
||||||
|
{{combo-box value=sortOrder content=sortOrders castInteger="true"}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{/if}}
|
||||||
{{/each}}
|
|
||||||
|
|
||||||
{{#if hasResults}}
|
{{#each model.posts as |result|}}
|
||||||
<h3 class="search-footer">
|
<div class='fps-result'>
|
||||||
{{i18n "search.no_more_results"}}
|
<div class='author'>
|
||||||
</h3>
|
<a href={{result.userPath}} data-user-card="{{unbound result.username}}">
|
||||||
{{/if}}
|
{{avatar result imageSize="large"}}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
{{/conditional-loading-spinner}}
|
<div class='fps-topic'>
|
||||||
|
<div class='topic'>
|
||||||
|
{{#if bulkSelectEnabled}}
|
||||||
|
{{track-selected selectedList=selected selectedId=result.topic}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
<a class='search-link' href='{{unbound result.url}}'>
|
||||||
|
{{topic-status topic=result.topic disableActions=true}}<span class='topic-title'>{{#highlight-text highlight=q}}{{{unbound result.topic.fancyTitle}}}{{/highlight-text}}</span>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<div class='search-category'>
|
||||||
|
{{category-link result.topic.category}}
|
||||||
|
{{#each result.topic.tags as |tag|}}
|
||||||
|
{{discourse-tag tag}}
|
||||||
|
{{/each}}
|
||||||
|
{{plugin-outlet "full-page-search-category"}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class='blurb container'>
|
||||||
|
<span class='date'>
|
||||||
|
{{format-age result.created_at}}
|
||||||
|
{{#if result.blurb}}
|
||||||
|
-
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
{{#if result.blurb}}
|
||||||
|
{{#highlight-text highlight=q}}
|
||||||
|
{{{unbound result.blurb}}}
|
||||||
|
{{/highlight-text}}
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#if showLikeCount}}
|
||||||
|
{{#if result.like_count}}
|
||||||
|
<span class='like-count'>
|
||||||
|
{{result.like_count}} {{fa-icon "heart"}}
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{{/each}}
|
||||||
|
|
||||||
|
{{#if hasResults}}
|
||||||
|
<h3 class="search-footer">
|
||||||
|
{{i18n "search.no_more_results"}}
|
||||||
|
</h3>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{/conditional-loading-spinner}}
|
||||||
|
{{/d-section}}
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
{{bread-crumbs categories=categories}}
|
{{#d-section bodyClass="navigation-topics" scrollTop="false"}}
|
||||||
|
{{bread-crumbs categories=categories}}
|
||||||
|
|
||||||
{{navigation-bar navItems=navItems filterMode=filterMode}}
|
{{navigation-bar navItems=navItems filterMode=filterMode}}
|
||||||
|
|
||||||
{{#if canCreateTopic}}
|
{{#if canCreateTopic}}
|
||||||
<button id="create-topic" class='btn btn-default' {{action "createTopic"}}><i class='fa fa-plus'></i>{{i18n 'topic.create'}}</button>
|
<button id="create-topic" class='btn btn-default' {{action "createTopic"}}><i class='fa fa-plus'></i>{{i18n 'topic.create'}}</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{/d-section}}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<section class='user-content user-preferences'>
|
{{#d-section pageClass="user-preferences" class="user-content user-preferences"}}
|
||||||
|
|
||||||
<form class="form-horizontal">
|
<form class="form-horizontal">
|
||||||
|
|
||||||
@ -367,4 +367,4 @@
|
|||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</form>
|
</form>
|
||||||
</section>
|
{{/d-section}}
|
@ -1,9 +1,11 @@
|
|||||||
<div class="container list-container">
|
{{#d-section pageClass="tags"}}
|
||||||
<div class="row">
|
<div class="container list-container">
|
||||||
<div class="full-width">
|
<div class="row">
|
||||||
<div id='list-area'>
|
<div class="full-width">
|
||||||
{{outlet}}
|
<div id='list-area'>
|
||||||
|
{{outlet}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{/d-section}}
|
||||||
|
@ -1,109 +1,111 @@
|
|||||||
{{#if canInviteToForum}}
|
{{#d-section pageClass="user-invites"}}
|
||||||
{{#load-more class="paginated-topics-list" selector=".paginated-topics-list .user-invite-list tr" action="loadMore"}}
|
{{#if canInviteToForum}}
|
||||||
<section class='user-content'>
|
{{#load-more class="paginated-topics-list" selector=".paginated-topics-list .user-invite-list tr" action="loadMore"}}
|
||||||
<h2>{{i18n 'user.invited.title'}}</h2>
|
<section class='user-content'>
|
||||||
|
<h2>{{i18n 'user.invited.title'}}</h2>
|
||||||
|
|
||||||
{{#if model.can_see_invite_details}}
|
{{#if model.can_see_invite_details}}
|
||||||
<div class='user-invite-controls'>
|
<div class='user-invite-controls'>
|
||||||
<div class='span15'>
|
<div class='span15'>
|
||||||
<ul class="nav nav-pills">
|
<ul class="nav nav-pills">
|
||||||
{{nav-item route='userInvited.show' routeParam='pending' i18nLabel=pendingLabel}}
|
{{nav-item route='userInvited.show' routeParam='pending' i18nLabel=pendingLabel}}
|
||||||
{{nav-item route='userInvited.show' routeParam='redeemed' i18nLabel=redeemedLabel}}
|
{{nav-item route='userInvited.show' routeParam='redeemed' i18nLabel=redeemedLabel}}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pull-right">
|
<div class="pull-right">
|
||||||
{{d-button icon="plus" action="showInvite" label="user.invited.create" class="btn"}}
|
{{d-button icon="plus" action="showInvite" label="user.invited.create" class="btn"}}
|
||||||
{{#if canBulkInvite}}
|
{{#if canBulkInvite}}
|
||||||
{{resumable-upload target="/invites/upload" success="uploadSuccess" error="uploadError" uploadText=uploadText}}
|
{{resumable-upload target="/invites/upload" success="uploadSuccess" error="uploadError" uploadText=uploadText}}
|
||||||
{{/if}}
|
|
||||||
{{#if showReinviteAllButton}}
|
|
||||||
{{#if reinvitedAll}}
|
|
||||||
{{i18n 'user.invited.reinvited_all'}}
|
|
||||||
{{else}}
|
|
||||||
{{d-button icon="refresh" action="reinviteAll" class="btn" label="user.invited.reinvite_all"}}
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{#if showReinviteAllButton}}
|
||||||
</div>
|
{{#if reinvitedAll}}
|
||||||
</div>
|
{{i18n 'user.invited.reinvited_all'}}
|
||||||
{{/if}}
|
{{else}}
|
||||||
|
{{d-button icon="refresh" action="reinviteAll" class="btn" label="user.invited.reinvite_all"}}
|
||||||
{{#if showSearch}}
|
{{/if}}
|
||||||
<div class="user-invite-search">
|
|
||||||
<form>{{text-field value=searchTerm placeholderKey="user.invited.search"}}</form>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if model.invites}}
|
|
||||||
<table class='table user-invite-list'>
|
|
||||||
<tr>
|
|
||||||
{{#if inviteRedeemed}}
|
|
||||||
<th>{{i18n 'user.invited.user'}}</th>
|
|
||||||
<th>{{i18n 'user.invited.redeemed_at'}}</th>
|
|
||||||
{{#if model.can_see_invite_details}}
|
|
||||||
<th>{{i18n 'user.last_seen'}}</th>
|
|
||||||
<th>{{i18n 'user.invited.topics_entered'}}</th>
|
|
||||||
<th>{{i18n 'user.invited.posts_read_count'}}</th>
|
|
||||||
<th>{{i18n 'user.invited.time_read'}}</th>
|
|
||||||
<th>{{i18n 'user.invited.days_visited'}}</th>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
</div>
|
||||||
<th colspan="1">{{i18n 'user.invited.user'}}</th>
|
</div>
|
||||||
<th colspan="6">{{i18n 'user.invited.sent'}}</th>
|
{{/if}}
|
||||||
{{/if}}
|
|
||||||
</tr>
|
{{#if showSearch}}
|
||||||
{{#each model.invites as |invite|}}
|
<div class="user-invite-search">
|
||||||
|
<form>{{text-field value=searchTerm placeholderKey="user.invited.search"}}</form>
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if model.invites}}
|
||||||
|
<table class='table user-invite-list'>
|
||||||
<tr>
|
<tr>
|
||||||
{{#if invite.user}}
|
{{#if inviteRedeemed}}
|
||||||
<td>
|
<th>{{i18n 'user.invited.user'}}</th>
|
||||||
{{#link-to 'user' invite.user}}{{avatar invite.user imageSize="tiny"}}{{/link-to}}
|
<th>{{i18n 'user.invited.redeemed_at'}}</th>
|
||||||
{{#link-to 'user' invite.user}}{{invite.user.username}}{{/link-to}}
|
|
||||||
</td>
|
|
||||||
<td>{{format-date invite.redeemed_at}}</td>
|
|
||||||
{{#if model.can_see_invite_details}}
|
{{#if model.can_see_invite_details}}
|
||||||
<td>{{format-date invite.user.last_seen_at}}</td>
|
<th>{{i18n 'user.last_seen'}}</th>
|
||||||
<td>{{number invite.user.topics_entered}}</td>
|
<th>{{i18n 'user.invited.topics_entered'}}</th>
|
||||||
<td>{{number invite.user.posts_read_count}}</td>
|
<th>{{i18n 'user.invited.posts_read_count'}}</th>
|
||||||
<td>{{{unbound invite.user.time_read}}}</td>
|
<th>{{i18n 'user.invited.time_read'}}</th>
|
||||||
<td><span title="{{i18n 'user.invited.days_visited'}}">{{{unbound invite.user.days_visited}}}</span>
|
<th>{{i18n 'user.invited.days_visited'}}</th>
|
||||||
/
|
|
||||||
<span title="{{i18n 'user.invited.account_age_days'}}">{{{unbound invite.user.days_since_created}}}</span></td>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<td>{{unbound invite.email}}</td>
|
<th colspan="1">{{i18n 'user.invited.user'}}</th>
|
||||||
<td>{{format-date invite.created_at}}</td>
|
<th colspan="6">{{i18n 'user.invited.sent'}}</th>
|
||||||
<td colspan='5'>
|
|
||||||
{{#if invite.expired}}
|
|
||||||
{{i18n 'user.invited.expired'}}
|
|
||||||
|
|
||||||
{{/if}}
|
|
||||||
{{#if invite.rescinded}}
|
|
||||||
{{i18n 'user.invited.rescinded'}}
|
|
||||||
{{else}}
|
|
||||||
{{d-button icon="times" action="rescind" actionParam=invite class="btn" label="user.invited.rescind"}}
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#if invite.reinvited}}
|
|
||||||
{{i18n 'user.invited.reinvited'}}
|
|
||||||
{{else}}
|
|
||||||
{{d-button icon="refresh" action="reinvite" actionParam=invite class="btn" label="user.invited.reinvite"}}
|
|
||||||
{{/if}}
|
|
||||||
</td>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{#each model.invites as |invite|}}
|
||||||
</table>
|
<tr>
|
||||||
{{conditional-loading-spinner condition=invitesLoading}}
|
{{#if invite.user}}
|
||||||
|
<td>
|
||||||
|
{{#link-to 'user' invite.user}}{{avatar invite.user imageSize="tiny"}}{{/link-to}}
|
||||||
|
{{#link-to 'user' invite.user}}{{invite.user.username}}{{/link-to}}
|
||||||
|
</td>
|
||||||
|
<td>{{format-date invite.redeemed_at}}</td>
|
||||||
|
{{#if model.can_see_invite_details}}
|
||||||
|
<td>{{format-date invite.user.last_seen_at}}</td>
|
||||||
|
<td>{{number invite.user.topics_entered}}</td>
|
||||||
|
<td>{{number invite.user.posts_read_count}}</td>
|
||||||
|
<td>{{{unbound invite.user.time_read}}}</td>
|
||||||
|
<td><span title="{{i18n 'user.invited.days_visited'}}">{{{unbound invite.user.days_visited}}}</span>
|
||||||
|
/
|
||||||
|
<span title="{{i18n 'user.invited.account_age_days'}}">{{{unbound invite.user.days_since_created}}}</span></td>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<td>{{unbound invite.email}}</td>
|
||||||
|
<td>{{format-date invite.created_at}}</td>
|
||||||
|
<td colspan='5'>
|
||||||
|
{{#if invite.expired}}
|
||||||
|
{{i18n 'user.invited.expired'}}
|
||||||
|
|
||||||
|
{{/if}}
|
||||||
|
{{#if invite.rescinded}}
|
||||||
|
{{i18n 'user.invited.rescinded'}}
|
||||||
|
{{else}}
|
||||||
|
{{d-button icon="times" action="rescind" actionParam=invite class="btn" label="user.invited.rescind"}}
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if invite.reinvited}}
|
||||||
|
{{i18n 'user.invited.reinvited'}}
|
||||||
|
{{else}}
|
||||||
|
{{d-button icon="refresh" action="reinvite" actionParam=invite class="btn" label="user.invited.reinvite"}}
|
||||||
|
{{/if}}
|
||||||
|
</td>
|
||||||
|
{{/if}}
|
||||||
|
</tr>
|
||||||
|
{{/each}}
|
||||||
|
</table>
|
||||||
|
{{conditional-loading-spinner condition=invitesLoading}}
|
||||||
|
|
||||||
{{else}}
|
{{else}}
|
||||||
<div class="user-invite-none">
|
<div class="user-invite-none">
|
||||||
{{#if canBulkInvite}}
|
{{#if canBulkInvite}}
|
||||||
{{{i18n 'user.invited.bulk_invite.none'}}}
|
{{{i18n 'user.invited.bulk_invite.none'}}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{i18n 'user.invited.none'}}
|
{{i18n 'user.invited.none'}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
</section>
|
||||||
{{/load-more}}
|
{{/load-more}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{/d-section}}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<section class='user-navigation'>
|
{{#d-section pageClass="user-activity" class="user-nagivation" scrollTop="false"}}
|
||||||
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=currentPath}}
|
{{#mobile-nav class='activity-nav' desktopClass='action-list activity-list nav-stacked' currentPath=currentPath}}
|
||||||
<li class='no-glyph'>
|
<li class='no-glyph'>
|
||||||
{{#link-to 'userActivity.index'}}{{i18n 'user.filters.all'}}{{/link-to}}
|
{{#link-to 'userActivity.index'}}{{i18n 'user.filters.all'}}{{/link-to}}
|
||||||
@ -31,10 +31,8 @@
|
|||||||
{{d-button action="exportUserArchive" label="user.download_archive" icon="download"}}
|
{{d-button action="exportUserArchive" label="user.download_archive" icon="download"}}
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{/d-section}}
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class='user-right'>
|
<section class='user-right'>
|
||||||
{{outlet}}
|
{{outlet}}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<section class='user-content user-badges-list'>
|
{{#d-section pageClass="user-badges" class="user-content user-badges-list"}}
|
||||||
{{#each sortedBadges as |ub|}}
|
{{#each sortedBadges as |ub|}}
|
||||||
{{badge-card badge=ub.badge count=ub.count navigateOnClick="true" username=username}}
|
{{badge-card badge=ub.badge count=ub.count navigateOnClick="true" username=username}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</section>
|
{{/d-section}}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<section class='user-navigation'>
|
{{#d-section class="user-navigation" pageClass="user-messages"}}
|
||||||
{{#unless site.mobileView}}
|
{{#unless site.mobileView}}
|
||||||
{{#if showNewPM}}
|
{{#if showNewPM}}
|
||||||
{{d-button class="btn-primary new-private-message" action="composePrivateMessage" icon="envelope" label="user.new_private_message"}}
|
{{d-button class="btn-primary new-private-message" action="composePrivateMessage" icon="envelope" label="user.new_private_message"}}
|
||||||
@ -37,8 +37,7 @@
|
|||||||
{{/if}}
|
{{/if}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{/mobile-nav}}
|
{{/mobile-nav}}
|
||||||
|
{{/d-section}}
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class='user-right messages'>
|
<section class='user-right messages'>
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
<section class='user-navigation'>
|
{{#d-section pageClass="user-notifications" class="user-notifications"}}
|
||||||
{{#mobile-nav class='notifications-nav' desktopClass='notification-list action-list nav-stacked' currentPath=application.currentPath}}
|
{{#mobile-nav class='notifications-nav' desktopClass='notification-list action-list nav-stacked' currentPath=application.currentPath}}
|
||||||
<li class='no-glyph'>
|
<li class='no-glyph'>
|
||||||
{{#link-to 'userNotifications.index'}}{{i18n 'user.filters.all'}}{{/link-to}}
|
{{#link-to 'userNotifications.index'}}{{i18n 'user.filters.all'}}{{/link-to}}
|
||||||
@ -26,7 +26,7 @@
|
|||||||
icon='check'
|
icon='check'
|
||||||
disabled=allNotificationsRead}}
|
disabled=allNotificationsRead}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</section>
|
{{/d-section}}
|
||||||
|
|
||||||
<section class='user-right'>
|
<section class='user-right'>
|
||||||
{{#load-more class="notification-history user-stream" selector=".user-stream .notification" action="loadMore"}}
|
{{#load-more class="notification-history user-stream" selector=".user-stream .notification" action="loadMore"}}
|
||||||
|
@ -1,185 +1,187 @@
|
|||||||
<div class='top-section stats-section'>
|
{{#d-section pageClass="user-summary"}}
|
||||||
<h3 class='stats-title'>{{i18n "user.summary.stats"}}</h3>
|
<div class='top-section stats-section'>
|
||||||
<ul>
|
<h3 class='stats-title'>{{i18n "user.summary.stats"}}</h3>
|
||||||
<li>
|
<ul>
|
||||||
{{user-stat value=model.days_visited label="user.summary.days_visited"}}
|
<li>
|
||||||
</li>
|
{{user-stat value=model.days_visited label="user.summary.days_visited"}}
|
||||||
<li>
|
</li>
|
||||||
<span class='value'>{{model.time_read}}</span>
|
<li>
|
||||||
<span class='label'>{{{i18n "user.summary.time_read"}}}</span>
|
<span class='value'>{{model.time_read}}</span>
|
||||||
</li>
|
<span class='label'>{{{i18n "user.summary.time_read"}}}</span>
|
||||||
<li>
|
</li>
|
||||||
{{user-stat value=model.posts_read_count label="user.summary.posts_read"}}
|
<li>
|
||||||
</li>
|
{{user-stat value=model.posts_read_count label="user.summary.posts_read"}}
|
||||||
<li class="linked-stat">
|
</li>
|
||||||
{{#link-to 'userActivity.likesGiven'}}
|
|
||||||
{{user-stat value=model.likes_given label="user.summary.likes_given"}}
|
|
||||||
{{/link-to}}
|
|
||||||
</li>
|
|
||||||
{{#if model.bookmark_count}}
|
|
||||||
<li class="linked-stat">
|
<li class="linked-stat">
|
||||||
{{#link-to 'userActivity.bookmarks'}}
|
{{#link-to 'userActivity.likesGiven'}}
|
||||||
{{user-stat value=model.bookmark_count label="user.summary.bookmark_count"}}
|
{{user-stat value=model.likes_given label="user.summary.likes_given"}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{#if model.bookmark_count}}
|
||||||
<li class="linked-stat">
|
<li class="linked-stat">
|
||||||
{{#link-to 'userActivity.topics'}}
|
{{#link-to 'userActivity.bookmarks'}}
|
||||||
{{user-stat value=model.topic_count label="user.summary.topic_count"}}
|
{{user-stat value=model.bookmark_count label="user.summary.bookmark_count"}}
|
||||||
{{/link-to}}
|
{{/link-to}}
|
||||||
</li>
|
</li>
|
||||||
<li class="linked-stat">
|
|
||||||
{{#link-to 'userActivity.replies'}}
|
|
||||||
{{user-stat value=model.post_count label="user.summary.post_count"}}
|
|
||||||
{{/link-to}}
|
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
{{user-stat value=model.likes_received label="user.summary.likes_received"}}
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='top-section'>
|
|
||||||
<div class='top-sub-section replies-section pull-left'>
|
|
||||||
<h3 class='stats-title'>{{i18n "user.summary.top_replies"}}</h3>
|
|
||||||
{{#if model.replies.length}}
|
|
||||||
<ul>
|
|
||||||
{{#each model.replies as |reply|}}
|
|
||||||
<li>
|
|
||||||
<span class='topic-info'>
|
|
||||||
{{format-date reply.createdAt format="tiny" noTitle="true"}}
|
|
||||||
{{#if reply.like_count}}
|
|
||||||
·
|
|
||||||
{{fa-icon 'heart'}} <span class='like-count'>{{number reply.like_count}}</span>
|
|
||||||
{{/if}}
|
|
||||||
</span>
|
|
||||||
<br>
|
|
||||||
<a href="{{unbound reply.url}}">{{{reply.topic.fancyTitle}}}</a>
|
|
||||||
</li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
|
||||||
{{#if moreReplies}}
|
|
||||||
<p>{{#link-to "userActivity.replies" user class="more"}}{{i18n "user.summary.more_replies"}}{{/link-to}}</p>
|
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
<li class="linked-stat">
|
||||||
<p>{{i18n "user.summary.no_replies"}}</p>
|
{{#link-to 'userActivity.topics'}}
|
||||||
{{/if}}
|
{{user-stat value=model.topic_count label="user.summary.topic_count"}}
|
||||||
|
{{/link-to}}
|
||||||
|
</li>
|
||||||
|
<li class="linked-stat">
|
||||||
|
{{#link-to 'userActivity.replies'}}
|
||||||
|
{{user-stat value=model.post_count label="user.summary.post_count"}}
|
||||||
|
{{/link-to}}
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
{{user-stat value=model.likes_received label="user.summary.likes_received"}}
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class='top-sub-section topics-section pull-right'>
|
|
||||||
<h3 class='stats-title'>{{i18n "user.summary.top_topics"}}</h3>
|
<div class='top-section'>
|
||||||
{{#if model.topics.length}}
|
<div class='top-sub-section replies-section pull-left'>
|
||||||
<ul>
|
<h3 class='stats-title'>{{i18n "user.summary.top_replies"}}</h3>
|
||||||
{{#each model.topics as |topic|}}
|
{{#if model.replies.length}}
|
||||||
<li>
|
<ul>
|
||||||
<span class='topic-info'>
|
{{#each model.replies as |reply|}}
|
||||||
{{format-date topic.createdAt format="tiny" noTitle="true"}}
|
<li>
|
||||||
{{#if topic.like_count}}
|
<span class='topic-info'>
|
||||||
·
|
{{format-date reply.createdAt format="tiny" noTitle="true"}}
|
||||||
{{fa-icon 'heart'}} <span class='like-count'>{{number topic.like_count}}</span>
|
{{#if reply.like_count}}
|
||||||
{{/if}}
|
·
|
||||||
</span>
|
{{fa-icon 'heart'}} <span class='like-count'>{{number reply.like_count}}</span>
|
||||||
<br>
|
{{/if}}
|
||||||
<a href="{{unbound topic.url}}">{{{topic.fancyTitle}}}</a>
|
</span>
|
||||||
</li>
|
<br>
|
||||||
{{/each}}
|
<a href="{{unbound reply.url}}">{{{reply.topic.fancyTitle}}}</a>
|
||||||
</ul>
|
</li>
|
||||||
{{#if moreTopics}}
|
{{/each}}
|
||||||
<p>{{#link-to "userActivity.topics" user class="more"}}{{i18n "user.summary.more_topics"}}{{/link-to}}</p>
|
</ul>
|
||||||
|
{{#if moreReplies}}
|
||||||
|
<p>{{#link-to "userActivity.replies" user class="more"}}{{i18n "user.summary.more_replies"}}{{/link-to}}</p>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<p>{{i18n "user.summary.no_replies"}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{else}}
|
</div>
|
||||||
<p>{{i18n "user.summary.no_topics"}}</p>
|
<div class='top-sub-section topics-section pull-right'>
|
||||||
{{/if}}
|
<h3 class='stats-title'>{{i18n "user.summary.top_topics"}}</h3>
|
||||||
|
{{#if model.topics.length}}
|
||||||
|
<ul>
|
||||||
|
{{#each model.topics as |topic|}}
|
||||||
|
<li>
|
||||||
|
<span class='topic-info'>
|
||||||
|
{{format-date topic.createdAt format="tiny" noTitle="true"}}
|
||||||
|
{{#if topic.like_count}}
|
||||||
|
·
|
||||||
|
{{fa-icon 'heart'}} <span class='like-count'>{{number topic.like_count}}</span>
|
||||||
|
{{/if}}
|
||||||
|
</span>
|
||||||
|
<br>
|
||||||
|
<a href="{{unbound topic.url}}">{{{topic.fancyTitle}}}</a>
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
{{#if moreTopics}}
|
||||||
|
<p>{{#link-to "userActivity.topics" user class="more"}}{{i18n "user.summary.more_topics"}}{{/link-to}}</p>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<p>{{i18n "user.summary.no_topics"}}</p>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='top-section'>
|
<div class='top-section'>
|
||||||
<div class='top-sub-section links-section pull-left'>
|
<div class='top-sub-section links-section pull-left'>
|
||||||
<h3 class='stats-title'>{{i18n "user.summary.top_links"}}</h3>
|
<h3 class='stats-title'>{{i18n "user.summary.top_links"}}</h3>
|
||||||
{{#if model.links.length}}
|
{{#if model.links.length}}
|
||||||
<ul>
|
<ul>
|
||||||
{{#each model.links as |link|}}
|
{{#each model.links as |link|}}
|
||||||
<li>
|
<li>
|
||||||
<a class='domain'
|
<a class='domain'
|
||||||
href='{{unbound link.url}}'
|
href='{{unbound link.url}}'
|
||||||
title='{{unbound link.title}}'
|
title='{{unbound link.title}}'
|
||||||
rel='{{unless user.removeNoFollow 'nofollow'}}'
|
rel='{{unless user.removeNoFollow 'nofollow'}}'
|
||||||
target='_blank'>
|
target='_blank'>
|
||||||
{{shorten-url link.url}}
|
{{shorten-url link.url}}
|
||||||
</a>
|
</a>
|
||||||
<span class='badge badge-notification clicks' title='{{i18n 'topic_map.clicks' count=link.clicks}}'>{{number link.clicks}}</span>
|
<span class='badge badge-notification clicks' title='{{i18n 'topic_map.clicks' count=link.clicks}}'>{{number link.clicks}}</span>
|
||||||
<br>
|
<br>
|
||||||
<a href="{{unbound link.post_url}}">{{{link.topic.fancyTitle}}}</a>
|
<a href="{{unbound link.post_url}}">{{{link.topic.fancyTitle}}}</a>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
{{else}}
|
{{else}}
|
||||||
<p>{{i18n "user.summary.no_links"}}</p>
|
<p>{{i18n "user.summary.no_links"}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
<div class='top-sub-section likes-section pull-right'>
|
||||||
|
<h3 class='stats-title'>{{i18n "user.summary.most_replied_to_users"}}</h3>
|
||||||
|
{{#if model.most_replied_to_users.length}}
|
||||||
|
<ul>
|
||||||
|
{{#each model.most_replied_to_users as |user|}}
|
||||||
|
<li>
|
||||||
|
{{#user-info user=user}}
|
||||||
|
{{fa-icon "reply"}}
|
||||||
|
<span class='replies'>{{number user.count}}</span>
|
||||||
|
{{/user-info}}
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
{{else}}
|
||||||
|
<p>{{i18n "user.summary.no_replies"}}</p>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='top-sub-section likes-section pull-right'>
|
|
||||||
<h3 class='stats-title'>{{i18n "user.summary.most_replied_to_users"}}</h3>
|
|
||||||
{{#if model.most_replied_to_users.length}}
|
|
||||||
<ul>
|
|
||||||
{{#each model.most_replied_to_users as |user|}}
|
|
||||||
<li>
|
|
||||||
{{#user-info user=user}}
|
|
||||||
{{fa-icon "reply"}}
|
|
||||||
<span class='replies'>{{number user.count}}</span>
|
|
||||||
{{/user-info}}
|
|
||||||
</li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
|
||||||
{{else}}
|
|
||||||
<p>{{i18n "user.summary.no_replies"}}</p>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='top-section'>
|
<div class='top-section'>
|
||||||
<div class='top-sub-section likes-section pull-left'>
|
<div class='top-sub-section likes-section pull-left'>
|
||||||
<h3 class='stats-title'>{{i18n "user.summary.most_liked_by"}}</h3>
|
<h3 class='stats-title'>{{i18n "user.summary.most_liked_by"}}</h3>
|
||||||
{{#if model.most_liked_by_users.length}}
|
{{#if model.most_liked_by_users.length}}
|
||||||
<ul>
|
<ul>
|
||||||
{{#each model.most_liked_by_users as |user|}}
|
{{#each model.most_liked_by_users as |user|}}
|
||||||
<li>
|
<li>
|
||||||
{{#user-info user=user}}
|
{{#user-info user=user}}
|
||||||
{{fa-icon "heart"}}
|
{{fa-icon "heart"}}
|
||||||
<span class='likes'>{{number user.count}}</span>
|
<span class='likes'>{{number user.count}}</span>
|
||||||
{{/user-info}}
|
{{/user-info}}
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
{{else}}
|
{{else}}
|
||||||
<p>{{i18n "user.summary.no_likes"}}</p>
|
<p>{{i18n "user.summary.no_likes"}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
</div>
|
||||||
|
<div class='top-sub-section likes-section pull-right'>
|
||||||
|
<h3 class='stats-title'>{{i18n "user.summary.most_liked_users"}}</h3>
|
||||||
|
{{#if model.most_liked_users.length}}
|
||||||
|
<ul>
|
||||||
|
{{#each model.most_liked_users as |user|}}
|
||||||
|
<li>
|
||||||
|
{{#user-info user=user}}
|
||||||
|
{{fa-icon "heart"}}
|
||||||
|
<span class='likes'>{{number user.count}}</span>
|
||||||
|
{{/user-info}}
|
||||||
|
</li>
|
||||||
|
{{/each}}
|
||||||
|
</ul>
|
||||||
|
{{else}}
|
||||||
|
<p>{{i18n "user.summary.no_likes"}}</p>
|
||||||
|
{{/if}}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class='top-sub-section likes-section pull-right'>
|
|
||||||
<h3 class='stats-title'>{{i18n "user.summary.most_liked_users"}}</h3>
|
|
||||||
{{#if model.most_liked_users.length}}
|
|
||||||
<ul>
|
|
||||||
{{#each model.most_liked_users as |user|}}
|
|
||||||
<li>
|
|
||||||
{{#user-info user=user}}
|
|
||||||
{{fa-icon "heart"}}
|
|
||||||
<span class='likes'>{{number user.count}}</span>
|
|
||||||
{{/user-info}}
|
|
||||||
</li>
|
|
||||||
{{/each}}
|
|
||||||
</ul>
|
|
||||||
{{else}}
|
|
||||||
<p>{{i18n "user.summary.no_likes"}}</p>
|
|
||||||
{{/if}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class='top-section badges-section'>
|
<div class='top-section badges-section'>
|
||||||
<h3 class='stats-title'>{{i18n "user.summary.top_badges"}}</h3>
|
<h3 class='stats-title'>{{i18n "user.summary.top_badges"}}</h3>
|
||||||
{{#each model.badges as |badge|}}
|
{{#each model.badges as |badge|}}
|
||||||
{{badge-card badge=badge count=badge.count navigateOnClick="true" username=user.username_lower}}
|
{{badge-card badge=badge count=badge.count navigateOnClick="true" username=user.username_lower}}
|
||||||
{{else}}
|
{{else}}
|
||||||
<p>{{i18n "user.summary.no_badges"}}</p>
|
<p>{{i18n "user.summary.no_badges"}}</p>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
{{#if moreBadges}}
|
{{#if moreBadges}}
|
||||||
<p>{{#link-to "user.badges" user class="more"}}{{i18n "user.summary.more_badges"}}{{/link-to}}</p>
|
<p>{{#link-to "user.badges" user class="more"}}{{i18n "user.summary.more_badges"}}{{/link-to}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
{{/d-section}}
|
||||||
|
@ -1,44 +1,46 @@
|
|||||||
{{#load-more selector=".directory tbody tr" action="loadMore"}}
|
{{#d-section pageClass="users"}}
|
||||||
<div class="container">
|
{{#load-more selector=".directory tbody tr" action="loadMore"}}
|
||||||
<div class='directory'>
|
<div class="container">
|
||||||
|
<div class='directory'>
|
||||||
|
|
||||||
|
<div class='clearfix'>
|
||||||
|
{{period-chooser period=period}}
|
||||||
|
{{text-field value=nameInput placeholderKey="directory.filter_name" class="filter-name no-blur"}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{#conditional-loading-spinner condition=model.loading}}
|
||||||
|
{{#if model.length}}
|
||||||
|
<div class='total-rows'>{{i18n "directory.total_rows" count=model.totalRows}}</div>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<th> </th>
|
||||||
|
{{directory-toggle field="likes_received" order=order asc=asc icon="heart"}}
|
||||||
|
{{directory-toggle field="likes_given" order=order asc=asc icon="heart"}}
|
||||||
|
{{directory-toggle field="topic_count" order=order asc=asc}}
|
||||||
|
{{directory-toggle field="post_count" order=order asc=asc}}
|
||||||
|
{{directory-toggle field="topics_entered" order=order asc=asc}}
|
||||||
|
{{directory-toggle field="posts_read" order=order asc=asc}}
|
||||||
|
{{directory-toggle field="days_visited" order=order asc=asc}}
|
||||||
|
{{#if showTimeRead}}
|
||||||
|
<th>{{i18n "directory.time_read"}}</th>
|
||||||
|
{{/if}}
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{{#each model as |item|}}
|
||||||
|
{{directory-item item=item showTimeRead=showTimeRead}}
|
||||||
|
{{/each}}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
{{conditional-loading-spinner condition=model.loadingMore}}
|
||||||
|
{{else}}
|
||||||
|
<div class='clearfix'></div>
|
||||||
|
<p>{{i18n "directory.no_results"}}</p>
|
||||||
|
{{/if}}
|
||||||
|
{{/conditional-loading-spinner}}
|
||||||
|
|
||||||
<div class='clearfix'>
|
|
||||||
{{period-chooser period=period}}
|
|
||||||
{{text-field value=nameInput placeholderKey="directory.filter_name" class="filter-name no-blur"}}
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{{#conditional-loading-spinner condition=model.loading}}
|
|
||||||
{{#if model.length}}
|
|
||||||
<div class='total-rows'>{{i18n "directory.total_rows" count=model.totalRows}}</div>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<thead>
|
|
||||||
<th> </th>
|
|
||||||
{{directory-toggle field="likes_received" order=order asc=asc icon="heart"}}
|
|
||||||
{{directory-toggle field="likes_given" order=order asc=asc icon="heart"}}
|
|
||||||
{{directory-toggle field="topic_count" order=order asc=asc}}
|
|
||||||
{{directory-toggle field="post_count" order=order asc=asc}}
|
|
||||||
{{directory-toggle field="topics_entered" order=order asc=asc}}
|
|
||||||
{{directory-toggle field="posts_read" order=order asc=asc}}
|
|
||||||
{{directory-toggle field="days_visited" order=order asc=asc}}
|
|
||||||
{{#if showTimeRead}}
|
|
||||||
<th>{{i18n "directory.time_read"}}</th>
|
|
||||||
{{/if}}
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{{#each model as |item|}}
|
|
||||||
{{directory-item item=item showTimeRead=showTimeRead}}
|
|
||||||
{{/each}}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
{{conditional-loading-spinner condition=model.loadingMore}}
|
|
||||||
{{else}}
|
|
||||||
<div class='clearfix'></div>
|
|
||||||
<p>{{i18n "directory.no_results"}}</p>
|
|
||||||
{{/if}}
|
|
||||||
{{/conditional-loading-spinner}}
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{{/load-more}}
|
||||||
{{/load-more}}
|
{{/d-section}}
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('about-page');
|
|
@ -1,4 +0,0 @@
|
|||||||
import ScrollTop from 'discourse/mixins/scroll-top';
|
|
||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('badges-page').extend(ScrollTop);
|
|
@ -1,5 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('search-page').extend({
|
|
||||||
classNames: ['search-container']
|
|
||||||
});
|
|
@ -1,3 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('navigation-topics');
|
|
@ -1,6 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('user-preferences-page').extend({
|
|
||||||
templateName: 'user/preferences',
|
|
||||||
classNames: ['user-preferences']
|
|
||||||
});
|
|
@ -1,3 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('tags-page');
|
|
@ -1,3 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('user-activity-page');
|
|
@ -1,4 +0,0 @@
|
|||||||
import ScrollTop from 'discourse/mixins/scroll-top';
|
|
||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('user-badges-page').extend(ScrollTop);
|
|
@ -1,3 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('user-invites-page');
|
|
@ -1,3 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('user-messages-page');
|
|
@ -1,3 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('user-notifications-page');
|
|
@ -1,3 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('user-summary-page');
|
|
@ -1,3 +0,0 @@
|
|||||||
import { createViewWithBodyClass } from 'discourse/lib/create-view';
|
|
||||||
|
|
||||||
export default createViewWithBodyClass('users-page');
|
|
@ -4,6 +4,7 @@ acceptance("About");
|
|||||||
test("viewing", () => {
|
test("viewing", () => {
|
||||||
visit("/about");
|
visit("/about");
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
|
ok($('body.about-page').length, "has body class");
|
||||||
ok(exists('.about.admins .user-info'), 'has admins');
|
ok(exists('.about.admins .user-info'), 'has admins');
|
||||||
ok(exists('.about.moderators .user-info'), 'has moderators');
|
ok(exists('.about.moderators .user-info'), 'has moderators');
|
||||||
ok(exists('.about.stats tr td'), 'has stats');
|
ok(exists('.about.stats tr td'), 'has stats');
|
||||||
|
@ -5,6 +5,7 @@ acceptance("Badges");
|
|||||||
test("Visit Badge Pages", () => {
|
test("Visit Badge Pages", () => {
|
||||||
visit("/badges");
|
visit("/badges");
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
|
ok($('body.badges-page').length, "has body class");
|
||||||
ok(exists('.badge-groups .badge-card'), "has a list of badges");
|
ok(exists('.badge-groups .badge-card'), "has a list of badges");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@ test("update some fields", () => {
|
|||||||
visit("/users/eviltrout/preferences");
|
visit("/users/eviltrout/preferences");
|
||||||
|
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
|
ok($('body.user-preferences-page').length, "has the body class");
|
||||||
equal(currentURL(), '/users/eviltrout/preferences', "it doesn't redirect");
|
equal(currentURL(), '/users/eviltrout/preferences', "it doesn't redirect");
|
||||||
ok(exists('.user-preferences'), 'it shows the preferences');
|
ok(exists('.user-preferences'), 'it shows the preferences');
|
||||||
});
|
});
|
@ -43,6 +43,8 @@ test("perform various searches", assert => {
|
|||||||
visit("/search");
|
visit("/search");
|
||||||
|
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
|
ok($('body.search-page').length, "has body class");
|
||||||
|
ok(exists('.search-container'), "has container class");
|
||||||
assert.ok(find('input.search').length > 0);
|
assert.ok(find('input.search').length > 0);
|
||||||
assert.ok(find('.fps-topic').length === 0);
|
assert.ok(find('.fps-topic').length === 0);
|
||||||
});
|
});
|
||||||
|
11
test/javascripts/acceptance/tags-test.js.es6
Normal file
11
test/javascripts/acceptance/tags-test.js.es6
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { acceptance } from "helpers/qunit-helpers";
|
||||||
|
acceptance("Tags", { loggedIn: true });
|
||||||
|
|
||||||
|
test("list the tags", () => {
|
||||||
|
visit("/tags");
|
||||||
|
|
||||||
|
andThen(() => {
|
||||||
|
ok($('body.tags-page').length, "has the body class");
|
||||||
|
ok(exists('.tag-eviltrout'), "shows the evil trout tag");
|
||||||
|
});
|
||||||
|
});
|
@ -4,6 +4,7 @@ acceptance("Topic Discovery");
|
|||||||
test("Visit Discovery Pages", () => {
|
test("Visit Discovery Pages", () => {
|
||||||
visit("/");
|
visit("/");
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
|
ok($('body.navigation-topics').length, "has the default navigation");
|
||||||
ok(exists(".topic-list"), "The list of topics was rendered");
|
ok(exists(".topic-list"), "The list of topics was rendered");
|
||||||
ok(exists('.topic-list .topic-list-item'), "has topics");
|
ok(exists('.topic-list .topic-list-item'), "has topics");
|
||||||
});
|
});
|
||||||
|
@ -24,6 +24,9 @@ test("Root URL", () => {
|
|||||||
|
|
||||||
test("Filters", () => {
|
test("Filters", () => {
|
||||||
visit("/users/eviltrout/activity");
|
visit("/users/eviltrout/activity");
|
||||||
|
andThen(() => {
|
||||||
|
ok($('body.user-activity-page').length, "has the body class");
|
||||||
|
});
|
||||||
hasStream();
|
hasStream();
|
||||||
|
|
||||||
visit("/users/eviltrout/activity/topics");
|
visit("/users/eviltrout/activity/topics");
|
||||||
@ -33,6 +36,14 @@ test("Filters", () => {
|
|||||||
hasStream();
|
hasStream();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("Badges", () => {
|
||||||
|
visit("/users/eviltrout/badges");
|
||||||
|
andThen(() => {
|
||||||
|
ok($('body.user-badges-page').length, "has the body class");
|
||||||
|
ok(exists(".user-badges-list .badge-card"), "shows a badge");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
test("Restricted Routes", () => {
|
test("Restricted Routes", () => {
|
||||||
visit("/users/eviltrout/preferences");
|
visit("/users/eviltrout/preferences");
|
||||||
|
|
||||||
|
@ -1,17 +1,32 @@
|
|||||||
import { acceptance } from "helpers/qunit-helpers";
|
import { acceptance } from "helpers/qunit-helpers";
|
||||||
import { hasStream } from 'acceptance/user-anonymous-test';
|
|
||||||
|
|
||||||
acceptance("User", {loggedIn: true});
|
acceptance("User", {loggedIn: true});
|
||||||
|
|
||||||
test("Pending", () => {
|
test("Invites", () => {
|
||||||
visit("/users/eviltrout/activity/pending");
|
visit("/users/eviltrout/invited/pending");
|
||||||
hasStream();
|
andThen(() => {
|
||||||
|
ok($('body.user-invites-page').length, "has the body class");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Messages", () => {
|
||||||
|
visit("/users/eviltrout/messages");
|
||||||
|
andThen(() => {
|
||||||
|
ok($('body.user-messages-page').length, "has the body class");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
test("Notifications", () => {
|
||||||
|
visit("/users/eviltrout/notifications");
|
||||||
|
andThen(() => {
|
||||||
|
ok($('body.user-notifications-page').length, "has the body class");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test("Root URL - Viewing Self", () => {
|
test("Root URL - Viewing Self", () => {
|
||||||
visit("/users/eviltrout");
|
visit("/users/eviltrout");
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
|
ok($('body.user-summary-page').length, "has the body class");
|
||||||
equal(currentPath(), 'user.summary', "it defaults to summary");
|
equal(currentPath(), 'user.summary', "it defaults to summary");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ acceptance("User Directory");
|
|||||||
test("Visit Page", function() {
|
test("Visit Page", function() {
|
||||||
visit("/users");
|
visit("/users");
|
||||||
andThen(() => {
|
andThen(() => {
|
||||||
|
ok($('body.users-page').length, "has the body class");
|
||||||
ok(exists('.directory table tr'), "has a list of users");
|
ok(exists('.directory table tr'), "has a list of users");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -56,6 +56,13 @@ export default function() {
|
|||||||
return response(json);
|
return response(json);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.get('/tags', () => {
|
||||||
|
return response({ tags: [{
|
||||||
|
id: 'eviltrout',
|
||||||
|
count: 1
|
||||||
|
}] });
|
||||||
|
});
|
||||||
|
|
||||||
this.get('/users/eviltrout.json', () => {
|
this.get('/users/eviltrout.json', () => {
|
||||||
const json = fixturesByUrl['/users/eviltrout.json'];
|
const json = fixturesByUrl['/users/eviltrout.json'];
|
||||||
if (loggedIn()) {
|
if (loggedIn()) {
|
||||||
@ -76,6 +83,20 @@ export default function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.get('/users/eviltrout/invited_count.json', () => {
|
||||||
|
return response({
|
||||||
|
"counts": { "pending": 1, "redeemed": 0, "total": 0 }
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
this.get('/users/eviltrout/invited.json', () => {
|
||||||
|
return response({ "invites": [ {id: 1} ] });
|
||||||
|
});
|
||||||
|
|
||||||
|
this.get('/topics/private-messages/eviltrout.json', () => {
|
||||||
|
return response({ topic_list: { topics: [] } });
|
||||||
|
});
|
||||||
|
|
||||||
this.get('/clicks/track', success);
|
this.get('/clicks/track', success);
|
||||||
|
|
||||||
this.get('/search', request => {
|
this.get('/search', request => {
|
||||||
|
Reference in New Issue
Block a user