diff --git a/app/helpers/plans_helper.rb b/app/helpers/plans_helper.rb index bff80a5..3b9b21b 100644 --- a/app/helpers/plans_helper.rb +++ b/app/helpers/plans_helper.rb @@ -101,4 +101,16 @@ return access end + # display the visibility of the plan + def display_visibility(val) + case val + when 0 + return 'My Org.' + when 1 + return 'Public' + else + return 'Private' # Both Test and Private + end + end + end diff --git a/app/views/plans/_plan_list_head.html.erb b/app/views/plans/_plan_list_head.html.erb deleted file mode 100644 index 6b05f86..0000000 --- a/app/views/plans/_plan_list_head.html.erb +++ /dev/null @@ -1,6 +0,0 @@ -
| <%= _('Plan') %> | +<%= _('Template') %> | +<%= _('Edited') %> | +<%= _('Role') %> | +<%= _('Visibility') %> | +<%= _('Test') %> | +<%= _('Select an Action') %> | - <% @plans.each do |plan| %> - <%= render(partial: "plan_list_item", locals: { plan: plan } ) %> - <% end %> + <% @plans.each do |plan| %> +
|---|---|---|---|---|---|---|
| <%= plan.title %> | +<%= plan.template.title %> | +<%= l(plan.latest_update.to_date, formats: :short) %> | +<%= display_role(plan.roles.find_by(user: current_user)) %> | +<%= display_visibility(plan.visibility) %> | ++ /> + | ++ <% if plan.editable_by?(current_user.id) then %> + <%= link_to _('Edit'), plan_path(plan), :class => "dmp_table_link"%> + + <% if plan.administerable_by?(current_user.id) then %> + <%= link_to _('Share'), share_plan_path(plan), :class => "dmp_table_link"%> + <% end %> + + <%= link_to _('Export'), show_export_plan_path(plan), :class => "dmp_table_link"%> + + <%= link_to _('Duplicate'), duplicate_plan_path(plan), method: :post, remote: true, :class => "dmp_table_link"%> + + <% if plan.owned_by?(current_user.id) then %> + <%= link_to _('Delete'), plan_path(plan), :class => "dmp_table_link", + :method => :delete, :data => { + :confirm => _('Are you sure you wish to delete this plan? If the plan is being shared with other users, by deleting it from your list, the plan will be deleted from their plan list as well') + }%> + <% end %> + <% else %> + <%= link_to _('View'), plan_path(plan), :class => "dmp_table_link"%> + <%= link_to _('Export'), show_export_plan_path(plan), :class => "dmp_table_link"%> + <% end %> + | +