diff --git a/app/assets/javascripts/app/views/help_view.js b/app/assets/javascripts/app/views/help_view.js
index ffd773b20..168715e55 100644
--- a/app/assets/javascripts/app/views/help_view.js
+++ b/app/assets/javascripts/app/views/help_view.js
@@ -9,7 +9,8 @@ app.views.Help = app.views.StaticContentView.extend({
"click .faq-link-sharing" : "sharing",
"click .faq-link-posts-and-posting" : "postsAndPosting",
"click .faq-link-tags": "tags",
- "click .faq-link-keyboard-shortcuts" : "keyboardShortcuts"
+ "click .faq-link-keyboard-shortcuts" : "keyboardShortcuts",
+ "click .faq-link-chat" : "chat"
},
initialize : function() {
@@ -35,6 +36,13 @@ app.views.Help = app.views.StaticContentView.extend({
}
};
+ this.CHAT_SUBS = {
+ add_contact_roster_a: {
+ toggle_privilege: this.getChatIcons(),
+ contacts_page: this.linkHtml(Routes.contacts_path(), Diaspora.I18n.t('chat.contacts_page'))
+ }
+ };
+
this.data = {
title_header: Diaspora.I18n.t( 'title_header' ),
title_getting_help: Diaspora.I18n.t( 'getting_help.title' ),
@@ -51,7 +59,9 @@ app.views.Help = app.views.StaticContentView.extend({
title_sharing: Diaspora.I18n.t( 'sharing.title' ),
title_tags: Diaspora.I18n.t( 'tags.title' ),
title_keyboard_shortcuts: Diaspora.I18n.t( 'keyboard_shortcuts.title' ),
- title_miscellaneous: Diaspora.I18n.t( 'miscellaneous.title' )
+ title_miscellaneous: Diaspora.I18n.t( 'miscellaneous.title' ),
+ title_chat: Diaspora.I18n.t( 'chat.title' ),
+ chat_enabled: this.chatEnabled()
};
return this;
@@ -143,7 +153,7 @@ app.views.Help = app.views.StaticContentView.extend({
/**
* Returns The section title whose data-section property equals the given query
* Returns null if nothing found
- * @param dataValue Value for the data-section to find
+ * @param data Value for the data-section to find
* @returns {jQuery}
*/
findSection: function(data){
@@ -187,8 +197,27 @@ app.views.Help = app.views.StaticContentView.extend({
e.preventDefault();
},
+ chat: function(e){
+ this.renderStaticSection("chat", "faq_chat", this.CHAT_SUBS);
+ this.menuClicked(e);
+
+ e.preventDefault();
+ },
+
linkHtml: function(url, text) {
return "" + text + "";
+ },
+
+ chatEnabled: function(){
+ return gon.chatEnabled;
+ },
+
+ getChatIcons: function(){
+ return '
' +
+ ' ' +
+ ' ' +
+ ' ' +
+ '
';
}
});
// @license-end
diff --git a/app/assets/stylesheets/help.css.scss b/app/assets/stylesheets/help.css.scss
index f6075d679..56fde842e 100644
--- a/app/assets/stylesheets/help.css.scss
+++ b/app/assets/stylesheets/help.css.scss
@@ -91,6 +91,18 @@ ul#help_nav {
border-radius: 0px 0px 4px 4px;
background-color: white;
padding: 10px 20px;
+
+ div.help-chat-icons{
+ text-align: center;
+ font-size: 50px;
+ line-height: 70px;
+
+ i.entypo{
+ color: #bfbfbf;
+
+ &.chat{ color: #000000; }
+ }
+ }
}
}
}
diff --git a/app/assets/templates/faq_chat_tpl.jst.hbs b/app/assets/templates/faq_chat_tpl.jst.hbs
new file mode 100644
index 000000000..fb3633345
--- /dev/null
+++ b/app/assets/templates/faq_chat_tpl.jst.hbs
@@ -0,0 +1,6 @@
+
\ No newline at end of file
diff --git a/app/assets/templates/help_tpl.jst.hbs b/app/assets/templates/help_tpl.jst.hbs
index 22c198186..f8f01e7ac 100644
--- a/app/assets/templates/help_tpl.jst.hbs
+++ b/app/assets/templates/help_tpl.jst.hbs
@@ -68,6 +68,12 @@
{{ title_miscellaneous }}
{{ title_miscellaneous }}
+ {{#if chat_enabled }}
+
+ {{ title_chat }}
+ {{ title_chat }}
+
+ {{/if}}
diff --git a/app/controllers/help_controller.rb b/app/controllers/help_controller.rb
index 0e3e05f6e..8d39d3b4a 100644
--- a/app/controllers/help_controller.rb
+++ b/app/controllers/help_controller.rb
@@ -1,4 +1,8 @@
class HelpController < ApplicationController
- before_filter -> { @css_framework = :bootstrap }
- layout ->(c) { request.format == :mobile ? "application" : "with_header_with_footer" }
-end
+ before_filter -> { @css_framework = :bootstrap }
+ layout -> (c) { request.format == :mobile ? "application" : "with_header_with_footer" }
+
+ def faq
+ gon.chatEnabled = AppConfig.chat.enabled?
+ end
+end
\ No newline at end of file
diff --git a/config/locales/diaspora/en.yml b/config/locales/diaspora/en.yml
index 04d3c2965..b137d13a3 100644
--- a/config/locales/diaspora/en.yml
+++ b/config/locales/diaspora/en.yml
@@ -449,6 +449,11 @@ en:
person_multiple_aspects_a: "Yes. Go to your contacts page and click on “My contacts”. For each contact you can use the menu on the right to add them to (or remove them from) as many aspects as you want. Or you can add them to a new aspect (or remove them from an aspect) by clicking the aspect selector button on their profile page. Or you can even just move the pointer over their name where you see it in the stream, and a “hover-card” will appear. You can change the aspects they are in right there."
delete_aspect_q: "How do I delete an aspect?"
delete_aspect_a: "In your list of aspects on the left side of the main page, point your mouse at the aspect you want to delete. Click the little “Edit” pencil that appears on the right. Click the “Delete this aspect” button in the box that appears."
+ chat:
+ title: "Chat"
+ contacts_page: "contacts page"
+ add_contact_roster_q: "How do I chat with someone in diaspora*?"
+ add_contact_roster_a: "First, you need to enable chat for one of the aspects that person is in. To do so, go to the %{contacts_page}, select the aspect you want and click on the chat icon to enable chat for the aspect. %{toggle_privilege} You could, if you prefer, create a special aspect called 'Chat' and add the people you want to chat with to that aspect. Once you've done this, open the chat interface and select the person you want to chat with."
mentions:
title: "Mentions"
what_is_a_mention_q: "What is a \"mention\"?"
diff --git a/spec/javascripts/app/views/help_view_spec.js b/spec/javascripts/app/views/help_view_spec.js
index c19567d25..7a2555a3f 100644
--- a/spec/javascripts/app/views/help_view_spec.js
+++ b/spec/javascripts/app/views/help_view_spec.js
@@ -134,4 +134,30 @@ describe("app.views.Help", function(){
});
});
});
+
+ describe("chat section", function(){
+ describe("chat enabled", function(){
+ beforeEach(function(){
+ gon.chatEnabled = true;
+ this.view = new app.views.Help();
+ this.view.render();
+ });
+
+ it('should display the chat', function(){
+ expect(this.view.$el.find('a[data-section=chat]').length).toBe(1);
+ });
+ });
+
+ describe("chat disabled", function(){
+ beforeEach(function(){
+ gon.chatEnabled = false;
+ this.view = new app.views.Help();
+ this.view.render();
+ });
+
+ it('should not display the chat', function () {
+ expect(this.view.$el.find('a[data-section=chat]').length).toBe(0);
+ });
+ });
+ });
});