[ARVADOS] created: ac36412ff05d99c6bd6cdc236d5cb8b538cfe0ed
Git user
git at public.curoverse.com
Tue Aug 30 10:51:54 EDT 2016
at ac36412ff05d99c6bd6cdc236d5cb8b538cfe0ed (commit)
commit ac36412ff05d99c6bd6cdc236d5cb8b538cfe0ed
Author: radhika <radhika at curoverse.com>
Date: Tue Aug 30 10:45:20 2016 -0400
9767: add a link to workflow in the container_request#show page.
diff --git a/apps/workbench/app/models/container_work_unit.rb b/apps/workbench/app/models/container_work_unit.rb
index 1ed182c..e56c065 100644
--- a/apps/workbench/app/models/container_work_unit.rb
+++ b/apps/workbench/app/models/container_work_unit.rb
@@ -145,7 +145,7 @@ class ContainerWorkUnit < ProxyWorkUnit
def template_uuid
properties = get(:properties)
if properties
- properties[:workflow_uuid]
+ properties[:template_uuid]
end
end
diff --git a/apps/workbench/app/views/application/_name_and_description.html.erb b/apps/workbench/app/views/application/_name_and_description.html.erb
index 68a201f..78b6f8b 100644
--- a/apps/workbench/app/views/application/_name_and_description.html.erb
+++ b/apps/workbench/app/views/application/_name_and_description.html.erb
@@ -1,11 +1,2 @@
-<% if @object.respond_to? :name %>
- <h2>
- <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New #{controller.model_class.to_s.underscore.gsub("_"," ")}" } %>
- </h2>
-<% end %>
-
-<% if @object.respond_to? :description %>
- <div class="arv-description-as-subtitle">
- <%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual' } %>
- </div>
-<% end %>
+<%= render partial: 'object_name' %>
+<%= render partial: 'object_description' %>
diff --git a/apps/workbench/app/views/application/_name_and_description.html.erb b/apps/workbench/app/views/application/_object_description.html.erb
similarity index 54%
copy from apps/workbench/app/views/application/_name_and_description.html.erb
copy to apps/workbench/app/views/application/_object_description.html.erb
index 68a201f..7260940 100644
--- a/apps/workbench/app/views/application/_name_and_description.html.erb
+++ b/apps/workbench/app/views/application/_object_description.html.erb
@@ -1,9 +1,3 @@
-<% if @object.respond_to? :name %>
- <h2>
- <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New #{controller.model_class.to_s.underscore.gsub("_"," ")}" } %>
- </h2>
-<% end %>
-
<% if @object.respond_to? :description %>
<div class="arv-description-as-subtitle">
<%= render_editable_attribute @object, 'description', nil, { 'data-emptytext' => "(No description provided)", 'data-toggle' => 'manual' } %>
diff --git a/apps/workbench/app/views/application/_object_name.html.erb b/apps/workbench/app/views/application/_object_name.html.erb
new file mode 100644
index 0000000..b303853
--- /dev/null
+++ b/apps/workbench/app/views/application/_object_name.html.erb
@@ -0,0 +1,5 @@
+<% if @object.respond_to? :name %>
+ <h2>
+ <%= render_editable_attribute @object, 'name', nil, { 'data-emptytext' => "New #{controller.model_class.to_s.underscore.gsub("_"," ")}" } %>
+ </h2>
+<% end %>
diff --git a/apps/workbench/app/views/container_requests/_name_and_description.html.erb b/apps/workbench/app/views/container_requests/_name_and_description.html.erb
new file mode 100644
index 0000000..f409519
--- /dev/null
+++ b/apps/workbench/app/views/container_requests/_name_and_description.html.erb
@@ -0,0 +1,21 @@
+<%
+ wu = @object.work_unit
+ template_uuid = wu.template_uuid
+ template = Workflow.find?(template_uuid) if template_uuid
+ div_class = "col-sm-12"
+ div_class = "col-sm-6" if template
+%>
+
+<div class="<%=div_class%>">
+ <%= render partial: 'object_name' %>
+ <%= render partial: 'object_description' %>
+</div>
+
+<% if template %>
+ <div class="alert alert-info <%=div_class%>">
+ This container request was created from the workflow <%= link_to_if_arvados_object template, friendly_name: true %><br />
+ <% if template.modified_at && (template.modified_at > @object.created_at) %>
+ Note: This workflow has been modified since this container request was created.
+ <% end %>
+ </div>
+<% end %>
diff --git a/apps/workbench/test/integration/application_layout_test.rb b/apps/workbench/test/integration/application_layout_test.rb
index 686b63b..f4221a9 100644
--- a/apps/workbench/test/integration/application_layout_test.rb
+++ b/apps/workbench/test/integration/application_layout_test.rb
@@ -358,6 +358,7 @@ class ApplicationLayoutTest < ActionDispatch::IntegrationTest
# in the process page now
assert_text process_txt
+ assert_selector 'a', text: template_name
end
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list