Merge pull request #4768 from MrZYX/manwithtwowatches-feature/4455-make-help-view-backbone-view

Make help pages a backbone view
This commit is contained in:
Jonne Haß 2014-02-09 20:05:09 +01:00
commit 90784b3b38
34 changed files with 582 additions and 551 deletions

View file

@ -1,5 +1,7 @@
app.Router = Backbone.Router.extend({
routes: {
"help": "help",
//new hotness
"posts/:id": "singlePost",
"p/:id": "singlePost",
@ -22,6 +24,12 @@ app.Router = Backbone.Router.extend({
"u/:name": "stream"
},
help: function() {
app.help = new app.views.Help();
$("#help").prepend(app.help.el);
app.help.render();
},
singlePost : function(id) {
this.renderPage(function(){ return new app.pages.SinglePostViewer({ id: id })});
},

View file

@ -99,6 +99,19 @@ app.views.Base = Backbone.View.extend({
});
});
}
}
},
});
app.views.StaticContentView = app.views.Base.extend({
initialize : function(options) {
this.templateName = options.templateName;
this.data = options.data;
return this;
},
presenter : function(){
return this.data;
},
});

View file

@ -0,0 +1,37 @@
app.views.FaqQuestionView = app.views.Base.extend({
templateName: "faq_question",
events: {
"click .question.collapsible a.toggle" : "toggled"
},
initialize : function(d) {
this.data = d;
return this;
},
presenter : function(){
return this.data;
},
render: function(){
var section = app.views.Base.prototype.render.apply(this, arguments);
// After render actions
this.$('.question.collapsible').removeClass('opened').addClass('collapsed');
this.$('.answer').hide();
return section;
},
toggled: function(e) {
el = $(e.target);
parent = el.parents('.question');
parent.children('.answer').toggle();
parent.toggleClass('opened').toggleClass('collapsed');
e.preventDefault();
},
});

View file

@ -0,0 +1,54 @@
app.views.HelpSectionView = app.views.StaticContentView.extend({
events: {
"click .question.collapsible a.toggle" : "toggled"
},
initialize : function(options) {
this.templateName = options.template;
this.data = this.makeSubs(options.data, options.subs);
return this;
},
render: function(){
var section = app.views.Base.prototype.render.apply(this, arguments);
// After render actions
this.$('.question.collapsible').removeClass('opened').addClass('collapsed');
this.$('.answer.hideable').hide();
this.$('.question.collapsible :first').addClass('opened').removeClass('collapsed');
this.$('.answer.hideable :first').show();
return section;
},
toggled: function(e) {
el = $(e.target);
parent = el.parents('.question');
parent.children('.answer.hideable').toggle();
parent.toggleClass('opened').toggleClass('collapsed');
e.preventDefault();
},
makeSubs: function(locales, subs) {
var self = this;
$.each( subs, function(k, vs){
if (locales.hasOwnProperty(k)){
$.each( vs, function(tag, rep){
locales[k] = self.replace(locales[k], tag, rep);
});
}
});
return locales;
},
replace: function(theString, tag, replacement){
return theString.replace("%{" + tag + "}", replacement);
},
});

View file

@ -1,13 +1,148 @@
$(document).ready(function() {
$('#faq .question.collapsible').removeClass('opened').addClass('collapsed');
$('#faq .question.collapsible .answer').hide();
app.views.Help = app.views.StaticContentView.extend({
templateName : "help",
$('#faq .question.collapsible :first').addClass('opened').removeClass('collapsed');
$('#faq .question.collapsible .answer :first').show();
events : {
"click .faq-link" : "sectionClicked",
"click .faq-link-getting-help" : "gettingHelp",
"click .faq-link-sharing" : "sharing",
"click .faq-link-posts-and-posting" : "postsAndPosting"
},
$('.question.collapsible a.toggle').click(function ( event ) {
event.preventDefault();
$(".answer", this.parentNode).toggle();
$(this.parentNode).toggleClass('opened').toggleClass('collapsed');
});
});
initialize : function(options) {
this.GETTING_HELP_SUBS = {
getting_started_a: { tutorial_series: this.linkHtml("http://diasporafoundation.org/getting_started/sign_up", Diaspora.I18n.t( 'getting_started_tutorial' )) },
get_support_a_website: { link: this.linkHtml("https://diasporafoundation.org/", Diaspora.I18n.t( 'foundation_website' ))},
get_support_a_tutorials: { tutorials: this.linkHtml("https://diasporafoundation.org/tutorials", Diaspora.I18n.t( 'tutorials' ))},
get_support_a_wiki: { link: this.linkHtml("https://wiki.diasporafoundation.org/Special:Search", Diaspora.I18n.t( 'wiki' ))},
get_support_a_irc: { irc: this.linkHtml("https://wiki.diasporafoundation.org/How_We_Communicate#IRC", Diaspora.I18n.t( 'irc' ))},
get_support_a_hashtag: { question: this.linkHtml("/tags/question", "#question")},
};
this.POSTS_AND_POSTING_SUBS = {
format_text_a: {
markdown: this.linkHtml("http://diasporafoundation.org/formatting", Diaspora.I18n.t( 'markdown' )),
here: this.linkHtml("http://daringfireball.net/projects/markdown/syntax", Diaspora.I18n.t( 'here' )),
}
};
this.data = {
title_getting_help: Diaspora.I18n.t( 'getting_help.title' ),
title_account_and_data_management: Diaspora.I18n.t( 'account_and_data_management.title' ),
title_aspects: Diaspora.I18n.t( 'aspects.title' ),
title_mentions: Diaspora.I18n.t( 'mentions.title' ),
title_pods: Diaspora.I18n.t( 'pods.title' ),
title_posts_and_posting: Diaspora.I18n.t( 'posts_and_posting.title' ),
title_private_posts: Diaspora.I18n.t( 'private_posts.title' ),
title_private_profiles: Diaspora.I18n.t( 'private_profiles.title' ),
title_public_posts: Diaspora.I18n.t( 'public_posts.title' ),
title_public_profiles: Diaspora.I18n.t( 'public_profiles.title' ),
title_resharing_posts: Diaspora.I18n.t( 'resharing_posts.title' ),
title_sharing: Diaspora.I18n.t( 'sharing.title' ),
title_tags: Diaspora.I18n.t( 'tags.title' ),
title_miscellaneous: Diaspora.I18n.t( 'miscellaneous.title' ),
}
return this;
},
render: function(){
var section = app.views.Base.prototype.render.apply(this, arguments);
// After render actions
this.resetMenu(true);
this.renderStaticSection("getting_help", "faq_getting_help", this.GETTING_HELP_SUBS);
return section;
},
showItems: function(el) {
this.clearItems();
var section = el.data('section');
var items = el.data('items').split(" ");
var self = this;
$.each(items, function(i, item){
var qa = {
className: "faq_question_" + section,
question: self.getText(section, item, true),
answer: self.getText(section, item, false)
};
item = new app.views.FaqQuestionView(qa);
self.$('#faq').append(item.render().el);
});
this.setInitialVisibility();
},
getText: function(section, name, question){
var q = question ? "_q" : "_a";
return Diaspora.I18n.t( section + '.' + name + q);
},
setInitialVisibility: function() {
this.$('#faq .question.collapsible :first').addClass('opened').removeClass('collapsed');
this.$('#faq .question.collapsible .answer :first').show();
},
resetMenu: function(initial) {
$('#faq_nav').find('.section-unselected').show();
$('#faq_nav').find('.section-selected').hide();
if(initial){
$('#faq_nav').find('.section-unselected :first').hide();
$('#faq_nav').find('.section-selected :first').show();
}
},
menuClicked: function(e) {
this.resetMenu();
$(e.target).hide();
$(e.target).next().show();
},
clearItems: function() {
this.$('#faq').empty();
},
sectionClicked : function(e) {
this.menuClicked(e);
this.showItems($(e.target));
e.preventDefault();
},
renderStaticSection: function(section, template, subs) {
this.clearItems();
data = $.extend(Diaspora.I18n.locale[section], { className: section });
help_section = new app.views.HelpSectionView({
template: template,
data: data,
subs: subs
});
this.$('#faq').append(help_section.render().el);
},
gettingHelp: function(e) {
this.renderStaticSection("getting_help", "faq_getting_help", this.GETTING_HELP_SUBS);
this.menuClicked(e);
e.preventDefault();
},
sharing: function(e) {
this.renderStaticSection("sharing", "faq_sharing", {});
this.menuClicked(e);
e.preventDefault();
},
postsAndPosting: function(e) {
this.renderStaticSection("posts_and_posting", "faq_posts_and_posting", this.POSTS_AND_POSTING_SUBS);
this.menuClicked(e);
e.preventDefault();
},
linkHtml: function(url, text) {
return "<a href=\"" + url + "\" target=\"_blank\">" + text + "</a>";
},
});

View file

@ -7,7 +7,7 @@
locale: {},
loadLocale: function(locale, language) {
this.locale = locale;
this.locale = $.extend(this.locale, locale);
this.language = language;
rule = this.t('pluralization_rule');
if (rule === "")

View file

@ -0,0 +1,22 @@
<div class='faq_getting_help'>
<h1>diaspora* FAQ</h1>
<br>
<div class='question opened'>
<h4>{{ getting_started_q }}}</h4>
<div class='answer'>
{{{ getting_started_a }}}
</div>
</div>
<div class='question opened'>
<h4>{{{ get_support_q }}}</h4>
<div class='answer'>
<ul>
<li>{{{ get_support_a_website }}}</li>
<li>{{{ get_support_a_tutorials }}}</li>
<li>{{{ get_support_a_wiki }}}</li>
<li>{{{ get_support_a_irc }}}</li>
<li>{{{ get_support_a_hashtag }}}</li>
</ul>
</div>
</div>
</div>

View file

@ -0,0 +1,69 @@
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ hide_posts_q }}</h4>
</a>
<div class='answer hideable'>{{ hide_posts_a }}</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ format_text_q }}</h4>
</a>
<div class='answer hideable'>
{{{ format_text_a }}}
</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ insert_images_q }}</h4>
</a>
<div class='answer hideable'>{{ insert_images_a }}</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ insert_images_comments_q }}</h4>
</a>
<div class='answer hideable'>
{{ insert_images_comments_a1 }}
<pre>![{{ image_text }}]( {{ image_url }})</pre>
{{ insert_images_comments_a2 }}
</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ size_of_images_q }}</h4>
</a>
<div class='answer hideable'>{{ size_of_images_a }}</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ embed_multimedia_q }}</h4>
</a>
<div class='answer hideable'>{{ embed_multimedia_a }}</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ character_limit_q }}</h4>
</a>
<div class='answer hideable'>{{ character_limit_a }}</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ char_limit_services_q }}</h4>
</a>
<div class='answer hideable'>{{ char_limit_services_a }}</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ stream_full_of_posts_q }}</h4>
</a>
<div class='answer hideable'>
{{ stream_full_of_posts_a1 }}
<ol>
<li>{{ stream_full_of_posts_li1 }}</li>
<li>{{ stream_full_of_posts_li2 }}</li>
<li>{{ stream_full_of_posts_li3 }}</li>
</ol>
</div>
</div>
</div>

View file

@ -0,0 +1,9 @@
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ question }}</h4>
</a>
<div class='answer hideable'>
{{ answer }}
</div>
</div>

View file

@ -0,0 +1,38 @@
<div class='faq_sharing'>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ add_to_aspect_q }}</h4>
</a>
<div class='answer hideable'>
{{ add_to_aspect_a1 }}
<ul>
<li>{{ add_to_aspect_li1 }}</li>
<li>{{ add_to_aspect_li2 }}</li>
<li>{{ add_to_aspect_li3 }}</li>
<li>{{ add_to_aspect_li4 }}</li>
<li>{{ add_to_aspect_li5 }}</li>
<li>{{ add_to_aspect_li6 }}</li>
<li>{{ add_to_aspect_li7 }}</li>
</ul>
{{ add_to_aspect_a2 }}
</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ only_sharing_q }}</h4>
</a>
<div class='answer hideable'>{{ only_sharing_a }}</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ list_not_sharing_q }}</h4>
</a>
<div class='answer hideable'>{{ list_not_sharing_a }}</div>
</div>
<div class='question opened collapsible'>
<a class='toggle' href='#'>
<h4>{{ see_old_posts_q }}</h4>
</a>
<div class='answer hideable'>{{ see_old_posts_a }}</div>
</div>
</div>

View file

@ -0,0 +1,69 @@
<div id="section_header">
<h2 class="help_header">Help</h2>
</div>
<div class="span-5">
<div id='faq_nav'>
<ul>
<li>
<a href="#" class="section-unselected faq-link-getting-help" data-section="getting_help" data-items="">{{ title_getting_help }}</a>
<span class="section-selected">{{ title_getting_help }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="account_and_data_management" data-items="move_pods download_data close_account data_visible_to_podmin data_other_podmins">{{ title_account_and_data_management }}</a>
<span class="section-selected">{{ title_account_and_data_management }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="aspects" data-items="what_is_an_aspect who_sees_post restrict_posts_i_see contacts_know_aspect contacts_visible remove_notification rename_aspect change_aspect_of_post post_multiple_aspects person_multiple_aspects delete_aspect">{{ title_aspects }}</a>
<span class="section-selected">{{ title_aspects }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="mentions" data-items="what_is_a_mention how_to_mention mention_in_comment see_mentions">{{ title_mentions }}</a>
<span class="section-selected">{{ title_mentions }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="pods" data-items="what_is_a_pod find_people use_search_box">{{ title_pods }}</a>
<span class="section-selected">{{ title_pods }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link-posts-and-posting" data-section="posts_and_posting" data-items="hide_posts format_text insert_images">{{ title_posts_and_posting }}</a>
<span class="section-selected">{{ title_posts_and_posting }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="private_posts" data-items="who_sees_post can_comment can_reshare see_comment">{{ title_private_posts }}</a>
<span class="section-selected">{{ title_private_posts }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="private_profiles" data-items="who_sees_profile whats_in_profile who_sees_updates">{{ title_private_profiles }}</a>
<span class="section-selected">{{ title_private_profiles }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="public_posts" data-items="who_sees_post find_public_post can_comment_reshare_like see_comment_reshare_like deselect_aspect_posting">{{ title_public_posts }}</a>
<span class="section-selected">{{ title_public_posts }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="public_profiles" data-items="who_sees_profile whats_in_profile who_sees_updates what_do_tags_do">{{ title_public_profiles }}</a>
<span class="section-selected">{{ title_public_profiles }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="resharing_posts" data-items="reshare_public_post_aspects reshare_private_post_aspects">{{ title_resharing_posts }}</a>
<span class="section-selected">{{ title_resharing_posts }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link-sharing" data-section="sharing" data-items="">{{ title_sharing }}</a>
<span class="section-selected">{{ title_sharing }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="tags" data-items="what_are_tags_for tags_in_comments followed_tags people_tag_page filter_tags">{{ title_tags }}</a>
<span class="section-selected">{{ title_tags }}</span>
</li>
<li>
<a href="#" class="section-unselected faq-link" data-section="miscellaneous" data-items="back_to_top photo_albums subscribe_feed diaspora_app">{{ title_miscellaneous }}</a>
<span class="section-selected">{{ title_miscellaneous }}</span>
</li>
</ul>
</div>
</div>
<div class="span-19 last" id=faq>
</div>

View file

@ -7,14 +7,14 @@ module LanguageHelper
options.sort_by { |o| o[0] }
end
def get_javascript_strings_for(language)
defaults = I18n.t('javascripts', :locale => DEFAULT_LANGUAGE)
def get_javascript_strings_for(language, section)
defaults = I18n.t(section, :locale => DEFAULT_LANGUAGE)
if language != DEFAULT_LANGUAGE
translations = I18n.t('javascripts', :locale => language)
translations = I18n.t(section, :locale => language)
defaults.deep_merge!(translations)
end
defaults['pluralization_rule'] = I18n.t('i18n.plural.js_rule', :locale => language)
defaults['pod_name'] = pod_name
defaults

View file

@ -28,10 +28,10 @@ module LayoutHelper
end
end
def load_javascript_locales
def load_javascript_locales(section = 'javascripts')
content_tag(:script) do
<<-JS.html_safe
Diaspora.I18n.loadLocale(#{get_javascript_strings_for(I18n.locale).to_json}, "#{I18n.locale}");
Diaspora.I18n.loadLocale(#{get_javascript_strings_for(I18n.locale, section).to_json}, "#{I18n.locale}");
Diaspora.Page = "#{params[:controller].camelcase}#{params[:action].camelcase}";
JS
end

View file

@ -1,16 +0,0 @@
#faq_nav
%ul
%li= link_to_unless_current t('help.getting_help.title'), faq_getting_help_path
%li= link_to_unless_current t('help.account_and_data_management.title'), faq_account_and_data_management_path
%li= link_to_unless_current t('help.aspects.title'), faq_aspects_path
%li= link_to_unless_current t('help.mentions.title'), faq_mentions_path
%li= link_to_unless_current t('help.pods.title'), faq_pods_path
%li= link_to_unless_current t('help.posts_and_posting.title'), faq_posts_and_posting_path
%li= link_to_unless_current t('help.private_profiles.title'), faq_private_profiles_path
%li= link_to_unless_current t('help.private_posts.title'), faq_private_posts_path
%li= link_to_unless_current t('help.public_posts.title'), faq_public_posts_path
%li= link_to_unless_current t('help.public_profiles.title'), faq_public_profiles_path
%li= link_to_unless_current t('help.resharing_posts.title'), faq_resharing_posts_path
%li= link_to_unless_current t('help.sharing.title'), faq_sharing_path
%li= link_to_unless_current t('help.tags.title'), faq_tags_path
%li= link_to_unless_current t('help.miscellaneous.title'), faq_miscellaneous_path

View file

@ -1,2 +0,0 @@
%ul#help_nav
%li= link_to_unless_current t('help.faq.title'), faq_path

View file

@ -1,35 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.move_pods_q')
.answer= t('.move_pods_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.download_data_q')
.answer= t('.download_data_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.close_account_q')
.answer= t('.close_account_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.data_visible_to_podmin_q')
.answer= t('.data_visible_to_podmin_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.data_other_podmins_q')
.answer= t('.data_other_podmins_a')

View file

@ -1,59 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.what_is_an_aspect_q')
.answer= t('.what_is_an_aspect_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.who_sees_post_q')
.answer= t('.who_sees_post_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.restrict_posts_i_see_q')
.answer= t('.restrict_posts_i_see_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.contacts_know_aspect_q')
.answer= t('.contacts_know_aspect_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.contacts_visible_q')
.answer= t('.contacts_visible_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.remove_notification_q')
.answer= t('.remove_notification_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.rename_aspect_q')
.answer= t('.rename_aspect_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.change_aspect_of_post_q')
.answer= t('.change_aspect_of_post_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.post_multiple_aspects_q')
.answer= t('.post_multiple_aspects_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.person_multiple_aspects_q')
.answer= t('.person_multiple_aspects_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.delete_aspect_q')
.answer= t('.delete_aspect_a')

View file

@ -0,0 +1,11 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :head do
= load_javascript_locales("help")
- content_for :page_title do
= t('_help')
#help

View file

@ -1,29 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
%h1 diaspora* FAQ
%br
.question.opened
%h4= t('.getting_started_q')
.answer!= t('.getting_started_a', :tutorial_series => link_to(t('help.getting_started_tutorial'), 'http://diasporafoundation.org/getting_started/sign_up', :target => '_blank'))
.question.opened
%h4= t('.get_support_q')
.answer
%ul
%li!= t('.get_support_a_website', :link => link_to(t('help.foundation_website'), 'https://diasporafoundation.org', :target => '_blank'))
%li!= t('.get_support_a_tutorials', :tutorials => link_to(t('help.tutorials'), 'https://diasporafoundation.org/tutorials', :target => '_blank'))
%li!= t('.get_support_a_wiki', :link => link_to(t('help.wiki'), 'https://wiki.diasporafoundation.org/Special:Search', :target => '_blank'))
%li!= t('.get_support_a_irc', :irc => link_to(t('help.irc'), 'https://wiki.diasporafoundation.org/How_We_Communicate#IRC', :target => '_blank'))
%li!= t('.get_support_a_hashtag', :question => link_to("#"+t('aspects.index.help.tag_question'), tag_path(:name => t('aspects.index.help.tag_question'))))

View file

@ -1,31 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.what_is_a_mention_q')
.answer= t('.what_is_a_mention_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.how_to_mention_q')
.answer= t('.how_to_mention_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.mention_in_comment_q')
.answer= t('.mention_in_comment_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.see_mentions_q')
.answer= t('.see_mentions_a')

View file

@ -1,31 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.back_to_top_q')
.answer= t('.back_to_top_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.photo_albums_q')
.answer= t('.photo_albums_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.subscribe_feed_q')
.answer= t('.subscribe_feed_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.diaspora_app_q')
.answer= t('.diaspora_app_a')

View file

@ -1,27 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.what_is_a_pod_q')
.answer= t('.what_is_a_pod_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.find_people_q')
.answer= t('.find_people_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.use_search_box_q')
.answer= t('.use_search_box_a')

View file

@ -1,60 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.hide_posts_q')
.answer= t('.hide_posts_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.format_text_q')
.answer!= t('.format_text_a', :markdown => link_to(t('help.markdown'), 'http://diasporafoundation.org/formatting', :target => '_blank'), :here => link_to(t('help.here'), 'http://daringfireball.net/projects/markdown/syntax', :target => '_blank'))
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.insert_images_q')
.answer= t('.insert_images_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.insert_images_comments_q')
.answer
=t('.insert_images_comments_a1')
%pre
= '![' + t('.image_text') + '](' + t('.image_url') + ')'
=t('.insert_images_comments_a2')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.size_of_images_q')
.answer= t('.size_of_images_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.embed_multimedia_q')
.answer= t('.embed_multimedia_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.character_limit_q')
.answer= t('.character_limit_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.char_limit_services_q')
.answer= t('.char_limit_services_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.stream_full_of_posts_q')
.answer
= t('.stream_full_of_posts_a1')
%ol
%li= t('.stream_full_of_posts_li1')
%li= t('.stream_full_of_posts_li2')
%li= t('.stream_full_of_posts_li3')

View file

@ -1,31 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.who_sees_post_q')
.answer= t('.who_sees_post_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.can_comment_q')
.answer= t('.can_comment_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.can_reshare_q')
.answer= t('.can_reshare_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.see_comment_q')
.answer= t('.see_comment_a')

View file

@ -1,27 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.who_sees_profile_q')
.answer= t('.who_sees_profile_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.whats_in_profile_q')
.answer= t('.whats_in_profile_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.who_sees_updates_q')
.answer= t('.who_sees_updates_a')

View file

@ -1,35 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.who_sees_post_q')
.answer= t('.who_sees_post_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.find_public_post_q')
.answer= t('.find_public_post_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.can_comment_reshare_like_q')
.answer= t('.can_comment_reshare_like_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.see_comment_reshare_like_q')
.answer= t('.see_comment_reshare_like_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.deselect_aspect_posting_q')
.answer= t('.deselect_aspect_posting_a')

View file

@ -1,31 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.who_sees_profile_q')
.answer= t('.who_sees_profile_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.whats_in_profile_q')
.answer= t('.whats_in_profile_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.who_sees_updates_q')
.answer= t('.who_sees_updates_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.what_do_tags_do_q')
.answer= t('.what_do_tags_do_a')

View file

@ -1,23 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.reshare_public_post_aspects_q')
.answer= t('.reshare_public_post_aspects_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.reshare_private_post_aspects_q')
.answer= t('.reshare_private_post_aspects_a')

View file

@ -1,41 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.add_to_aspect_q')
.answer
= t('.add_to_aspect_a1')
%ul
%li=t('.add_to_aspect_li1')
%li=t('.add_to_aspect_li2')
%li=t('.add_to_aspect_li3')
%li=t('.add_to_aspect_li4')
%li=t('.add_to_aspect_li5')
%li=t('.add_to_aspect_li6')
%li=t('.add_to_aspect_li7')
=t('.add_to_aspect_a2')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.only_sharing_q')
.answer= t('.only_sharing_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.list_not_sharing_q')
.answer= t('.list_not_sharing_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.see_old_posts_q')
.answer= t('.see_old_posts_a')

View file

@ -1,35 +0,0 @@
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- content_for :page_title do
= t('_help')
#section_header
%h2
= t('_help')
//= render('help_nav')
.span-5
= render('faq_nav')
.span-19.last#faq
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.what_are_tags_for_q')
.answer= t('.what_are_tags_for_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.tags_in_comments_q')
.answer= t('.tags_in_comments_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.followed_tags_q')
.answer= t('.followed_tags_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.people_tag_page_q')
.answer= t('.people_tag_page_a')
.question.opened.collapsible
%a.toggle{ :href => '#' }
%h4= t('.filter_tags_q')
.answer!= t('.filter_tags_a', :third_party_tools => link_to(t('help.third_party_tools'), 'https://wiki.diasporafoundation.org/Tools_to_use_with_Diaspora', :target => '_blank'))

View file

@ -41,7 +41,7 @@
%br
%p
!= t('aspects.index.help.tutorials_and_wiki',
:faq => link_to(t('_help'), faq_getting_help_path),
:faq => link_to(t('_help'), help_path),
:tutorial => link_to(t('aspects.index.help.tutorial_link_text'), "https://diasporafoundation.org/tutorials", :target => '_blank'),
:wiki => link_to('Wiki','http://wiki.diasporafoundation.org', :target => '_blank'), :target => '_blank')

View file

@ -205,24 +205,8 @@ Diaspora::Application.routes.draw do
get 'mobile/toggle', :to => 'home#toggle_mobile', :as => 'toggle_mobile'
# Help
get 'help' => 'help#getting_help', :as => 'faq_getting_help'
scope path: "/help/faq", :controller => :help, :as => 'faq' do
get :account_and_data_management
get :aspects
get :mentions
get :miscellaneous
get :pods
get :posts_and_posting
get :private_posts
get :private_profiles
get :public_posts
get :public_profiles
get :resharing_posts
get :sharing
get :tags
end
# help
get 'help' => 'help#faq', :as => 'help'
#Protocol Url
get 'protocol' => redirect("http://wiki.diasporafoundation.org/Federation_Protocol_Overview")

File diff suppressed because one or more lines are too long

View file

@ -28,6 +28,16 @@ describe("Diaspora", function() {
expect(Diaspora.I18n.locale).toEqual(locale);
});
it("extends the class's locale variable on multiple calls", function() {
var data = {another: 'section'},
extended = $.extend(locale, data);
Diaspora.I18n.loadLocale(locale);
Diaspora.I18n.loadLocale(data;
expect(Diaspora.I18n.locale).toEqual(extended);
});
});
describe("t", function() {