From cd592e0627863d629e320ae73bd9906976f718e2 Mon Sep 17 00:00:00 2001 From: Larissa Reis Date: Fri, 27 Dec 2013 22:15:59 -0300 Subject: [PATCH] Improves submission page for expired forms --- plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb b/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb index 3b70153..1bd7174 100644 --- a/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb +++ b/plugins/custom_forms/views/custom_forms_plugin_profile/show.html.erb @@ -1,11 +1,11 @@

<%= @form.name %>

<%= @form.description %>

-<% if @form.expired? %> -

<%= _('Sorry, you can\'t fill this form right now') %>

-<% end %> - <% if @submission.id.nil? %> + <% if @form.expired? %> +

<%= _('Sorry, you can\'t fill this form right now') %>

+ <% end %> + <%= error_messages_for :submission %> <% form_for :submission, @submission do |f| %> @@ -17,8 +17,13 @@ <%= render :partial => 'shared/form_submission', :locals => {:f => f} %> <% button_bar do %> - <%= submit_button :save, _('Save'), :cancel => {:controller => :profile, :profile => profile.identifier} %> + <% if @form.expired? %> + <%= submit_button :save, _('Save'), :disabled => '', :class => 'disabled', :cancel => {:controller => :profile, :profile => profile.identifier} %> + <% else %> + <%= submit_button :save, _('Save'), :cancel => {:controller => :profile, :profile => profile.identifier} %> + <% end %> <% end %> + <% end %> <% else %> <% fields_for :submission, @submission do |f| %> -- libgit2 0.21.2