socialforge/app/views/contests/_edit.html.erb

71 lines
3.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%= content_for(:header_tags) do %>
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
<% end %>
<div class="pro_new_setting_conbox fl " style="width:100%; border:none;">
<%= labelled_form_for @contest do |f| %>
<ul class="pro_newsetting_con mb15">
<li class="mb10">
<label class="label"><span class="c_red f12">*</span>&nbsp;竞赛名称&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="contest[name]" id="contest_name" class="w621 h28" 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 mr3">&nbsp;竞赛介绍&nbsp;&nbsp;:&nbsp;</label>
<%= f.kindeditor :description, :editor_id => 'contest_setting_editor',
:owner_id => @contest.nil? ? 0: @contest.id,
:owner_type => OwnerTypeHelper::CONTEST,
:width => '84%',
:height => 300,
:minHeight=> 300,
:class => 'fl ml5 w690',
:input_html => { :id => 'contest_description',
:class => 'courses_text fl',
:maxlength => 5000 }
%>
<div class="cl"></div>
<div class="mt5 ml100">
<div class="fl" id="syllabus_attachments">
<%= render :partial => 'attachments/form_course', :locals => {:container => @contest, :isReply => false} %>
</div>
</div>
<!--<textarea class=" fl ml5 w625" style="height:192px; padding-top:5px; background:#fff;" placeholder="参赛要求参与方法赛事日程最多6000个字符" ></textarea>-->
</li>
<li class="clear">
<label class="fl ">公开&nbsp;&nbsp;</label>
<input class="fl ml5 h28" id="contest_is_public" name="contest[is_public]" type="checkbox" <%= @contest.is_public ? "checked" : ""%>>
<span class="fl c_grey ">(选中后对所有用户可见,否则仅对成员可见。)</span>
</li>
<li class="clear">
<!--<a href="javascript:void(0);" class="sy_btn_grey mr5 fl ml40 "> 删除</a>-->
<!--<p class="fl c_grey">(友情提示:删除该竞赛后如果您想恢复,请联系系统管理员!)</p>-->
<a href="javascript:void(0);" class="sy_btn_blue mr15 fr" onclick="submit_edit_contest(<%= @contest.id %>);"> 保存</a>
<a href="<%=contest_path(@contest) %>" class="sy_btn_grey mr15 fr" onclick="submit_edit_contest(<%= @contest.id %>);"> 取消</a>
</li>
</ul>
<% end %>
</div>
<script>
//配置-验证项目名称
function regex_contest_name() {
var name = $.trim($("#contest_name").val());
if (name.length == 0) {
$("#contest_name_notice").show();
return false;
}
else {
$("#contest_name_notice").hide();
return true;
}
}
//配置-信息提交
function submit_edit_contest(id) {
contest_setting_editor.sync();
if (regex_contest_name()) {
$("#edit_contest_" + id).submit();
}
}
</script>