# GET /speech_balloon_templates
# GET /speech_balloon_templates.json
def index
- @speech_balloon_templates = SpeechBalloonTemplate.list
+ @speech_balloon_templates = SpeechBalloonTemplate.enable_list
respond_to do |format|
format.html # index.html.erb
end
def panel_editor_javascript_include_tags
- WritingFormat.list().map {|wf|
+ WritingFormat.enable_list().map {|wf|
# javascript_include_tag wf.engine_name
javascript_include_tag wf.engine_name + "/application"
}.join("\n") +
WritingFormat.find(:all, opt)
end
+ def self.enable_list
+ WritingFormat.list.delete_if {|wf|
+ wf.enable? == false
+ }
+ end
+
def self.list_opt
{}
end
Pettanr::Application.writing_formats[self.classname]
end
+ def enable?
+ Pettanr::Application.writing_formats.include? self.classname
+ end
+
def engine_module_name
self.engine_name.camelize
end
<% when 'SpeechBalloon' %>
<div id="new-speech_balloon-tabs">
<ul>
- <% SpeechBalloonTemplate.list().each_with_index do |sbt, index| %>
+ <% SpeechBalloonTemplate.enable_list().each_with_index do |sbt, index| %>
<li>
<a href="#new-speech_balloon-tabs-<%= index -%>">
<div class="new-speech_balloon-tab">
</div>
<% end %>
<div id="writing_formats">
- <% WritingFormat.list().each do |wf| %>
+ <% WritingFormat.enable_list().each do |wf| %>
<div id="writing_format-<%= wf.id -%>" writing_format_id="<%= wf.id -%>" writing_format_engine_name="<%= wf.engine_name -%>">
</div>
<% end %>