summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2017-03-11 03:16:59 +0100
committerHeiko Bernloehr <Heiko.Bernloehr@FreeIT.de>2017-03-11 03:16:59 +0100
commitc48b91be8d239eda408c21417e8014bac3350ba5 (patch)
tree9c37fffc33f42b81d414019d7e3c7cc2c8c55f04
parent3dc0ee37c51bf09ce8cbcfa077009995f2cb4bb1 (diff)
downloadecs-c48b91be8d239eda408c21417e8014bac3350ba5.tar.gz
ecs-c48b91be8d239eda408c21417e8014bac3350ba5.zip
Fix forms.
-rw-r--r--app/views/admin/communities/_form.html.erb13
-rw-r--r--app/views/admin/communities/edit.html.erb2
-rw-r--r--app/views/admin/communities/new.html.erb2
-rw-r--r--app/views/admin/organizations/_form.html.erb13
-rw-r--r--app/views/admin/organizations/edit.html.erb2
-rw-r--r--app/views/admin/organizations/new.html.erb2
-rw-r--r--app/views/admin/participants/_form.html.erb14
-rw-r--r--app/views/admin/participants/edit.html.erb2
-rw-r--r--app/views/admin/participants/new.html.erb2
-rw-r--r--app/views/admin/ressources/_form.html.erb15
-rw-r--r--app/views/admin/ressources/edit.html.erb2
-rw-r--r--app/views/admin/ressources/new.html.erb2
12 files changed, 53 insertions, 18 deletions
diff --git a/app/views/admin/communities/_form.html.erb b/app/views/admin/communities/_form.html.erb
index e0587dd..0cd947c 100644
--- a/app/views/admin/communities/_form.html.erb
+++ b/app/views/admin/communities/_form.html.erb
@@ -17,8 +17,17 @@ You should have received a copy of the GNU Affero General Public
License along with ECS. If not, see <http://www.gnu.org/licenses/>.
-->
-
-<%= form.error_messages %>
+<% if @community.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@community.errors.count, "error") %> prohibited
+ this Community from being updated</h2>
+ <ul>
+ <% @community.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+<% end %>
<p><label for="community_name" class="box2 table-resource-label">Name:</label>
<%= form.text_field :name %></p>
diff --git a/app/views/admin/communities/edit.html.erb b/app/views/admin/communities/edit.html.erb
index e3bdd32..9e55876 100644
--- a/app/views/admin/communities/edit.html.erb
+++ b/app/views/admin/communities/edit.html.erb
@@ -26,7 +26,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
</p>
<p>
-<% form_for [:admin, @community], :method=>:put do |form| %>
+<%= form_for [:admin, @community], :method=>:put do |form| %>
<p><%= form.submit 'Save' %></p>
<%= render :partial => form %>
<p><%= form.submit 'Save' %></p>
diff --git a/app/views/admin/communities/new.html.erb b/app/views/admin/communities/new.html.erb
index a4cb4c1..1d3106e 100644
--- a/app/views/admin/communities/new.html.erb
+++ b/app/views/admin/communities/new.html.erb
@@ -25,7 +25,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
</p>
<p>
-<% form_for [:admin, @community], :method => :post do |form| %>
+<%= form_for [:admin, @community], :method => :post do |form| %>
<p><%= form.submit "Create" %></p>
<%= render :partial => form %>
<p><%= form.submit "Create" %></p>
diff --git a/app/views/admin/organizations/_form.html.erb b/app/views/admin/organizations/_form.html.erb
index 4998137..234bcbc 100644
--- a/app/views/admin/organizations/_form.html.erb
+++ b/app/views/admin/organizations/_form.html.erb
@@ -18,8 +18,17 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
-->
-<%= form.error_messages %>
-
+<% if @organization.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@organization.errors.count, "error") %> prohibited
+ this Organization from being updated</h2>
+ <ul>
+ <% @organization.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+<% end %>
<table>
<tr>
diff --git a/app/views/admin/organizations/edit.html.erb b/app/views/admin/organizations/edit.html.erb
index 967cf8c..9cc7a02 100644
--- a/app/views/admin/organizations/edit.html.erb
+++ b/app/views/admin/organizations/edit.html.erb
@@ -26,7 +26,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
</p>
<p>
-<% form_for [:admin, @organization], :method => :put do |form| %>
+<%= form_for [:admin, @organization], :method => :put do |form| %>
<p><%= form.submit 'Save' %></p>
<%= render :partial => form %>
<p><%= form.submit 'Save' %></p>
diff --git a/app/views/admin/organizations/new.html.erb b/app/views/admin/organizations/new.html.erb
index 211c939..4c2a446 100644
--- a/app/views/admin/organizations/new.html.erb
+++ b/app/views/admin/organizations/new.html.erb
@@ -25,7 +25,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
</p>
<p>
-<% form_for [:admin, @organization] do |form| %>
+<%= form_for [:admin, @organization] do |form| %>
<p><%= form.submit "Create" %></p>
<%= render :partial => form %>
<p><%= form.submit "Create" %></p>
diff --git a/app/views/admin/participants/_form.html.erb b/app/views/admin/participants/_form.html.erb
index 7b79e9b..f426ca8 100644
--- a/app/views/admin/participants/_form.html.erb
+++ b/app/views/admin/participants/_form.html.erb
@@ -18,7 +18,17 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
-->
-<%= form.error_messages %>
+<% if @participant.errors.any? %>
+<div id="error_explanation">
+ <h2><%= pluralize(@participant.errors.count, "error") %> prohibited
+ this Participant from being updated</h2>
+ <ul>
+ <% @participant.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+</div>
+<% end %>
<p><label for="participant_name" class="box2 table-resource-label">Name:</label>
<%= form.text_field :name %></p>
@@ -67,7 +77,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
<th style="width:60%">Description (optional):</th>
<th style="width:10%">delete</th>
</tr>
- <% form.fields_for :identities do |ident| %>
+ <%= form.fields_for :identities do |ident| %>
<tr align="left" valign="top">
<td><%= ident.text_field :name, :style => "width:100%" %></td>
<TD><%= ident.text_area :description, :rows => 1, :style => "width:100%" %></TD>
diff --git a/app/views/admin/participants/edit.html.erb b/app/views/admin/participants/edit.html.erb
index 0f3b322..a7bb815 100644
--- a/app/views/admin/participants/edit.html.erb
+++ b/app/views/admin/participants/edit.html.erb
@@ -25,7 +25,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
<%= link_to 'Back', admin_participants_path %>
</P>
<P>
-<% form_for [:admin, setup_participant(@participant)], :method=>:put do |f| %>
+<%= form_for [:admin, setup_participant(@participant)], :method=>:put do |f| %>
<p><%= f.submit 'Save' %></p>
<%= render :partial => f %>
<p><%= f.submit 'Save' %><p>
diff --git a/app/views/admin/participants/new.html.erb b/app/views/admin/participants/new.html.erb
index d00b3cb..2565e78 100644
--- a/app/views/admin/participants/new.html.erb
+++ b/app/views/admin/participants/new.html.erb
@@ -25,7 +25,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
</p>
<p>
-<% form_for [:admin, @participant] do |f| %>
+<%= form_for [:admin, @participant] do |f| %>
<p><%= f.submit "Create" %></p>
<%= render :partial => f %>
<p><%= f.submit "Create" %></p>
diff --git a/app/views/admin/ressources/_form.html.erb b/app/views/admin/ressources/_form.html.erb
index 70ac2f5..deab235 100644
--- a/app/views/admin/ressources/_form.html.erb
+++ b/app/views/admin/ressources/_form.html.erb
@@ -17,8 +17,17 @@ You should have received a copy of the GNU Affero General Public
License along with ECS. If not, see <http://www.gnu.org/licenses/>.
-->
-
-<%= form.error_messages %>
+<% if @ressource.errors.any? %>
+ <div id="error_explanation">
+ <h2><%= pluralize(@ressource.errors.count, "error") %> prohibited
+ this Ressource from being updated</h2>
+ <ul>
+ <% @ressource.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+<% end %>
<table>
<tr>
@@ -44,5 +53,3 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
<td><%= h form.check_box :events %></td>
</tr>
</table>
-
-
diff --git a/app/views/admin/ressources/edit.html.erb b/app/views/admin/ressources/edit.html.erb
index d225c58..dd29894 100644
--- a/app/views/admin/ressources/edit.html.erb
+++ b/app/views/admin/ressources/edit.html.erb
@@ -26,7 +26,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
</P>
<P>
-<% form_for [:admin, setup_ressource(@ressource)], :method=>:put do |f| %>
+<%= form_for [:admin, setup_ressource(@ressource)], :method=>:put do |f| %>
<p><%= f.submit 'Edit' %></p>
<%= render :partial => f %>
<p><%= f.submit 'Edit' %></p>
diff --git a/app/views/admin/ressources/new.html.erb b/app/views/admin/ressources/new.html.erb
index 5f961d4..6d9c7fb 100644
--- a/app/views/admin/ressources/new.html.erb
+++ b/app/views/admin/ressources/new.html.erb
@@ -25,7 +25,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>.
</p>
<p>
-<% form_for [:admin, @ressource] do |form| %>
+<%= form_for [:admin, @ressource] do |form| %>
<p><%= form.submit "Create" %></p>
<%= render :partial => form %>
<p><%= form.submit "Create" %></p>