diff --git a/app/controllers/contestnotifications_controller.rb b/app/controllers/contestnotifications_controller.rb
index 0d05d6ca..6b05e8e4 100644
--- a/app/controllers/contestnotifications_controller.rb
+++ b/app/controllers/contestnotifications_controller.rb
@@ -161,6 +161,7 @@ class ContestnotificationsController < ApplicationController
# format.html { redirect_to contestnotifications_url }
# format.json { head :no_content }
# end
+ @contestnotification = Contestnotification.find(params[:id])
@contestnotification.destroy
redirect_to contest_contestnotifications_path(@contest)
end
diff --git a/app/views/contestnotifications/index.html.erb b/app/views/contestnotifications/index.html.erb
index e05abbdc..fc71bc64 100644
--- a/app/views/contestnotifications/index.html.erb
+++ b/app/views/contestnotifications/index.html.erb
@@ -11,13 +11,13 @@
-<% if @contest && User.current.allowed_to?(:manage_contestnotifications, @contest) %>
+<% if @contest %>
- <%= labelled_form_for @contestnotifications, :url => contest_contestnotifications_path(@contest),
+ <%= labelled_form_for @contestnotification, :url => contest_contestnotifications_path(@contest),
:html => {:id => 'contestnotifications-form', :multipart => true} do |f| %>
<%= render :partial => 'contestnotifications/form', :locals => {:f => f} %>
<%= submit_tag l(:button_create), :class => 'whiteButton m3p10 h30', :name => nil %>
- <%= preview_link preview_contestnotifications_path(:contest_id => @contest), 'contestnotifications-form', target='preview', {:class => 'whiteButton m3p10'} %>
+ <%#= preview_link preview_contestnotifications_path(:contest_id => @contest), 'contestnotifications-form', target='preview', {:class => 'whiteButton m3p10'} %>
|
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-contestnotifications").hide(); return false;', :class => 'whiteButton m3p10' %>
<% end if @contest %>
diff --git a/app/views/contestnotifications/show.html.erb b/app/views/contestnotifications/show.html.erb
index 152d0d02..eea4cc20 100644
--- a/app/views/contestnotifications/show.html.erb
+++ b/app/views/contestnotifications/show.html.erb
@@ -10,9 +10,8 @@
<%=h @contestnotification.title %>
-<% if authorize_for_contest('contestnotifications', 'edit') %>
- <%= labelled_form_for :contestnotifications, @contestnotifications, :url => contest_contestnotification_path(@contestnotifications),
+ <%= labelled_form_for @contestnotification, :url => contest_contestnotification_path(@contest),
:html => { :id => 'contestnotifications-form', :multipart => true, :method => :put } do |f| %>
<%= render :partial => 'form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
@@ -20,7 +19,6 @@
<% end %>
-<% end %>