项目配置添加ke编辑 base中去掉配置
This commit is contained in:
parent
eb7ecd4143
commit
b74c034237
|
@ -1,6 +1,6 @@
|
|||
class ContestsController < ApplicationController
|
||||
|
||||
before_filter :find_contest, :only => [:show, :settings]
|
||||
before_filter :find_contest, :only => [:show, :settings, :update]
|
||||
before_filter :is_logged, :only => [:index, :new, :create]
|
||||
layout "base_contests"
|
||||
|
||||
|
@ -39,6 +39,25 @@ class ContestsController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def update
|
||||
@contest.name = params[:contest][:name]
|
||||
@contest.description = params[:contest][:description]
|
||||
# @project.organization_id = params[:organization_id]
|
||||
params[:contest][:is_public] == "on" ? @contest.is_public = 1 : @contest.is_public = 0
|
||||
begin
|
||||
if @contest.save
|
||||
respond_to do |format|
|
||||
format.html{redirect_to settings_contest_url(@contest)}
|
||||
end
|
||||
end
|
||||
rescue Exception => e
|
||||
@message = e.message
|
||||
end
|
||||
end
|
||||
|
||||
def settings
|
||||
end
|
||||
|
||||
def join_contest
|
||||
|
||||
end
|
||||
|
@ -75,8 +94,4 @@ class ContestsController < ApplicationController
|
|||
redirect_to signin_path unless User.current.logged?
|
||||
end
|
||||
|
||||
def settings
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -11,4 +11,5 @@ module OwnerTypeHelper
|
|||
SYLLABUS = 10
|
||||
ArticleHomepage = 11
|
||||
PROJECT = 12
|
||||
CONTEST = 13
|
||||
end
|
|
@ -7,14 +7,14 @@
|
|||
<ul class="pro_newsetting_con mb15">
|
||||
<li class="mb10">
|
||||
<label class="label"><span class="c_red f12">*</span> 竞赛名称 : </label>
|
||||
<input type="text" name="project[name]" id="contest_name" class="w625" onkeyup="regex_contest_name();" value="<%= @contest.name %>">
|
||||
<input type="text" name="contest[name]" id="contest_name" class="w625" onkeyup="regex_contest_name();" value="<%= @contest.name %>">
|
||||
<span class="c_red ml5 w690" id="contest_name_notice" style="padding-left:100px;display: none;">竞赛名称不能为空!</span>
|
||||
</li>
|
||||
<li class="clear mb10">
|
||||
<label class="label fl"> 竞赛介绍 : </label>
|
||||
<%= f.kindeditor :description, :editor_id => 'contest_setting_editor',
|
||||
:owner_id => @project.nil? ? 0: @project.id,
|
||||
:owner_type => OwnerTypeHelper::PROJECT,
|
||||
:owner_id => @contest.nil? ? 0: @contest.id,
|
||||
:owner_type => OwnerTypeHelper::CONTEST,
|
||||
:width => '85%',
|
||||
:height => 300,
|
||||
:minHeight=> 300,
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
<div class="sy_class_infobox">
|
||||
<p class="sy_cgrey mb10">
|
||||
<%= link_to @contest.user.try(:show_name), user_path(@contest.user), :class => "sy_cgrey" %> >
|
||||
<%= link_to @contest.name, contest_path(@contest), :class => "sy_cgrey" %> >
|
||||
<%= link_to "配置", settings_contest_path(@contest), :class => "sy_cgrey" %>
|
||||
<%= link_to @contest.name, contest_path(@contest), :class => "sy_cgrey" %>
|
||||
</p>
|
||||
<% if is_contest_manager?(User.current.id, @contest.id) %>
|
||||
<%= render :partial => "contests/mamager_setting" %>
|
||||
|
|
Loading…
Reference in New Issue