Modified: trunk/app/controllers/workflows_controller.rb (2378 => 2379)
--- trunk/app/controllers/workflows_controller.rb 2010-04-15 16:17:35 UTC (rev 2378)
+++ trunk/app/controllers/workflows_controller.rb 2010-04-15 16:27:09 UTC (rev 2379)
@@ -319,7 +319,7 @@
if policy_err_msg.blank?
flash[:notice] = 'Workflow was successfully created.'
format.html {
- if @workflow.get_tag_suggestions.length > 0
+ if (@workflow.get_tag_suggestions.length > 0 || (@workflow.body.nil? || @workflow.body == ''))
redirect_to tag_suggestions_workflow_url(@workflow)
else
redirect_to workflow_url(@workflow)
@@ -412,7 +412,16 @@
if @workflow.save_as_new_version(params[:new_workflow][:rev_comments])
respond_to do |format|
flash[:notice] = 'New workflow version successfully created.'
- format.html { redirect_to workflow_url(@workflow) }
+ format.html {
+
+ @workflow.reload
+
+ if (@workflow.get_tag_suggestions.length > 0 || (@workflow.body.nil? || @workflow.body == ''))
+ redirect_to tag_suggestions_workflow_url(@workflow)
+ else
+ redirect_to workflow_url(@workflow)
+ end
+ }
end
else
fail = true
@@ -579,6 +588,11 @@
def process_tag_suggestions
+ if params[:workflow] && params[:workflow][:body]
+ @workflow.body = params[:workflow][:body]
+ @workflow.save
+ end
+
params[:tag_list].split(',').each do |tag|
@workflow.add_tag(tag, current_user)
end
Modified: trunk/app/views/workflows/tag_suggestions.rhtml (2378 => 2379)
--- trunk/app/views/workflows/tag_suggestions.rhtml 2010-04-15 16:17:35 UTC (rev 2378)
+++ trunk/app/views/workflows/tag_suggestions.rhtml 2010-04-15 16:27:09 UTC (rev 2379)
@@ -1,28 +1,52 @@
+<%= _javascript__include_tag :fckeditor %>
<%= _javascript__include_tag "tag_suggestions.js" %>
-<h1>Tags</h1>
+<h1>Extra workflow metadata</h1>
-<h2>Automatic tag suggestions</h2>
+<form action="" "/workflows/address@hidden/process_tag_suggestions" %>" method="post">
-<p>The following tag suggestions are based on the content of your workflow.
-Click on each tag that you wish to use.<p>
+ <% if @workflow.body.nil? || @workflow.body == "" %>
-<div class="tag_suggestion_box">
- <div id="suggestions"></div>
-</div>
+ <h2>Workflow description</h2>
-<p><em>Note: Tag suggestions are given by matching words in your workflow with other
-tags already used in <%= Conf.sitename %>.</em></p>
+ <p><em>The workflow you have uploaded has no description! By entering a
+ description here, you will increase the chances of others finding your
+ workflow and help understand its purpose.</em></p>
-<h2>Summary</h2>
+ <!-- Description -->
+ <p><b>Description</b></p>
-<div id="summary-text"></div>
+ <%= fckeditor_textarea(:workflow, :body, :toolbarSet => 'Simple', :width => '500px', :height => '300px') %>
-<form action="" "/workflows/address@hidden/process_tag_suggestions" %>" method="post">
+ <% end %>
+
+ <h2>Tags</h2>
+
+ <h3>Automatic tag suggestions</h3>
+
+ <p>The following tag suggestions are based on the content of your workflow.
+ Click on each tag that you wish to use.<p>
+
+ <div class="tag_suggestion_box">
+ <div id="suggestions"></div>
+ </div>
+
+ <p><em>Note: Tag suggestions are given by matching words in your workflow
+ with other tags already used in <%= Conf.sitename %>.</em></p>
+
+ <p><b>Summary</b></p>
+
+ <div id="summary-text"></div>
+
+ <h2>Finish</h2>
+
+ <p>Complete the upload process.</p>
+
<p style="text-align: center">
- <input id="submit-button" type="submit" value="Continue" />
+ <input id="submit-button" type="submit" value="Finish" />
<input type="hidden" name="tag_list" id="tag_list" />
</p>
+
</form>
<script type="text/ecmascript">