Commit cd592e0627863d629e320ae73bd9906976f718e2

Authored by Larissa Reis
1 parent 65e4bd5b

Improves submission page for expired forms

plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb
1 1 <h1><%= @form.name %></h1>
2 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 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 9 <%= error_messages_for :submission %>
10 10  
11 11 <% form_for :submission, @submission do |f| %>
... ... @@ -17,8 +17,13 @@
17 17 <%= render :partial => 'shared/form_submission', :locals => {:f => f} %>
18 18  
19 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 25 <% end %>
  26 +
22 27 <% end %>
23 28 <% else %>
24 29 <% fields_for :submission, @submission do |f| %>
... ...