diff --git a/app/models/article.rb b/app/models/article.rb
index 318bf7e..2b87ca2 100644
--- a/app/models/article.rb
+++ b/app/models/article.rb
@@ -443,6 +443,10 @@ class Article < ActiveRecord::Base
false
end
+ def tiny_mce?
+ false
+ end
+
def author
if reference_article
reference_article.author
diff --git a/app/models/tiny_mce_article.rb b/app/models/tiny_mce_article.rb
index 3788945..2f83470 100644
--- a/app/models/tiny_mce_article.rb
+++ b/app/models/tiny_mce_article.rb
@@ -19,4 +19,8 @@ class TinyMceArticle < TextArticle
true
end
+ def tiny_mce?
+ true
+ end
+
end
diff --git a/app/views/cms/_tiny_mce_article.rhtml b/app/views/cms/_tiny_mce_article.rhtml
index 7224993..a4cae6b 100644
--- a/app/views/cms/_tiny_mce_article.rhtml
+++ b/app/views/cms/_tiny_mce_article.rhtml
@@ -18,10 +18,10 @@
<%= _('Used when a short version of your text is needed.') %>
- <%= labelled_form_field(_('Lead'), text_area(:article, 'abstract', :style => 'width: 100%; height: 200px;')) %>
+ <%= labelled_form_field(_('Lead'), text_area(:article, 'abstract', :style => 'width: 100%; height: 200px;', :class => 'mceEditor')) %>
- <%= labelled_form_field(_('Text'), text_area(:article, 'body', :style => 'width:100%; height: 500px;')) %>
+ <%= labelled_form_field(_('Text'), text_area(:article, 'body', :style => 'width:100%; height: 500px;', :class => 'mceEditor')) %>
diff --git a/app/views/shared/tiny_mce.rhtml b/app/views/shared/tiny_mce.rhtml
index ebfd45e..445399f 100644
--- a/app/views/shared/tiny_mce.rhtml
+++ b/app/views/shared/tiny_mce.rhtml
@@ -17,6 +17,7 @@
}
tinyMCE.init({
mode : "textareas",
+ editor_selector : "mceEditor",
theme : "advanced",
relative_urls : false,
remove_script_host : true,
diff --git a/app/views/tasks/_approve_article_accept_details.rhtml b/app/views/tasks/_approve_article_accept_details.rhtml
index d6e5db6..39129a5 100644
--- a/app/views/tasks/_approve_article_accept_details.rhtml
+++ b/app/views/tasks/_approve_article_accept_details.rhtml
@@ -1,14 +1,24 @@
+<%= render :file => 'shared/tiny_mce' %>
+
<%= labelled_form_field(_('Name for publishing'), f.text_field(:name)) %>
<%= select_profile_folder(_('Select the folder where the article must be published'), "tasks[#{task.id}][task]", 'article_parent_id', task.target) %>
<%= labelled_form_field(_('Highlight this article'), f.check_box(:highlighted)) %>
- <%= labelled_form_field(_('Lead'), f.text_area(:abstract, :style => 'width: 482px; height: 200px;')) %>
+ <% if task.article && task.article.tiny_mce? %>
+ <%= labelled_form_field(_('Lead'), f.text_area(:abstract, :style => 'width: 482px; height: 200px;', :class => 'mceEditor')) %>
+ <% else %>
+ <%= labelled_form_field(_('Lead'), f.text_area(:abstract, :style => 'width: 482px; height: 200px;')) %>
+ <% end %>
<%= _('Used when a short version your text is needed.') %>
- <%= labelled_form_field(_('Text'), f.text_area(:body, :style => 'width:482px; height: 500px;')) %>
+ <% if task.article && task.article.tiny_mce? %>
+ <%= labelled_form_field(_('Text'), f.text_area(:body, :style => 'width:482px; height: 500px;', :class => 'mceEditor')) %>
+ <% else %>
+ <%= labelled_form_field(_('Text'), f.text_area(:body, :style => 'width:482px; height: 500px;')) %>
+ <% end %>
<%= labelled_form_field _('Comment for author'), f.text_field(:closing_statment, :style => 'width: 488px;') %>
diff --git a/app/views/tasks/_article.rhtml b/app/views/tasks/_article.rhtml
deleted file mode 100644
index e69de29..0000000
--- a/app/views/tasks/_article.rhtml
+++ /dev/null
diff --git a/app/views/tasks/_suggest_article_accept_details.rhtml b/app/views/tasks/_suggest_article_accept_details.rhtml
index ba8c5e8..de9989f 100644
--- a/app/views/tasks/_suggest_article_accept_details.rhtml
+++ b/app/views/tasks/_suggest_article_accept_details.rhtml
@@ -1,5 +1,3 @@
-<%= render :file => 'shared/tiny_mce' %>
-
<%= labelled_form_field(_("Sent by: "), f.text_field(:name)) %>
<%= label_tag(_("Email: %s") % task.email) %>
<%= required labelled_form_field(_('Title'), f.text_field(:article_name, :size => 50)) %>
diff --git a/app/views/tasks/_textile_article.rhtml b/app/views/tasks/_textile_article.rhtml
deleted file mode 100644
index 6801248..0000000
--- a/app/views/tasks/_textile_article.rhtml
+++ /dev/null
@@ -1,14 +0,0 @@
-<% button_bar do %>
- <%= button :add, _("Lead"), '#', :id => "lead-button", :title => _('Used when a short version of your text is needed.'), :style => "margin-left: 0px;" %>
- <%= button :add, _("Text"), '#', :id => "body-button", :style => "margin-left: 0px;" %>
-<% end %>
-
-
- <%= labelled_form_field(_('Lead'), f.text_area(:abstract, :cols => 64, :rows => 10)) %>
-
-
- <%= labelled_form_field(_('Text'), f.text_area(:body, :cols => 64, :rows => 30)) %>
-
-
-<%= javascript_include_tag 'article'%>
-
diff --git a/app/views/tasks/_tiny_mce_article.rhtml b/app/views/tasks/_tiny_mce_article.rhtml
deleted file mode 100644
index 1bb197a..0000000
--- a/app/views/tasks/_tiny_mce_article.rhtml
+++ /dev/null
@@ -1,15 +0,0 @@
-<%= render :file => 'shared/tiny_mce' %>
-
-<% button_bar do %>
- <%= button :add, _("Lead"), '#', :id => "lead-button", :title => _('Used when a short version your text is needed.'), :style => "margin-left: 0px;" %>
- <%= button :add, _("Text"), '#', :id => "body-button", :style => "margin-left: 0px;" %>
-<% end %>
-
-
- <%= labelled_form_field(_('Lead'), f.text_area(:abstract, :style => 'width: 100%; height: 200px;')) %>
-
-
- <%= labelled_form_field(_('Text'), f.text_area(:body, :style => 'width:100%; height: 500px;')) %>
-
-
-<%= javascript_include_tag 'article' %>
diff --git a/app/views/tasks/_uploaded_file.rhtml b/app/views/tasks/_uploaded_file.rhtml
deleted file mode 100644
index 00df5ea..0000000
--- a/app/views/tasks/_uploaded_file.rhtml
+++ /dev/null
@@ -1,9 +0,0 @@
-<% button_bar do %>
- <%= button :add, _("Description"), '#', :id => "lead-button", :title => _('Used when a short version your text is needed.') %>
-<% end %>
-
-
- <%= labelled_form_field(_('Description'), text_area(:article, :abstract, :rows => 3, :cols => 64)) %>
-
-
-<%= javascript_include_tag 'article' %>
--
libgit2 0.21.2