Merge pull request #3225 from techAPJ/patch-3
UX: unified About / Privacy / ToS / FAQ topnav
This commit is contained in:
commit
0f4693b7eb
|
@ -1,6 +1,8 @@
|
|||
import ObjectController from 'discourse/controllers/object';
|
||||
|
||||
export default ObjectController.extend({
|
||||
faqOverriden: Ember.computed.gt('siteSettings.faq_url.length', 0),
|
||||
|
||||
contactInfo: function() {
|
||||
if (Discourse.SiteSettings.contact_email) {
|
||||
return I18n.t('about.contact_info', {contact_email: Discourse.SiteSettings.contact_email});
|
||||
|
|
|
@ -1,4 +1,18 @@
|
|||
<div class='container body-page'>
|
||||
<div class='container'>
|
||||
<div class='contents clearfix body-page'>
|
||||
|
||||
<ul class="nav-pills">
|
||||
<li class="nav-item-about">{{#link-to 'about' class="active"}}{{i18n 'about.simple_title'}}{{/link-to}}</li>
|
||||
{{#if faqOverriden}}
|
||||
<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>
|
||||
{{else}}
|
||||
<li class="nav-item-faq">{{#link-to 'faq'}}{{i18n 'faq'}}{{/link-to}}</li>
|
||||
{{/if}}
|
||||
<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>
|
||||
</ul>
|
||||
|
||||
<section class='about'>
|
||||
<h2>{{i18n 'about.title' title=title}}</h2>
|
||||
<p>{{description}}</p>
|
||||
|
@ -79,4 +93,5 @@
|
|||
</section>
|
||||
{{/if}}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
{{#link-to 'user' user.username}}
|
||||
{{avatar user imageSize="tiny"}}
|
||||
{{user.username}}
|
||||
{{#if user.name}}
|
||||
({{user.name}})
|
||||
{{/if}}
|
||||
{{/link-to}}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
class AboutSerializer < ApplicationSerializer
|
||||
has_many :moderators, serializer: BasicUserSerializer, embed: :objects
|
||||
has_many :admins, serializer: BasicUserSerializer, embed: :objects
|
||||
has_many :moderators, serializer: UserNameSerializer, embed: :objects
|
||||
has_many :admins, serializer: UserNameSerializer, embed: :objects
|
||||
|
||||
attributes :stats,
|
||||
:description,
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
class UserNameSerializer < ApplicationSerializer
|
||||
attributes :id, :username, :name, :uploaded_avatar_id, :avatar_template
|
||||
|
||||
def include_name?
|
||||
SiteSetting.enable_names?
|
||||
end
|
||||
|
||||
def avatar_template
|
||||
if Hash === object
|
||||
User.avatar_template(user[:username], user[:uploaded_avatar_id])
|
||||
else
|
||||
object.avatar_template
|
||||
end
|
||||
end
|
||||
|
||||
def user
|
||||
object[:user] || object
|
||||
end
|
||||
|
||||
end
|
|
@ -1,4 +1,5 @@
|
|||
<ul class="nav-pills">
|
||||
<li class="nav-item-about"><%= link_to t('about'), '/about' %></a></li>
|
||||
<% if @faq_overriden %>
|
||||
<li class="nav-item-guidelines"><a class="<%= @page == 'faq' ? 'active' : '' %>" href="<%=guidelines_path%>"><%=t "guidelines" %></a></li>
|
||||
<li class="nav-item-faq"><a href="<%=faq_path%>"><%=t "js.faq" %></a></li>
|
||||
|
|
|
@ -1955,6 +1955,7 @@ en:
|
|||
color_schemes:
|
||||
base_theme_name: "Base"
|
||||
|
||||
about: "About"
|
||||
guidelines: "Guidelines"
|
||||
privacy: "Privacy"
|
||||
|
||||
|
|
Loading…
Reference in New Issue