提交作品样式
This commit is contained in:
parent
c2bfbfecee
commit
6a6fbea446
|
@ -134,10 +134,14 @@ class StudentWorkController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
@user = User.current
|
||||||
@student_work = @homework.student_works.where("user_id = ?",User.current.id).first
|
@student_work = @homework.student_works.where("user_id = ?",User.current.id).first
|
||||||
if @student_work.nil?
|
if @student_work.nil?
|
||||||
@student_work = StudentWork.new
|
@student_work = StudentWork.new
|
||||||
end
|
end
|
||||||
|
respond_to do |format|
|
||||||
|
format.html{ render :layout => "new_base_user"}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
# encoding: utf-8
|
# encoding: utf-8
|
||||||
|
include UserScoreHelper
|
||||||
|
|
||||||
module StudentWorkHelper
|
module StudentWorkHelper
|
||||||
def user_projects_option
|
def user_projects_option
|
||||||
cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
|
cond = Project.visible_condition(User.current) + " AND projects.project_type <> 1"
|
||||||
|
|
|
@ -17,75 +17,77 @@
|
||||||
});
|
});
|
||||||
<% end%>
|
<% end%>
|
||||||
</script>
|
</script>
|
||||||
<div class="project_r_h">
|
<div class="HomeWork" id="RSide">
|
||||||
<h2 class="project_h2">创建作品</h2>
|
<div class="RightBanner">
|
||||||
</div>
|
<div class="NewsBannerName">提交作品</div>
|
||||||
<div class="Newwork">
|
</div>
|
||||||
<div class="hwork_ctt">
|
<div class="Newwork">
|
||||||
<div class="hwork_dis" id="tbc_01">
|
<div class="hwork_ctt">
|
||||||
<%= form_for(@student_work,
|
<div class="hwork_dis" id="tbc_01">
|
||||||
:html => { :multipart => true },
|
<%= form_for(@student_work,
|
||||||
:url => {:controller => 'student_work',
|
:html => { :multipart => true },
|
||||||
:action => 'create',
|
:url => {:controller => 'student_work',
|
||||||
:homework => @homework.id
|
:action => 'create',
|
||||||
}) do |f|%>
|
:homework => @homework.id
|
||||||
<div class="N_con">
|
}) do |f|%>
|
||||||
<% if @homework.homework_type == 1%>
|
<div class="N_con">
|
||||||
<div class=" c_red mb10 ml90">
|
<% if @homework.homework_type == 1%>
|
||||||
提示:匿评作业提交的作品,作品名称和描述中不能出现真实的姓名信息
|
<div class=" c_red mb10 ml90">
|
||||||
</div>
|
提示:匿评作业提交的作品,作品名称和描述中不能出现真实的姓名信息
|
||||||
|
</div>
|
||||||
|
<% end%>
|
||||||
|
<p>
|
||||||
|
<label class="fl"><span class="c_red">*</span> 作品名称 :</label>
|
||||||
|
<%= f.text_field "name", :required => true, :size => 60, :class => "bo fl", :maxlength => 200, :placeholder => "作品名称", :onkeyup => "regexStudentWorkName();" %>
|
||||||
|
<% if @homework.homework_type != 2%>
|
||||||
|
<a href="javascript:void(0)" class="fl ml10 mt3" onclick=" $('#about_project').slideToggle();" >
|
||||||
|
项目信息
|
||||||
|
<img class="ml5 " src="../images/bid/pic_question.png" width="15" height="15" Title="项目是一种由用户创建的基于 网络的协作空间,能够为个人 或小组提供分布式的协同交流 和资料管理等方面的。">
|
||||||
|
</a>
|
||||||
|
<% end%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p id="student_work_name_span" class="c_red ml90 mb10"></p>
|
||||||
|
</p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p id="about_project" class="about_project" >
|
||||||
|
<label class="fl"> 选择项目 :</label>
|
||||||
|
<%= f.select :project_id,options_for_select(user_projects_option), {},{:class => "bo02 mb10"} %>
|
||||||
|
</p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p>
|
||||||
|
<label class="fl">
|
||||||
|
<span class="c_red">*</span>
|
||||||
|
<%= @homework.homework_type == 2 ? "提交代码" : "作品描述"%>
|
||||||
|
:
|
||||||
|
</label>
|
||||||
|
<% if @homework.homework_type == 2 && @homework.homework_detail_programing%>
|
||||||
|
<%= f.text_area "description", :class => "w620 hwork_txt h400", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();", :value => @homework.homework_detail_programing.language == "1" ? c_stantard_code_student : c_stantard_code_student_%>
|
||||||
|
<% else %>
|
||||||
|
<%= f.text_area "description", :class => "w620 hwork_txt", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();"%>
|
||||||
|
<% end%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<p id="student_work_description_textarea" class="c_red ml90 mb10"></p>
|
||||||
|
</p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% if @homework.homework_type != 2%>
|
||||||
|
<p>
|
||||||
|
<label class="fl"> 添加附件 :</label>
|
||||||
|
<%= render :partial => 'attachments/new_form' %>
|
||||||
|
</p>
|
||||||
|
<div class="cl"></div>
|
||||||
|
<% end%>
|
||||||
|
<p class="ml80 ">
|
||||||
|
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="new_student_work();">提交作品</a>
|
||||||
|
<%= link_to "返 回".html_safe, student_work_index_path(:homework => @homework), :class => "blue_btn grey_btn fl c_white"%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</p>
|
||||||
|
</div><!---创建作业内容结束-->
|
||||||
<% end%>
|
<% end%>
|
||||||
<p>
|
</div>
|
||||||
<label class="fl"><span class="c_red">*</span> 作品名称 :</label>
|
</div>
|
||||||
<%= f.text_field "name", :required => true, :size => 60, :class => "bo fl", :maxlength => 200, :placeholder => "作品名称", :onkeyup => "regexStudentWorkName();" %>
|
</div><!--新建作业结束-->
|
||||||
<% if @homework.homework_type != 2%>
|
<div class="cl"></div>
|
||||||
<a href="javascript:void(0)" class="fl ml10 mt3" onclick="show_project();" >
|
|
||||||
项目信息
|
|
||||||
<img class="ml5 " src="../images/bid/pic_question.png" width="15" height="15" Title="项目是一种由用户创建的基于 网络的协作空间,能够为个人 或小组提供分布式的协同交流 和资料管理等方面的。">
|
|
||||||
</a>
|
|
||||||
<% end%>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<p id="student_work_name_span" class="c_red ml90 mb10"></p>
|
|
||||||
</p>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<p id="about_project" class="about_project" >
|
|
||||||
<label class="fl"> 选择项目 :</label>
|
|
||||||
<%= f.select :project_id,options_for_select(user_projects_option), {},{:class => "bo02 mb10"} %>
|
|
||||||
</p>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<p>
|
|
||||||
<label class="fl">
|
|
||||||
<span class="c_red">*</span>
|
|
||||||
<%= @homework.homework_type == 2 ? "提交代码" : "作品描述"%>
|
|
||||||
:
|
|
||||||
</label>
|
|
||||||
<% if @homework.homework_type == 2 && @homework.homework_detail_programing%>
|
|
||||||
<%= f.text_area "description", :class => "w620 hwork_txt h400", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();", :value => @homework.homework_detail_programing.language == "1" ? c_stantard_code_student : c_stantard_code_student_%>
|
|
||||||
<% else %>
|
|
||||||
<%= f.text_area "description", :class => "w620 hwork_txt", :placeholder => "作品描述不能为空", :onkeyup => "regexStudentWorkDescription();"%>
|
|
||||||
<% end%>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<p id="student_work_description_textarea" class="c_red ml90 mb10"></p>
|
|
||||||
</p>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<% if @homework.homework_type != 2%>
|
|
||||||
<p>
|
|
||||||
<label class="fl"> 添加附件 :</label>
|
|
||||||
<%= render :partial => 'attachments/new_form' %>
|
|
||||||
</p>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<% end%>
|
|
||||||
<p class="ml80 ">
|
|
||||||
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="new_student_work();">提交作品</a>
|
|
||||||
<%= link_to "返 回".html_safe, student_work_index_path(:homework => @homework), :class => "blue_btn grey_btn fl c_white"%>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</p>
|
|
||||||
</div><!---创建作业内容结束-->
|
|
||||||
<% end%>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div><!--新建作业结束-->
|
|
||||||
<div class="cl"></div>
|
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
|
|
||||||
|
@ -125,8 +127,8 @@
|
||||||
</script>
|
</script>
|
||||||
<!-- 模板1结束 -->
|
<!-- 模板1结束 -->
|
||||||
|
|
||||||
<div class="homepageRight">
|
|
||||||
<div class="HomeWork">
|
<div class="HomeWork" id="RSide">
|
||||||
<div class="RightBanner">
|
<div class="RightBanner">
|
||||||
<div class="NewsBannerName">提交作品</div>
|
<div class="NewsBannerName">提交作品</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -201,6 +203,5 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div><!----ProResult end-->
|
</div><!----ProResult end-->
|
||||||
</div><!--homepageRight end-->
|
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
|
@ -953,3 +953,50 @@ blockquote {
|
||||||
background-color: #e8e8e8;
|
background-color: #e8e8e8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* 创建作品 work */
|
||||||
|
.Newwork{ width:668px; height:418px;}
|
||||||
|
.N_top{ float:right; margin-left:390px; }
|
||||||
|
.N_con{ color:#484747; font-weight:bold; width:660px; margin-top:10px; }
|
||||||
|
.N_con p{ }
|
||||||
|
.w430{ width:470px;}
|
||||||
|
.w557{ width:557px;}
|
||||||
|
.w350{ width:350px;}
|
||||||
|
.h400{height: 400px !important;}
|
||||||
|
.w620{ width:480px; height:160px; border:1px solid #CCC;}
|
||||||
|
.bo{height:26px; border:1px solid #CCC; padding-left:5px; background:#fff;width:470px; }
|
||||||
|
.bo02{height:26px; border:1px solid #CCC; padding-left:5px; background:#fff;width:480px; margin-left:2px; color: #999; }
|
||||||
|
.hwork_txt{ width:560px; padding-left:5px; background:#fff;}
|
||||||
|
a.tijiao{ height:28px; display:block; width:80px; color:#fff; background:#15bccf; text-align:center; padding-top:4px; float:left; margin-right:10px;}
|
||||||
|
a:hover.tijiao{ background:#0f99a9;}
|
||||||
|
.members_left{ float:left; width:410px; margin-right:20px; text-align:center;}
|
||||||
|
.members_left{}
|
||||||
|
.members_left ul li{ height:30px; border-bottom:1px solid #E4E4E4; width:410px; padding-top:10px; }
|
||||||
|
.members_left ul li a{ float:left; text-align:center;}
|
||||||
|
.members_left ul li span{ float:left; text-align:center; color:#484747;}
|
||||||
|
.w150{ text-align:center; width:150px;min-height: 10px;}
|
||||||
|
.f_b{ font-weight: bold;}
|
||||||
|
.members_right label{ margin-left:15px;}
|
||||||
|
.N_search{ height:20px; border:1px solid #999;}
|
||||||
|
/* 创建作品 homework */
|
||||||
|
.hwork_new{ color:#4c4c4c;}
|
||||||
|
.c_red{ color:#F00;}
|
||||||
|
.hwork_input{ border:1px solid #64bdd9; height:22px; width:88%; background:#fff; margin-bottom:10px; padding:5px;}
|
||||||
|
.hwork_input02{ border:1px solid #64bdd9; height:15px; width:140px; background:#fff; margin-bottom:10px; padding:5px;}
|
||||||
|
.hwork_text{ border:1px solid #64bdd9; height:100px;width:555px; background:#fff; margin-left:5px; padding:5px; margin-bottom:10px;}
|
||||||
|
.hwork_new ul li{ }
|
||||||
|
.ml21{ margin-left:21px;}
|
||||||
|
.ml9{ margin-left:9px;}
|
||||||
|
.hwork_ttl{height:24px;}
|
||||||
|
.hwork_ctt{height:auto; padding-left:10px;clear:both;}
|
||||||
|
.hwork_tb_{ border-bottom:3px solid #e4e4e4; text-align:center;}
|
||||||
|
.hwork_tb_ ul{height:24px;}
|
||||||
|
.hwork_tb_ li{float:left;height: 24px;width: auto; padding:0 10px;cursor:pointer;}
|
||||||
|
.hwork_normaltab { color:#15bccf ; border-bottom:3px solid #e4e4e4; }
|
||||||
|
.hwork_hovertab { color:#656767; font-weight:bold; border-bottom:3px solid #15bccf; }
|
||||||
|
|
||||||
|
.hwork_dis{display:block; }
|
||||||
|
.hwork_undis{display:none;}
|
||||||
|
.project_none{ display:none;}
|
||||||
|
.about_project{ overflow:hidden;display:none;}
|
||||||
|
.project_r_h{ width:670px; height:40px; background:#eaeaea; margin-bottom:10px;}
|
||||||
|
.project_r_h02{ width:920px; height:40px; background:#eaeaea; margin-bottom:10px;}
|
||||||
|
|
Loading…
Reference in New Issue