contest fix

This commit is contained in:
yanxd 2014-06-13 11:49:11 +08:00
parent 70abac4c1e
commit ceef85719e
3 changed files with 6 additions and 7 deletions

View File

@ -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

View File

@ -11,13 +11,13 @@
<% if @contest && User.current.allowed_to?(:manage_contestnotifications, @contest) %>
<% if @contest %>
<div id="add-contestnotifications" class="add_frame" style="display:none;">
<%= 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 %>

View File

@ -10,9 +10,8 @@
<h3><strong><%=h @contestnotification.title %></strong></h3>
<% if authorize_for_contest('contestnotifications', 'edit') %>
<div id="edit-contestnotifications" style="display:none;">
<%= 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 %>
<div id="preview" class="wiki"></div>
</div>
<% end %>
<div id="notificationcomments" style="margin-bottom:16px;">
@ -81,7 +79,7 @@
</tr>
<tr>
<td align="left"><span class="font_lighter"> <%= format_time(notificationcomment.created_at) %></span></td>
<td width="200" align="right" class="a"><%= link_to_if_authorized_contest image_tag('delete.png'), {:controller => 'notificationcomments', :action => 'destroy', :id => @contestnotifications, :notificationcomment_id => notificationcomment},
<td width="200" align="right" class="a"><%#= link_to_if_authorized_contest image_tag('delete.png'), {:controller => 'notificationcomments', :action => 'destroy', :id => @contestnotifications, :notificationcomment_id => notificationcomment},
:data => {:confirm => l(:text_are_you_sure)}, :method => :delete, :title => l(:button_delete) %></td>
</tr>
</table></td>