diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-09-14 19:59:20 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-09-14 19:59:20 -0400 |
commit | f76dd3c8b60ddf4fa16dc19a3f5eb8089dee59c1 (patch) | |
tree | c4d69a211463e5608dedad1ffdfd504836e4cef5 /askbot/skins | |
parent | 9835aedf1127f021f1d50e616aef8c8bd825571e (diff) | |
download | askbot-f76dd3c8b60ddf4fa16dc19a3f5eb8089dee59c1.tar.gz askbot-f76dd3c8b60ddf4fa16dc19a3f5eb8089dee59c1.tar.bz2 askbot-f76dd3c8b60ddf4fa16dc19a3f5eb8089dee59c1.zip |
group description editing works again
Diffstat (limited to 'askbot/skins')
-rw-r--r-- | askbot/skins/common/media/js/post.js | 21 | ||||
-rw-r--r-- | askbot/skins/default/templates/macros.html | 4 | ||||
-rw-r--r-- | askbot/skins/default/templates/users.html | 4 | ||||
-rw-r--r-- | askbot/skins/default/templates/widgets/group_info.html | 4 |
4 files changed, 22 insertions, 11 deletions
diff --git a/askbot/skins/common/media/js/post.js b/askbot/skins/common/media/js/post.js index 71718199..4c0dfa67 100644 --- a/askbot/skins/common/media/js/post.js +++ b/askbot/skins/common/media/js/post.js @@ -2242,7 +2242,7 @@ TinyMCE.prototype.start = function() { TinyMCE.prototype.setPreviewerEnabled = function() {}; TinyMCE.prototype.setText = function(text) { - askbot['data']['editorContent'] = text; + this._text = text; }; TinyMCE.prototype.getText = function() { @@ -2264,6 +2264,7 @@ TinyMCE.prototype.loadEditor = function() { success: function(data) { if (data['success']) { editorBox.html(data['html']); + editorBox.find('textarea').val(me._text);//@todo: fixme $.each(data['scripts'], function(idx, scriptData) { var scriptElement = me.makeElement('script'); scriptElement.attr('type', 'text/javascript'); @@ -2288,6 +2289,7 @@ TinyMCE.prototype.createDom = function() { /** * @constructor + * @todo: change this to generic object description editor */ var TagWikiEditor = function(){ WrappedElement.call(this); @@ -2362,10 +2364,14 @@ TagWikiEditor.prototype.setEditorLoaded = function(){ TagWikiEditor.prototype.startActivatingEditor = function(){ var editor = this._editor; var me = this; + var data = { + object_id: me.getTagId(), + model_name: 'Group' + }; $.ajax({ type: 'GET', - url: askbot['urls']['load_tag_wiki_text'], - data: {tag_id: me.getTagId()}, + url: askbot['urls']['load_object_description'], + data: data, cache: false, success: function(data){ me.backupContent(); @@ -2383,11 +2389,16 @@ TagWikiEditor.prototype.startActivatingEditor = function(){ TagWikiEditor.prototype.saveData = function(){ var me = this; var text = this._editor.getText(); + var data = { + object_id: me.getTagId(), + model_name: 'Group',//todo: fixme + text: text + }; $.ajax({ type: 'POST', dataType: 'json', - url: askbot['urls']['save_tag_wiki_text'], - data: {tag_id: me.getTagId(), text: text}, + url: askbot['urls']['save_object_description'], + data: data, cache: false, success: function(data){ if (data['success']){ diff --git a/askbot/skins/default/templates/macros.html b/askbot/skins/default/templates/macros.html index d1732ee5..8e578dec 100644 --- a/askbot/skins/default/templates/macros.html +++ b/askbot/skins/default/templates/macros.html @@ -222,8 +222,8 @@ poor design of the data or methods on data objects #} {% endif %} <td> <span class="group-description"> - {% if group.tag_wiki %} - {{ group.tag_wiki.summary }} + {% if group.description %} + {{ group.description.summary }} {% endif %} </span> {% if membership_info %} diff --git a/askbot/skins/default/templates/users.html b/askbot/skins/default/templates/users.html index a159dee1..a1c4ed11 100644 --- a/askbot/skins/default/templates/users.html +++ b/askbot/skins/default/templates/users.html @@ -84,8 +84,8 @@ var Attacklab = Attacklab || {}; Attacklab.wmd = 1;{# a trick to launch wmd manually #} askbot['urls']['upload'] = '{% url upload %}'; - askbot['urls']['load_tag_wiki_text'] = '{% url load_tag_wiki_text %}'; - askbot['urls']['save_tag_wiki_text'] = '{% url save_tag_wiki_text %}'; + askbot['urls']['load_object_description'] = '{% url load_object_description %}'; + askbot['urls']['save_object_description'] = '{% url save_object_description %}'; askbot['urls']['save_group_logo_url'] = '{% url save_group_logo_url %}'; askbot['urls']['delete_group_logo_url'] = '{% url delete_group_logo %}'; askbot['urls']['join_or_leave_group'] = '{% url join_or_leave_group %}'; diff --git a/askbot/skins/default/templates/widgets/group_info.html b/askbot/skins/default/templates/widgets/group_info.html index 0ce93d18..cba8177a 100644 --- a/askbot/skins/default/templates/widgets/group_info.html +++ b/askbot/skins/default/templates/widgets/group_info.html @@ -9,8 +9,8 @@ {% endif %} /> <div class="content"> - {% if group.tag_wiki %} - {{ group.tag_wiki.html }} + {% if group.description %} + {{ group.description.html }} {% endif %} </div> <div class="clearfix"></div> |