-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathshow.html.erb
More file actions
46 lines (38 loc) · 2.06 KB
/
show.html.erb
File metadata and controls
46 lines (38 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<% set_page_title(current_form.name) %>
<% if current_form.is_live? %>
<% content_for :back_link, govuk_back_link_to(live_form_path(current_form.id), t("back_link.form_view")) %>
<% elsif current_form.is_archived? %>
<% content_for :back_link, govuk_back_link_to(archived_form_path(current_form.id), t("back_link.form_view")) %>
<% elsif FeatureService.new(user: @current_user).enabled?(:groups) && current_form.group.present? %>
<% content_for :back_link, govuk_back_link_to(group_path(current_form.group), t("back_link.group", group_name: current_form.group.name)) %>
<% else %>
<% content_for :back_link, govuk_back_link_to(root_path, t("back_link.forms")) %>
<% end %>
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
<h1 class="govuk-heading-l govuk-!-margin-bottom-2">
<span class="govuk-caption-l"><%= current_form.name %></span><span class="govuk-visually-hidden"> - </span>
<%= current_form.state.to_sym == :draft ? t("forms.form_overview.title_create") : t("forms.form_overview.title_edit") %>
</h1>
<%= render FormStatusTagDescriptionComponent::View.new(status: :draft) %>
<% if flash[:message] %>
<p><%= flash[:message] %></p>
<% end %>
<% preview_link = PreviewLinkComponent::View.new(FormRepository.pages(current_form), link_to_runner(Settings.forms_runner.url, current_form.id, current_form.form_slug)) %>
<% if preview_link.render? %>
<p class="govuk-!-margin-bottom-9">
<%= render preview_link %>
</p>
<% end %>
<% if current_form.is_live? %>
<div class="govuk-inset-text">
<p><%= t("make_changes_live.warning") %></p>
</div>
<% end %>
<%= render TaskListComponent::View.new(completed_task_count: @task_status_counts[:completed],
total_task_count: @task_status_counts[:total] ,
sections: @task_list)
%>
<%= govuk_button_link_to(t("forms.delete_form"), delete_form_path(current_form.id), warning: true) if current_form.state.to_sym == :draft %>
</div>
</div>