summaryrefslogtreecommitdiff
path: root/addons/website_forum/static/src
diff options
context:
space:
mode:
authorTurkesh Patel (Open ERP) <tpa@tinyerp.com>2014-02-21 18:46:08 +0530
committerTurkesh Patel (Open ERP) <tpa@tinyerp.com>2014-02-21 18:46:08 +0530
commitd743ac0a8369860b950b3d137c2fa648585e070e (patch)
treec0413a5637a7ee06e1f3f5520520e5a6450f2342 /addons/website_forum/static/src
parentd24b67ed3ec568e3eb5b4296519e28a2721314b2 (diff)
[ADD] website_forum for question and answer
bzr revid: tpa@tinyerp.com-20140221131608-e37a88h2u8ljkomr
Diffstat (limited to 'addons/website_forum/static/src')
-rw-r--r--addons/website_forum/static/src/css/Makefile2
-rw-r--r--addons/website_forum/static/src/css/website_forum.css55
-rw-r--r--addons/website_forum/static/src/css/website_forum.sass5
-rw-r--r--addons/website_forum/static/src/js/website.tour.forum.js31
-rw-r--r--addons/website_forum/static/src/js/website_forum.editor.js31
-rw-r--r--addons/website_forum/static/src/xml/website_forum.xml7
6 files changed, 131 insertions, 0 deletions
diff --git a/addons/website_forum/static/src/css/Makefile b/addons/website_forum/static/src/css/Makefile
new file mode 100644
index 00000000000..8d2edfb2ed2
--- /dev/null
+++ b/addons/website_forum/static/src/css/Makefile
@@ -0,0 +1,2 @@
+sass:
+ sass --compass --unix-newlines -t expanded website_forum.sass:website_forum.css
diff --git a/addons/website_forum/static/src/css/website_forum.css b/addons/website_forum/static/src/css/website_forum.css
new file mode 100644
index 00000000000..46e39282f90
--- /dev/null
+++ b/addons/website_forum/static/src/css/website_forum.css
@@ -0,0 +1,55 @@
+@charset "utf-8";
+@import url(compass/css3.css);
+
+.MainBody{
+ max-width: 700px;
+}
+.AskButton{
+ float: right;
+}
+.search-navbar{
+ width: 80%;
+}
+.user-profile-image{
+ height: 32px;
+ width: 32px;
+}
+.action-links{
+ margin-left: 10px;
+ margin-right: 10px;
+}
+.like{
+ color: green;
+}
+.badge-gold{
+ color : #FFD700;
+ text-shadow: 0px 0px 10px yellow;
+}
+.badge-silver{
+ color : #C0C0C0;
+ text-shadow: 0px 0px 10px yellow;
+}
+.badge-bronze{
+ color : #8c7853;
+ text-shadow: 0px 0px 10px yellow;
+}
+.-heading{
+ background-color: #428bca;
+ color: white;
+}
+.user-name-pannel{
+ height: 20px;
+}
+.custom-arrow-height{
+ height: 15px;
+ }
+.custom-vote-height{
+ height: 30px;
+}
+.correct-answer{
+ color: green;
+}
+.user-big-profile-image{
+ height: 140px;
+ width: 140px;
+} \ No newline at end of file
diff --git a/addons/website_forum/static/src/css/website_forum.sass b/addons/website_forum/static/src/css/website_forum.sass
new file mode 100644
index 00000000000..02b3490d630
--- /dev/null
+++ b/addons/website_forum/static/src/css/website_forum.sass
@@ -0,0 +1,5 @@
+@charset "utf-8"
+
+@import "compass/css3"
+
+
diff --git a/addons/website_forum/static/src/js/website.tour.forum.js b/addons/website_forum/static/src/js/website.tour.forum.js
new file mode 100644
index 00000000000..143996e5c38
--- /dev/null
+++ b/addons/website_forum/static/src/js/website.tour.forum.js
@@ -0,0 +1,31 @@
+(function () {
+ 'use strict';
+
+ var website = openerp.website;
+ var _t = openerp._t;
+
+ website.EditorBar.include({
+ start: function () {
+ this.registerTour(new website.QuestionTour(this));
+ return this._super();
+ },
+ });
+
+ website.QuestionTour = website.Tour.extend({
+ id: 'question',
+ name: "Create a question",
+ testPath: '/question(/[0-9]+/register)?',
+ init: function (editor) {
+ var self = this;
+ self.steps = [
+ {
+ title: _t("Create a question"),
+ content: _t("Let's go through the first steps to create a new question."),
+ popover: { next: _("Start Tutorial"), end: _("Skip It") },
+ },
+ ];
+ return this._super();
+ }
+ });
+
+}());
diff --git a/addons/website_forum/static/src/js/website_forum.editor.js b/addons/website_forum/static/src/js/website_forum.editor.js
new file mode 100644
index 00000000000..fc4dd863739
--- /dev/null
+++ b/addons/website_forum/static/src/js/website_forum.editor.js
@@ -0,0 +1,31 @@
+(function() {
+ "use strict";
+
+ var website = openerp.website;
+ var _t = openerp._t;
+ website.add_template_file('/website_forum/static/src/xml/website_forum.xml');
+
+ website.is_editable = true;
+ website.EditorBar.include({
+ start: function() {
+ website.is_editable_button = website.is_editable_button || !!$("#wrap.js_event").size();
+ var res = this._super();
+ this.$(".dropdown:has(.oe_content_menu)").removeClass("hidden");
+ return res;
+ },
+ events: _.extend({}, website.EditorBar.prototype.events, {
+ 'click a[data-action=new_question]': function (ev) {
+ ev.preventDefault();
+ website.prompt({
+ id: "editor_new_question",
+ window_title: _t("New Question"),
+ input: "Question Name",
+ }).then(function (question_name) {
+ website.form('/forum/add_question', 'POST', {
+ question_name: question_name
+ });
+ });
+ }
+ }),
+ });
+})();
diff --git a/addons/website_forum/static/src/xml/website_forum.xml b/addons/website_forum/static/src/xml/website_forum.xml
new file mode 100644
index 00000000000..78042288b23
--- /dev/null
+++ b/addons/website_forum/static/src/xml/website_forum.xml
@@ -0,0 +1,7 @@
+<templates id="template" xml:space="preserve">
+<t t-extend="website.editorbar">
+ <t t-jquery="ul.oe_content_menu" t-operation="append">
+ <li><a href="#" data-action="new_question">New Question</a></li>
+ </t>
+</t>
+</templates>