竞赛编辑功能
This commit is contained in:
parent
bc5846c2d6
commit
2c97f12538
|
@ -414,10 +414,15 @@ class NewsController < ApplicationController
|
|||
if @news.org_subfield_id
|
||||
@org_subfield = OrgSubfield.find(@news.org_subfield_id)
|
||||
@organization = @org_subfield.organization
|
||||
elsif @news.contest_id
|
||||
@contest = Contest.find(@news.contest_id)
|
||||
end
|
||||
if @course
|
||||
@left_nav_type = 4
|
||||
render :layout => "base_courses"
|
||||
elsif @contest
|
||||
@left_nav_type = 4
|
||||
render :layout => "base_contests"
|
||||
elsif @org_subfield
|
||||
render :layout => 'base_org'
|
||||
end
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
</div>
|
||||
<% if contest && User.current.allowed_to?(:manage_news, @contest) %>
|
||||
<%= labelled_form_for @news, :url => new_contest_news_path(:contest_id => @contest),
|
||||
:html => {:id => 'contest_news_form', :nhname => 'form', :multipart => true, :method => "get"} do |f| %>
|
||||
:html => {:id => 'news-form', :nhname => 'form', :multipart => true, :method => "get"} do |f| %>
|
||||
<%= render :partial => 'contest_news_new', :locals => {:f => f, :news => @news, :edit_mode => false, :contest => @contest} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
if(regexcontestTitle() && regexcontestDescription())
|
||||
{
|
||||
news_description_editor.sync();
|
||||
$("#contest_news_form").submit();
|
||||
$("#news-form").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
|
@ -20,6 +20,8 @@
|
|||
<%= render :partial => 'edit_for_org_subfield', :locals => {:f => f, :news => @news} %>
|
||||
<% elsif @course %>
|
||||
<%= render :partial => 'course_news_new', :locals => {:f => f, :news => @news, :edit_mode => true, :course => @course} %>
|
||||
<% elsif @contest %>
|
||||
<%= render :partial => 'contest_news_new', :locals => {:f => f, :news => @news, :edit_mode => true, :contest => @contest} %>
|
||||
<% elsif @project %>
|
||||
<%= render :partial => 'project_news_new', :locals => {:f => f, :news => @news, :edit_mode => true} %>
|
||||
<% end %>
|
||||
|
|
Loading…
Reference in New Issue