Commit cd592e0627863d629e320ae73bd9906976f718e2
1 parent
65e4bd5b
Exists in
master
and in
29 other branches
Improves submission page for expired forms
Showing
1 changed file
with
10 additions
and
5 deletions
Show diff stats
plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb
1 | <h1><%= @form.name %></h1> | 1 | <h1><%= @form.name %></h1> |
2 | <p><%= @form.description %></p> | 2 | <p><%= @form.description %></p> |
3 | 3 | ||
4 | -<% if @form.expired? %> | ||
5 | - <h2><%= _('Sorry, you can\'t fill this form right now') %></h2> | ||
6 | -<% end %> | ||
7 | - | ||
8 | <% if @submission.id.nil? %> | 4 | <% if @submission.id.nil? %> |
5 | + <% if @form.expired? %> | ||
6 | + <h2><%= _('Sorry, you can\'t fill this form right now') %></h2> | ||
7 | + <% end %> | ||
8 | + | ||
9 | <%= error_messages_for :submission %> | 9 | <%= error_messages_for :submission %> |
10 | 10 | ||
11 | <% form_for :submission, @submission do |f| %> | 11 | <% form_for :submission, @submission do |f| %> |
@@ -17,8 +17,13 @@ | @@ -17,8 +17,13 @@ | ||
17 | <%= render :partial => 'shared/form_submission', :locals => {:f => f} %> | 17 | <%= render :partial => 'shared/form_submission', :locals => {:f => f} %> |
18 | 18 | ||
19 | <% button_bar do %> | 19 | <% button_bar do %> |
20 | - <%= submit_button :save, _('Save'), :cancel => {:controller => :profile, :profile => profile.identifier} %> | 20 | + <% if @form.expired? %> |
21 | + <%= submit_button :save, _('Save'), :disabled => '', :class => 'disabled', :cancel => {:controller => :profile, :profile => profile.identifier} %> | ||
22 | + <% else %> | ||
23 | + <%= submit_button :save, _('Save'), :cancel => {:controller => :profile, :profile => profile.identifier} %> | ||
24 | + <% end %> | ||
21 | <% end %> | 25 | <% end %> |
26 | + | ||
22 | <% end %> | 27 | <% end %> |
23 | <% else %> | 28 | <% else %> |
24 | <% fields_for :submission, @submission do |f| %> | 29 | <% fields_for :submission, @submission do |f| %> |