Minor refactoring to help with Tags RSS
This commit is contained in:
parent
e207ca36ee
commit
8ec4d07bf2
|
@ -2,30 +2,11 @@
|
|||
This mixin provides a `currentUser` property that can be used to retrieve information
|
||||
about the currently logged in user. It is mostly useful to controllers so it can be
|
||||
exposted to templates.
|
||||
|
||||
Outside of templates, code should probably use `Discourse.User.current()` instead of
|
||||
this property.
|
||||
|
||||
@class Discourse.HasCurrentUser
|
||||
@extends Ember.Mixin
|
||||
@namespace Discourse
|
||||
@module HasCurrentUser
|
||||
**/
|
||||
Discourse.HasCurrentUser = Em.Mixin.create({
|
||||
|
||||
/**
|
||||
Returns a reference to the currently logged in user.
|
||||
|
||||
@method currentUser
|
||||
@return {Discourse.User} the currently logged in user if present.
|
||||
*/
|
||||
currentUser: function() {
|
||||
return Discourse.User.current();
|
||||
}.property().volatile()
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
</div>
|
||||
|
||||
|
||||
<% if @list.topics.length > 0 %>
|
||||
<% if @list.topics.length > 0 && @list.more_topics_url %>
|
||||
<p>
|
||||
<% if params[:page].to_i > 0 %>
|
||||
<a href="<%= @list.prev_topics_url.sub('.json?','?') %>" rel="prev"><%= t 'prev_page'%></a>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<author><%= "no-reply@example.com (@#{topic.user.username}#{" #{topic.user.name}" if (topic.user.name.present? && SiteSetting.enable_names?)})" -%></author>
|
||||
<category><%= topic.category.name %></category>
|
||||
<description><![CDATA[
|
||||
<p><%= t('author_wrote', author: link_to("@#{topic.user.username}", user_url(topic.user.username_lower))).html_safe %></p>
|
||||
<p><%= t('author_wrote', author: link_to("@#{topic.user.username}", "#{Discourse.base_url}/users/#{topic.user.username_lower}")).html_safe %></p>
|
||||
<blockquote>
|
||||
<%= topic.posts.first.cooked.html_safe %>
|
||||
</blockquote>
|
||||
|
|
|
@ -12,7 +12,7 @@ module TopicListResponder
|
|||
format.html do
|
||||
@list = list
|
||||
store_preloaded(list.preload_key, MultiJson.dump(TopicListSerializer.new(list, scope: guardian)))
|
||||
render 'list'
|
||||
render 'list/list'
|
||||
end
|
||||
format.json do
|
||||
render_serialized(list, TopicListSerializer)
|
||||
|
|
Loading…
Reference in New Issue