dev_aliyun
daiao 5 years ago
commit fb1d58a97c

@ -206,7 +206,7 @@ class CompetitionTeamsController < ApplicationController
teacher_staff = @competition.competition_staffs.where(category: 'teacher').first teacher_staff = @competition.competition_staffs.where(category: 'teacher').first
if teacher_staff.blank? if teacher_staff.blank?
@status, @message = -1, '老师不能参加该竞赛' @status, @message = -1, '本竞赛的参赛者限定为:学生'
return return
end end
@ -218,7 +218,7 @@ class CompetitionTeamsController < ApplicationController
else else
max_member_count = @competition.competition_staffs.where('category != "teacher"').sum(:maximum) max_member_count = @competition.competition_staffs.where('category != "teacher"').sum(:maximum)
if max_member_count.zero? if max_member_count.zero?
@status, @message = -1, '学生不能参加该竞赛' @status, @message = -1, '本竞赛的参赛者限定为:教师'
return return
elsif team.members.count + 1 > max_member_count elsif team.members.count + 1 > max_member_count
@status, @message = -1, '该战队成员人数已满' @status, @message = -1, '该战队成员人数已满'
@ -277,16 +277,18 @@ class CompetitionTeamsController < ApplicationController
end end
def member_and_teacher_count_valid?(is_teacher) def member_and_teacher_count_valid?(is_teacher)
single_staff = @competition.competition_staffs.count == 1
teacher_text = single_staff ? '队员' : '导师'
teacher_staff = @competition.competition_staffs.where(category: 'teacher').first teacher_staff = @competition.competition_staffs.where(category: 'teacher').first
teacher_count = params[:teacher_ids].try(:size) || 0 teacher_count = params[:teacher_ids].try(:size) || 0
teacher_count += 1 if is_teacher teacher_count += 1 if is_teacher
# 检查老师数量 # 检查老师数量
if teacher_staff.blank? && teacher_count > 0 if teacher_staff.blank? && teacher_count > 0
@status, @message = -1, '老师不能参与该竞赛' @status, @message = -1, '本竞赛的参赛者限定为:学生'
return false return false
elsif teacher_staff.present? && (teacher_staff.minimum > teacher_count || teacher_staff.maximum < teacher_count) elsif teacher_staff.present? && (teacher_staff.minimum > teacher_count || teacher_staff.maximum < teacher_count)
@status = -1 @status = -1
@message = teacher_staff.maximum == teacher_staff.maximum ? "导师数量应为#{teacher_staff.minimum}" : "导师数量应为#{teacher_staff.minimum}-#{teacher_staff.maximum}" @message = teacher_staff.maximum == teacher_staff.maximum ? "#{teacher_text}数量应为#{teacher_staff.minimum}" : "#{teacher_text}数量应为#{teacher_staff.minimum}-#{teacher_staff.maximum}"
return false return false
end end
@ -297,11 +299,11 @@ class CompetitionTeamsController < ApplicationController
member_count += 1 unless is_teacher member_count += 1 unless is_teacher
# 检查成员数据 # 检查成员数据
if member_relations.count.zero? && member_count > 0 if member_relations.count.zero? && member_count > 0
@status, @message = -1, '学生不能参与该竞赛' @status, @message = -1, '本竞赛的参赛者限定为:教师'
return false return false
elsif min_member_count > member_count || member_count > max_member_count elsif min_member_count > member_count || member_count > max_member_count
@status = -1 @status = -1
@message = min_member_count == max_member_count ? "员数量应为#{max_member_count}" : "员数量应为#{min_member_count}-#{max_member_count}" @message = min_member_count == max_member_count ? "员数量应为#{max_member_count}" : "员数量应为#{min_member_count}-#{max_member_count}"
return false return false
end end
@ -327,7 +329,7 @@ class CompetitionTeamsController < ApplicationController
repeat_members = competition.team_members.where(user_id: user_ids).includes(:user).to_a repeat_members = competition.team_members.where(user_id: user_ids).includes(:user).to_a
if repeat_members.size > 0 if repeat_members.size > 0
@status, @message = -1, "#{repeat_members.map{|t| t.user.show_real_name}.join('')}已经加入其它战队了" @status, @message = -1, "#{repeat_members.map{|t| t.user.show_real_name}.join('')}已经加入其它战队了"
return false return false
end end

@ -25,7 +25,15 @@ class CompetitionsController < ApplicationController
end end
def index def index
@competitions = Competition.where('status = 1 or published_at is not null').reorder("published_at desc, online_time desc") competitions = Competition.where('status = 1 or published_at is not null')
case params[:category]
when 'progressing' then
competitions = competitions.where('end_time > NOW()')
when 'ended' then
competitions = competitions.where('end_time < NOW()')
end
@competitions = competitions.reorder("published_at desc, online_time desc")
respond_to do |format| respond_to do |format|
format.html { render :layout => "base_edu"} format.html { render :layout => "base_edu"}
format.js format.js
@ -479,7 +487,7 @@ class CompetitionsController < ApplicationController
if params[:competition_module] if params[:competition_module]
@competition.competition_modules.where(:id => params[:competition_module], :md_edit => false).update_all(:hidden => 0) @competition.competition_modules.where(:id => params[:competition_module], :md_edit => false).update_all(:hidden => 0)
none_modules = @competition.competition_modules.where("name != '首页' and md_edit = false").map(&:id).join(",").split(",") - params[:competition_module] none_modules = @competition.competition_modules.where("name != '首页' and md_edit = false").pluck(:id) - params[:competition_module].map(&:to_i)
@competition.competition_modules.where(:id => none_modules).update_all(:hidden => 1) @competition.competition_modules.where(:id => none_modules).update_all(:hidden => 1)
end end
if params[:name] if params[:name]

@ -37,7 +37,7 @@ class LibrariesController < ApplicationController
Libraries::SaveService.new(@library, current_user, form_params).call Libraries::SaveService.new(@library, current_user, form_params).call
if with_publish? if with_publish?
Libraries::SubmitService.new(@library).call Libraries::SubmitService.new(@library).call
redirect_to publish_success_libraries_path redirect_to publish_success_libraries_path(id: @library.id)
else else
redirect_to library_path(id: @library.id) redirect_to library_path(id: @library.id)
end end
@ -61,7 +61,7 @@ class LibrariesController < ApplicationController
Libraries::SaveService.new(@library, current_user, form_params).call Libraries::SaveService.new(@library, current_user, form_params).call
if with_publish? if with_publish?
Libraries::SubmitService.new(@library).call Libraries::SubmitService.new(@library).call
redirect_to publish_success_libraries_path redirect_to publish_success_libraries_path(id: @library.id)
else else
redirect_to library_path(id: @library.id) redirect_to library_path(id: @library.id)
end end

@ -1083,7 +1083,12 @@ end
def enroll_list def enroll_list
@order = params[:order].blank? ? "desc" : params[:order] @order = params[:order].blank? ? "desc" : params[:order]
@competition = Competition.where(:id => params[:competition]).first @competition = Competition.where(:id => params[:competition]).first
@team_members = @competition.team_members.includes(:user => [:user_extensions => [:school]])
@only_teacher = @competition.competition_staffs.count == 1 && @competition.competition_staffs.first.category == 'teacher'
@team_members = @competition.team_members
@team_members = @team_members.where(is_teacher: false) unless @only_teacher # 只有老师报名时才显示老师,此时老师作为队员
if params[:school] || params[:location] if params[:school] || params[:location]
school_ids = School.where("schools.name like '%#{params[:school]}%'").pluck(:id) school_ids = School.where("schools.name like '%#{params[:school]}%'").pluck(:id)
school_ids = school_ids.size == 0 ? "(-1)" : "(" + school_ids.join(",") + ")" school_ids = school_ids.size == 0 ? "(-1)" : "(" + school_ids.join(",") + ")"
@ -1093,7 +1098,7 @@ end
@page = params[:page] || 1 @page = params[:page] || 1
@team_members = @team_members.reorder("team_members.created_at #{@order}") @team_members = @team_members.reorder("team_members.created_at #{@order}")
all_members = @team_members all_members = @team_members
@team_members = paginateHelper @team_members, 50 @team_members = paginateHelper(@team_members.includes(competition_team: [:user, teachers: :user], user: { user_extensions: :school }), 50)
respond_to do |format| respond_to do |format|
format.js format.js
format.html format.html

@ -2996,6 +2996,8 @@ module ApplicationHelper
else else
title << "教学案例" title << "教学案例"
end end
elsif params[:controller] == "project_packages"
title << "众包社区"
elsif @course elsif @course
title << (@course.name.nil? ? "课堂" : @course.name) title << (@course.name.nil? ? "课堂" : @course.name)
elsif params[:controller] == "homework_bank" || params[:controller] == "question_banks" || params[:controller] == "exercise_bank" elsif params[:controller] == "homework_bank" || params[:controller] == "question_banks" || params[:controller] == "exercise_bank"
@ -7468,7 +7470,7 @@ def tiding_url tiding
tiding.tiding_type == 'Apply' ? library_applies_path : library_path(tiding.container_id) tiding.tiding_type == 'Apply' ? library_applies_path : library_path(tiding.container_id)
when 'ProjectPackage' when 'ProjectPackage'
if tiding.container.present? if tiding.container.present?
tiding.tiding_type == 'Apply' ? project_package_applies_path : "/project_packages/#{tiding.container_id}" tiding.tiding_type == 'Apply' ? project_package_applies_path : "/crowdsourcing/#{tiding.container_id}"
else else
'javascript:void(0)' 'javascript:void(0)'
end end

@ -2,7 +2,7 @@ module LibrariesHelper
def show_library_tags(library) def show_library_tags(library)
html = '' html = ''
library.library_tags.each do |tag| library.library_tags.each do |tag|
html += content_tag(:span, tag.name, class: "edu-filter-btn fl cdefault mt3 ml10 " + library_tag_class(tag)) html += content_tag(:span, tag.name, class: "edu-filter-btn fl cdefault mt3 ml10 #{library_tag_class(tag)}")
end end
raw html raw html

@ -1,4 +1,5 @@
<% none_edit = @team.try(:id).present? && @competition.enroll_end_time.present? && @competition.enroll_end_time < Time.now %> <% none_edit = @team.try(:id).present? && @competition.enroll_end_time.present? && @competition.enroll_end_time < Time.now %>
<% single_staff = @competition.competition_staffs.count == 1 %>
<%= labelled_form_for @team, :html => {:id => 'competition_team_form', :multipart => true, :remote => true} do |f| %> <%= labelled_form_for @team, :html => {:id => 'competition_team_form', :multipart => true, :remote => true} do |f| %>
<% teacher_staff = @competition.competition_staffs.where(category: 'teacher').first %> <% teacher_staff = @competition.competition_staffs.where(category: 'teacher').first %>
<% min_member_staff = @competition.competition_staffs.where('category != "teacher"').sum(:minimum) %> <% min_member_staff = @competition.competition_staffs.where('category != "teacher"').sum(:minimum) %>
@ -10,19 +11,19 @@
<input type="hidden" id="team_id" value="<%= @team.try(:id) %>"> <input type="hidden" id="team_id" value="<%= @team.try(:id) %>">
<input type="hidden" name="com_id" value="<%= @competition.id %>"> <input type="hidden" name="com_id" value="<%= @competition.id %>">
<% if none_edit %> <% if teacher_staff && none_edit %>
<p class="edu-txt-center color-orange">报名已截止,只能编辑导师信息</p> <p class="edu-txt-center color-orange">报名已截止,只能编辑导师信息</p>
<% end %> <% end %>
<div class="df pl20 pr20 mt10"> <div class="df pl20 pr20 mt10">
<label class="mt3"><span class="mr3 color-orange">*</span>队名:</label> <label class="mt3"><span class="mr3 color-orange">*</span>队名:</label>
<input type="text" name="name" autocomplete="off" <%= none_edit ? "disabled" : "" %> maxlength="20" value="<%= @team.try(:name) %>" class="input-flex-35" placeholder="请输入您的队名称"/> <input type="text" name="name" autocomplete="off" <%= none_edit ? "disabled" : "" %> maxlength="20" value="<%= @team.try(:name) %>" class="input-flex-35" placeholder="请输入您的队名称"/>
</div> </div>
<p style="line-height: 27px;height: 27px"><span id="team_name_notice" class="color-orange-tip ml73 none"></span></p> <p style="line-height: 27px;height: 27px"><span id="team_name_notice" class="color-orange-tip ml73 none"></span></p>
<% if teacher_staff.present? %> <% if teacher_staff.present? %>
<div class="df pl20 pr20"> <div class="df pl20 pr20">
<label class="ml10 mt3">导师:</label> <label class="ml10 mt3"><%= single_staff ? '队员' : '导师' %></label>
<div class="flex1 pr search-new"> <div class="flex1 pr search-new">
<input type="text" class="input-100-35 fl" autocomplete="off" placeholder="请您输入老师姓名进行搜索;可以后续再添加导师" id="teacher_search_input" value=""> <input type="text" class="input-100-35 fl" autocomplete="off" placeholder="请您输入老师姓名进行搜索;可以后续再添加导师" id="teacher_search_input" value="">
<input type="hidden" id="teacher_id" data-select="0" value="<%= @team.try(:id).present? ? @team.try(:teacher_id) : (@team_user.user_extensions.identity == 0 ? @team_user.id : "") %>"> <input type="hidden" id="teacher_id" data-select="0" value="<%= @team.try(:id).present? ? @team.try(:teacher_id) : (@team_user.user_extensions.identity == 0 ? @team_user.id : "") %>">
@ -41,7 +42,7 @@
<div class="df pl20 pr20"> <div class="df pl20 pr20">
<label class="mt3"><span class="mr3 color-orange">*</span>队员:</label> <label class="mt3"><span class="mr3 color-orange">*</span>队员:</label>
<div class="flex1 search-new"> <div class="flex1 search-new">
<input type="text" class="search-new-input fl" <%= none_edit ? "disabled" : "" %> autocomplete="off" style="width: 100%" placeholder="请您输入想要添加的员搜索" id="user_search_input"> <input type="text" class="search-new-input fl" <%= none_edit ? "disabled" : "" %> autocomplete="off" style="width: 100%" placeholder="请您输入想要添加的员搜索" id="user_search_input">
<span class="search-span" style="background: #fff;"></span> <span class="search-span" style="background: #fff;"></span>
<input type="hidden" id="member_id" data-select="0"> <input type="hidden" id="member_id" data-select="0">
<input type="hidden" id="member_name"> <input type="hidden" id="member_name">
@ -51,7 +52,7 @@
<ul class="pointerTeacher none" id="pointerStudent"> <ul class="pointerTeacher none" id="pointerStudent">
</ul> </ul>
</div> </div>
<a class="fl ml20 white-btn edu-blueback-btn mt4 add-member-btn" style="display: none;" onclick="<%= none_edit ? '' : 'add_member()' %>">添加员</a> <a class="fl ml20 white-btn edu-blueback-btn mt4 add-member-btn" style="display: none;" onclick="<%= none_edit ? '' : 'add_member()' %>">添加员</a>
</div> </div>
<p style="line-height: 27px;height: 27px"><span id="member_notice" class="color-orange-tip ml73 none"></span></p> <p style="line-height: 27px;height: 27px"><span id="member_notice" class="color-orange-tip ml73 none"></span></p>
<% end %> <% end %>
@ -68,7 +69,7 @@
<% creator_teacher = @team.user.user_extensions.identity == 0 %> <% creator_teacher = @team.user.user_extensions.identity == 0 %>
<p class="personListLine clearfix pt5 pb5 personListMember <%= creator_teacher ? 'team-teacher' : 'team-member' %>" id="create_li"> <p class="personListLine clearfix pt5 pb5 personListMember <%= creator_teacher ? 'team-teacher' : 'team-member' %>" id="create_li">
<span class="t-c-1"><%= @team.user.show_name %></span> <span class="t-c-1"><%= @team.user.show_name %></span>
<span class="t-c-2"><%= @team.user.user_extensions.identity == 0 ? "导师/创建者" : "创建者" %></span> <span class="t-c-2"><%= @team.user.user_extensions.identity == 0 ? "#{ single_staff ? '队长' : '导师' }/创建者" : "#{ single_staff ? '队长/' : '' }创建者" %></span>
<span class="t-c-3"><%= @team.user.school_name %></span> <span class="t-c-3"><%= @team.user.school_name %></span>
<span class="t-c-4"><%= @team.user.user_extensions.identity == 0 ? "职称:#{@team.user.identity}" : "学号:#{@team.user.user_extensions.student_id.present? ? @team.user.user_extensions.student_id : "--"}" %></span> <span class="t-c-4"><%= @team.user.user_extensions.identity == 0 ? "职称:#{@team.user.identity}" : "学号:#{@team.user.user_extensions.student_id.present? ? @team.user.user_extensions.student_id : "--"}" %></span>
<span class="t-c-5"></span> <span class="t-c-5"></span>
@ -79,7 +80,7 @@
<p class="personListLine clearfix pt5 pb5 personListMember team-teacher team-teacher-<%= teacher.user.id %>"> <p class="personListLine clearfix pt5 pb5 personListMember team-teacher team-teacher-<%= teacher.user.id %>">
<input type="hidden" name="teacher_ids[]" value="<%= teacher.user.id %>"> <input type="hidden" name="teacher_ids[]" value="<%= teacher.user.id %>">
<span class="t-c-1"><%= teacher.user.show_name %></span> <span class="t-c-1"><%= teacher.user.show_name %></span>
<span class="t-c-2">导师</span> <span class="t-c-2"><%= single_staff ? '队员' : '导师' %></span>
<span class="t-c-3"><%= teacher.user.school_name %></span> <span class="t-c-3"><%= teacher.user.school_name %></span>
<span class="t-c-4">职称:<%= teacher.user.identity %></span> <span class="t-c-4">职称:<%= teacher.user.identity %></span>
<span class="t-c-5"><span class="delete_member" data-tip-down="删除"><i class="iconfont icon-guanbi font-14 color-grey-c"></i></span></span> <span class="t-c-5"><span class="delete_member" data-tip-down="删除"><i class="iconfont icon-guanbi font-14 color-grey-c"></i></span></span>
@ -91,7 +92,7 @@
<p class="personListLine clearfix pt3 pb3 personListMember team-member"> <p class="personListLine clearfix pt3 pb3 personListMember team-member">
<input type="hidden" name="member_ids[]" value="<%= team_user.user_id %>"> <input type="hidden" name="member_ids[]" value="<%= team_user.user_id %>">
<span class="t-c-1"><%= team_user.user.show_name %></span> <span class="t-c-1"><%= team_user.user.show_name %></span>
<span class="t-c-2">员</span> <span class="t-c-2">员</span>
<span class="t-c-3"><%= team_user.user.school_name %></span> <span class="t-c-3"><%= team_user.user.school_name %></span>
<span class="t-c-4">学号:<%= team_user.user.user_extensions.student_id.present? ? team_user.user.user_extensions.student_id : "--" %></span> <span class="t-c-4">学号:<%= team_user.user.user_extensions.student_id.present? ? team_user.user.user_extensions.student_id : "--" %></span>
<span class="t-c-5"> <span class="t-c-5">
@ -105,7 +106,7 @@
<% creator_teacher = @team_user.user_extensions.identity == 0 %> <% creator_teacher = @team_user.user_extensions.identity == 0 %>
<p class="personListLine clearfix pt5 pb5 personListMember <%= creator_teacher ? 'team-teacher' : 'team-member' %>" id="create_li"> <p class="personListLine clearfix pt5 pb5 personListMember <%= creator_teacher ? 'team-teacher' : 'team-member' %>" id="create_li">
<span class="t-c-1"><%= @team_user.show_name %></span> <span class="t-c-1"><%= @team_user.show_name %></span>
<span class="t-c-2"><%= @team_user.user_extensions.identity == 0 ? "导师/创建者" : "创建者" %></span> <span class="t-c-2"><%= @team_user.user_extensions.identity == 0 ? "#{ single_staff ? '队长' : '导师' }/创建者" : "#{ single_staff ? '队长/' : '' }创建者" %></span>
<span class="t-c-3"><%= @team_user.school_name %></span> <span class="t-c-3"><%= @team_user.school_name %></span>
<span class="t-c-4"><%= @team_user.user_extensions.identity == 0 ? "职称:#{@team_user.identity}" : "学号:#{@team_user.user_extensions.student_id.present? ? @team_user.user_extensions.student_id : "--"}" %></span> <span class="t-c-4"><%= @team_user.user_extensions.identity == 0 ? "职称:#{@team_user.identity}" : "学号:#{@team_user.user_extensions.student_id.present? ? @team_user.user_extensions.student_id : "--"}" %></span>
<span class="t-c-5"></span> <span class="t-c-5"></span>
@ -167,7 +168,7 @@
var li = '<p class="personListLine clearfix pt3 pb3 personListMember team-teacher team-teacher-' + $("#teacher_id").val() + '">' + var li = '<p class="personListLine clearfix pt3 pb3 personListMember team-teacher team-teacher-' + $("#teacher_id").val() + '">' +
' <input type="hidden" name="teacher_ids[]" value="'+$("#teacher_id").val()+'">' + ' <input type="hidden" name="teacher_ids[]" value="'+$("#teacher_id").val()+'">' +
' <span class="t-c-1">'+$("#teacher_name").val()+'</span>' + ' <span class="t-c-1">'+$("#teacher_name").val()+'</span>' +
' <span class="t-c-2">导师</span>' + ' <span class="t-c-2"><%= single_staff ? "队员" : "导师" %></span>' +
' <span class="t-c-3">'+$("#teacher_school").val()+'</span>' + ' <span class="t-c-3">'+$("#teacher_school").val()+'</span>' +
' <span class="t-c-4">职称:'+$("#teacher_title").val()+'</span>' + ' <span class="t-c-4">职称:'+$("#teacher_title").val()+'</span>' +
' <span class="t-c-5"><span class="delete_member" data-tip-down="删除"><i class="iconfont icon-guanbi font-14 color-grey-c"></i></span></span>' + ' <span class="t-c-5"><span class="delete_member" data-tip-down="删除"><i class="iconfont icon-guanbi font-14 color-grey-c"></i></span></span>' +
@ -193,7 +194,7 @@
var li = '<p class="personListLine clearfix pt3 pb3 personListMember team-member team-member-' + $("#member_id").val() + '">' + var li = '<p class="personListLine clearfix pt3 pb3 personListMember team-member team-member-' + $("#member_id").val() + '">' +
' <input type="hidden" name="member_ids[]" value="'+$("#member_id").val()+'">' + ' <input type="hidden" name="member_ids[]" value="'+$("#member_id").val()+'">' +
' <span class="t-c-1">'+$("#member_name").val()+'</span>' + ' <span class="t-c-1">'+$("#member_name").val()+'</span>' +
' <span class="t-c-2">员</span>' + ' <span class="t-c-2">员</span>' +
' <span class="t-c-3">'+$("#member_school").val()+'</span>' + ' <span class="t-c-3">'+$("#member_school").val()+'</span>' +
' <span class="t-c-4">学号:'+$("#member_student_id").val()+'</span>' + ' <span class="t-c-4">学号:'+$("#member_student_id").val()+'</span>' +
' <span class="t-c-5"><span class="delete_member" data-tip-down="删除"><i class="iconfont icon-guanbi font-14 color-grey-c"></i></span></span>' + ' <span class="t-c-5"><span class="delete_member" data-tip-down="删除"><i class="iconfont icon-guanbi font-14 color-grey-c"></i></span></span>' +

@ -1,4 +1,4 @@
<p class="pl30 color-orange-tip mt5 pb5 bor-bottom-greyE">请选择指导老师,允许修改</p> <!--<p class="pl30 color-orange-tip mt5 pb5 bor-bottom-greyE">请选择指导老师,允许修改</p>-->
<% @teachers.each do |teacher| %> <% @teachers.each do |teacher| %>
<% has_enroll = @competition.teacher_enroll_mutiple_limited && (@team.present? ? @competition.team_members.where("user_id = '#{teacher.id}' and id != #{@team.id}").count > 0 : @competition.team_members.where("user_id = '#{teacher.id}'").count > 0) %> <% has_enroll = @competition.teacher_enroll_mutiple_limited && (@team.present? ? @competition.team_members.where("user_id = '#{teacher.id}' and id != #{@team.id}").count > 0 : @competition.team_members.where("user_id = '#{teacher.id}'").count > 0) %>

@ -42,7 +42,7 @@
<div class="clearfix mb30 mt30"> <div class="clearfix mb30 mt30">
<a href="javascript:void(0);" class="defalutSubmitbtn fl mr20" onclick="competition_md_content_submit();">提交</a> <a href="javascript:void(0);" class="defalutSubmitbtn fl mr20" onclick="competition_md_content_submit();">提交</a>
<a href="<%= md_content_competitions_path(@md_content) %>" class="defalutCancelbtn fl">取消</a> <a href="<%= md_content_competitions_path(:md_content_id => @md_content) %>" class="defalutCancelbtn fl">取消</a>
</div> </div>
</div> </div>
<% end %> <% end %>

@ -5,8 +5,10 @@
<img src="<%= named_attachment_path(@images[2], @images[2].try(:filename)) %>" width="100%"/> <img src="<%= named_attachment_path(@images[2], @images[2].try(:filename)) %>" width="100%"/>
<div class="ccf-position-shixun"> <div class="ccf-position-shixun">
<p class="inline"> <p class="inline">
<a href="https://www.educoder.net/boards/5909/topics/34799" target="_blank" class="shixun-btn">入库标准</a> <% com_module_1 = @competition.competition_modules.where(:hidden => 0, :name => '入库标准').first %>
<a href="https://www.educoder.net/boards/5909/topics/34798" target="_blank" class="shixun-btn">使用说明</a> <a href="<%= md_content_competitions_path(:md_content_id => com_module_1.try(:competition_module_md_content).try(:id)) %>" target="_blank" class="shixun-btn">入库标准</a>
<% com_module_2 = @competition.competition_modules.where(:hidden => 0, :name => '使用说明').first %>
<a href="<%= md_content_competitions_path(:md_content_id => com_module_2.try(:competition_module_md_content).try(:id)) %>" target="_blank" class="shixun-btn">使用说明</a>
</p> </p>
</div> </div>
</div> </div>

@ -0,0 +1,100 @@
<% if @competitions.count > 0 %>
<div class="clearfix competitionsList">
<% @competitions.each do |competition| %>
<% if competition.status? %>
<div class="competitionsList-item mb20">
<div class="edu-back-white pr">
<% if competition.enroll_end_time.present? && competition.enroll_end_time > Time.now %>
<div class="applycompetitions">报名中</div>
<% end %>
<a href="<%= competition_path(competition) %>" class="competition-Img" target="_blank">
<%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %>
</a>
<div class="pt20 pl20 mb10 clearfix">
<a href="<%= competition_path(competition) %>" style="max-width: 400px;" class="font-16 task-hide fl" target="_blank"><%= [competition.name, competition.sub_title.presence].compact.join('——') %></a>
<% if competition.start_time > Time.now %>
<% unless competition.enroll_end_time.present? && competition.enroll_end_time < Time.now %>
<div class="fr status-orange">
<img src="/images/educoder/competition/home/orange.png" class="fl">
<span class="status-tag fl">报名中</span>
</div>
<% else %>
<div class="fr status-blue">
<img src="/images/educoder/competition/home/blue.png" class="fl">
<span class="status-tag fl">即将开始</span>
</div>
<% end %>
<% elsif competition.end_time < Time.now %>
<div class="fr status-grey">
<img src="/images/educoder/competition/home/grey.png" class="fl">
<span class="status-tag fl">已结束</span>
</div>
<% else %>
<% max_min_stage = max_min_stage_time competition %>
<% if max_min_stage.count == 1 %>
<div class="fr status-blue">
<img src="/images/educoder/competition/home/blue.png" class="fl">
<span class="status-tag fl">距离结束还剩<%= how_much_day competition.end_time %></span>
</div>
<% else %>
<% max_min_stage.each do |stage| %>
<% if stage.min_start_time > Time.now %>
<div class="fr status-blue">
<img src="/images/educoder/competition/home/blue.png" class="fl">
<span class="status-tag fl"><%= stage.competition_stage.name %>即将开始</span>
</div>
<% break %>
<% elsif stage.max_end_time > Time.now %>
<div class="fr status-blue">
<img src="/images/educoder/competition/home/blue.png" class="fl">
<span class="status-tag fl"><%= stage.competition_stage.name %>正在进行</span>
</div>
<% break %>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<p class="color-grey-B3 clearfix pl20 pr20 pb20">
<span class="fl"><span><%= format_date competition.start_time %></span>&nbsp;~&nbsp;<span><%= com_end_date competition.end_time %></span></span>
<span class="fr">
<span class="fl cdefault" data-tip-down="浏览数"><i class="iconfont icon-liulanyan font-16 fl mr3"></i><span class="font-12 mt3 fl"><%= competition.visits %></span></span>
<% if competition.member_count > 0 %>
<span class="ml30 fl cdefault" data-tip-down="报名数"><i class="iconfont icon-chengyuan font-16 fl mr3"></i>
<span class="font-12 mt4 fl">
<%= competition.identifier == "hn" ? 1125 : competition.member_count %>
</span>
</span>
<% end %>
</span>
</p>
</div>
</div>
<% elsif competition.published_at.present? %>
<% url = admin_or_business? ? competition_path(competition) : 'javascript:void(0)' %>
<div class="competitionsList-item mb20">
<div class="edu-back-white">
<a href="<%= url %>" class="competition-Img">
<%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %>
</a>
<div class="pt30 pb30 pl20 mt2 clearfix">
<a href="<%= url %>" style="max-width: 400px;" class="font-16 task-hide fl"><%= [competition.name, competition.sub_title.presence].compact.join('——') %></a>
<div class="fr status-orange">
<img src="/images/educoder/competition/home/orange.png" class="fl">
<span class="status-tag fl">即将发布</span>
</div>
</div>
<p class="color-grey-B3 clearfix pl20 pr20 pb20"></p>
</div>
<div class="competitionsList-item-tip strongNone">
<div class="color-white font-26">
<p>即将发布</p><p>敬请期待</p>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% else %>
<%= render :partial => "welcome/no_data" %>
<% end %>

@ -55,7 +55,7 @@
<a href="<%= com_module.url %>" target="_blank"><%= com_module.name %></a> <a href="<%= com_module.url %>" target="_blank"><%= com_module.name %></a>
</li> </li>
<% else %> <% else %>
<li class="<%= @md_content_header ? "active" : "" %>"> <li class="<%= @md_content_header && @md_content.competition_module_id == com_module.id ? "active" : "" %>">
<a href="<%= "#{md_content_competitions_path(:md_content_id => com_module.competition_module_md_content.try(:id))}" %>" target="_blank"><%= com_module.name %></a> <a href="<%= "#{md_content_competitions_path(:md_content_id => com_module.competition_module_md_content.try(:id))}" %>" target="_blank"><%= com_module.name %></a>
</li> </li>
<% end %> <% end %>

@ -1,101 +1,19 @@
<div class="educontent mt20 mb80"> <div class="educontent mt20 mb80">
<% if @competitions.count > 0 %>
<div class="clearfix competitionsList"> <div class="mt20 mb20 clearfix">
<% @competitions.each do |competition| %> <%= link_to '全部', competitions_path(category: ''), remote: true,
<% if competition.status? %> class: "fl mr20 font-16 bestChoose shixun_repertoire #{params[:category].blank? ? 'active' : ''}" %>
<div class="competitionsList-item mb20"> <%= link_to '进行中', competitions_path(category: 'progressing'), remote: true,
<div class="edu-back-white"> class: "fl mr20 font-16 bestChoose shixun_repertoire #{params[:category] == 'progressing' ? 'active' : ''}" %>
<a href="<%= competition_path(competition) %>" class="competition-Img" target="_blank"> <%= link_to '往期比赛', competitions_path(category: 'ended'), remote: true,
<%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %> class: "fl mr20 font-16 bestChoose shixun_repertoire #{params[:category] == 'ended' ? 'active' : ''}" %>
</a> </div>
<div class="pt20 pl20 mb10 clearfix">
<a href="<%= competition_path(competition) %>" style="max-width: 400px;" class="font-16 task-hide fl" target="_blank"><%= [competition.name, competition.sub_title.presence].compact.join('——') %></a> <div class="competition-list">
<% if competition.start_time > Time.now %> <%= render 'competitions/competition_list' %>
<% unless competition.enroll_end_time.present? && competition.enroll_end_time < Time.now %> </div>
<div class="fr status-orange">
<img src="/images/educoder/competition/home/orange.png" class="fl">
<span class="status-tag fl">报名中</span>
</div>
<% else %>
<div class="fr status-blue">
<img src="/images/educoder/competition/home/blue.png" class="fl">
<span class="status-tag fl">即将开始</span>
</div>
<% end %>
<% elsif competition.end_time < Time.now %>
<div class="fr status-grey">
<img src="/images/educoder/competition/home/grey.png" class="fl">
<span class="status-tag fl">已结束</span>
</div>
<% else %>
<% max_min_stage = max_min_stage_time competition %>
<% if max_min_stage.count == 1 %>
<div class="fr status-blue">
<img src="/images/educoder/competition/home/blue.png" class="fl">
<span class="status-tag fl">距离结束还剩<%= how_much_day competition.end_time %></span>
</div>
<% else %>
<% max_min_stage.each do |stage| %>
<% if stage.min_start_time > Time.now %>
<div class="fr status-blue">
<img src="/images/educoder/competition/home/blue.png" class="fl">
<span class="status-tag fl"><%= stage.competition_stage.name %>即将开始</span>
</div>
<% break %>
<% elsif stage.max_end_time > Time.now %>
<div class="fr status-blue">
<img src="/images/educoder/competition/home/blue.png" class="fl">
<span class="status-tag fl"><%= stage.competition_stage.name %>正在进行</span>
</div>
<% break %>
<% end %>
<% end %>
<% end %>
<% end %>
</div>
<p class="color-grey-B3 clearfix pl20 pr20 pb20">
<span class="fl"><span><%= format_date competition.start_time %></span>&nbsp;~&nbsp;<span><%= com_end_date competition.end_time %></span></span>
<span class="fr">
<span class="fl cdefault" data-tip-down="浏览数"><i class="iconfont icon-liulanyan font-16 fl mr3"></i><span class="font-12 mt3 fl"><%= competition.visits %></span></span>
<% if competition.member_count > 0 %>
<span class="ml30 fl cdefault" data-tip-down="报名数"><i class="iconfont icon-chengyuan font-16 fl mr3"></i>
<span class="font-12 mt4 fl">
<%= competition.identifier == "hn" ? 1125 : competition.member_count %>
</span>
</span>
<% end %>
</span>
</p>
</div>
</div>
<% elsif competition.published_at.present? %>
<% url = admin_or_business? ? competition_path(competition) : 'javascript:void(0)' %>
<div class="competitionsList-item mb20">
<div class="edu-back-white">
<a href="<%= url %>" class="competition-Img">
<%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %>
</a>
<div class="pt30 pb30 pl20 mt2 clearfix">
<a href="<%= url %>" style="max-width: 400px;" class="font-16 task-hide fl"><%= [competition.name, competition.sub_title.presence].compact.join('——') %></a>
<div class="fr status-orange">
<img src="/images/educoder/competition/home/orange.png" class="fl">
<span class="status-tag fl">即将发布</span>
</div>
</div>
<p class="color-grey-B3 clearfix pl20 pr20 pb20"></p>
</div>
<div class="competitionsList-item-tip strongNone">
<div class="color-white font-26">
<p>即将发布</p><p>敬请期待</p>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
<% else %>
<%= render :partial => "welcome/no_data" %>
<% end %>
</div> </div>
<script> <script>
$(function(){ $(function(){

@ -0,0 +1 @@
$(".competition-list").html("<%= j(render :partial => 'competitions/competition_list') %>");

@ -1,7 +1,7 @@
<div id="competition-content"> <div id="competition-content">
<% if @competition.identifier == "hn" %> <% if @competition.identifier == "hn" %>
<%= render :partial => "hn_competition" %> <%= render :partial => "hn_competition" %>
<% elsif @competition.identifier == "ccf-se-2018" %> <% elsif @competition.identifier == "ccf-se-2018" || @competition.identifier == "ccf-se-2019" %>
<%= render :partial => "ccf_competition" %> <%= render :partial => "ccf_competition" %>
<% elsif @competition.identifier == "gcc-dev-2018" %> <% elsif @competition.identifier == "gcc-dev-2018" %>
<%= render :partial => "qg_competition" %> <%= render :partial => "qg_competition" %>

@ -16,8 +16,10 @@
</ul> </ul>
</div> </div>
<div> <div>
<p class="footer_con-p inline lineh-30"><span class="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder<a style="color: #888;" target="_blank" href="http://beian.miit.gov.cn/" class="ml15 mr15">湘ICP备17009477号</a> <p class="footer_con-p inline lineh-30"><span class="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder
<a href="https://team.trustie.net" style="color: #888;" target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&&nbsp;&nbsp;&nbsp;IntelliDE inside. </p> <a style="color: #888;" target="_blank" href="http://beian.miit.gov.cn/" class="ml15 mr15">湘ICP备17009477号</a>
<a style="color: #888;" target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43019002000962" class="mr15"><img class="vertical4" src="/images/educoder/beian.png"/>湘公网安备 43019002000962号</a>
<a href="https://team.trustie.net" style="color: #888;" target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&&nbsp;&nbsp;&nbsp;IntelliDE inside. <span class="mr15">版权所有 湖南智擎科技有限公司</span></p>
</div> </div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>

@ -3,11 +3,11 @@
<img src="/images/educoder/success.png" width="100" class="mb30"> <img src="/images/educoder/success.png" width="100" class="mb30">
<div class="lineh-30 ed-txt-center font-24 color-grey-3 font-bd mb15"> <div class="lineh-30 ed-txt-center font-24 color-grey-3 font-bd mb15">
<p>恭喜!</p> <p>恭喜!</p>
<p>文档上传成功</p> <p>提交成功</p>
</div> </div>
<p class="lineh-30 ed-txt-center font-16 color-grey-9 font-bd mb15">通过平台管理员审核后,即可公开显示</p> <p class="lineh-30 ed-txt-center font-16 color-grey-9 font-bd mb15">平台正在审核您的申请,审核结果将以平台消息的形式通知您</p>
<li class="inline"> <li class="inline">
<%= link_to '查看已上传文档', libraries_path(type: 'mine'), class: 'white-btn edu-blueline-btn changebtn mr20 fl' %> <%= link_to '查看已上传文档', library_path(id: params[:id]), class: 'white-btn edu-blueline-btn changebtn mr20 fl' %>
<%= link_to '继续上传', new_library_path, class: 'white-btn edu-blueback-btn changebtn fl' %> <%= link_to '继续上传', new_library_path, class: 'white-btn edu-blueback-btn changebtn fl' %>
</li> </li>
</div> </div>

@ -23,25 +23,6 @@
<%= link_to('返回', libraries_path, class: 'fr color-grey-9 mt5') %> <%= link_to('返回', libraries_path, class: 'fr color-grey-9 mt5') %>
</p> </p>
<div class="edu-back-white"> <div class="edu-back-white">
<% if admin_or_self && !@library.published? && @library_applies.size > 0 %>
<div class="padding30 bor-bottom-greyE">
<p class="mb10 clearfix">
<span class="color-grey-6 font-16 mr10">私有化原因</span>
<span class="color-grey-c font-12">(请按照提示修改,并在完成编辑后重新提交)</span>
<a href="javascript:void(0)" class="color-blue fr" id="actionPanel" at="0" onclick="getMore(this)"></a>
<div class="private_reason">
<ul id="private_reason_ul">
<% @library_applies.each do |apply| %>
<li>
<p class="color-grey-9"><%= apply.updated_at.strftime('%Y-%m-%d %H:%M') %></p>
<p class="lineh-25 font-16 break-word"><%= apply.reason %></p>
</li>
<% end %>
</ul>
</div>
</div>
<% end %>
<div class="padding30"> <div class="padding30">
<div class="df"> <div class="df">
<%= link_to image_tag(url_to_avatar(@library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(@library.user) %> <%= link_to image_tag(url_to_avatar(@library.user), width: 50, height: 50, class: 'radius mr15 mt3'), user_path(@library.user) %>
@ -81,21 +62,6 @@
</div> </div>
</div> </div>
<script> <script>
function getMore(item) {
var at=$(item).attr("at");
var one=parseInt($("#private_reason_ul").find("li").eq(0).height())+10;
var two=parseInt($("#private_reason_ul").find("li").eq(1).height());
var plus=one+two;
if(at=="0"){
$(item).html('点击收起<i class="iconfont icon-shangjiantou color-blue font-14 ml5"></i>');
$(item).attr("at","1");
$(".private_reason").css({maxHeight:"unset"});
}else{
$(item).html('点击展开<i class="iconfont icon-xiajiantou color-blue font-14 ml5"></i>');
$(item).attr("at","0");
$(".private_reason").css({maxHeight:plus+"px"});
}
}
var homeworkDescr = editormd.markdownToHTML("labraries_editorMd_content", { var homeworkDescr = editormd.markdownToHTML("labraries_editorMd_content", {
htmlDecode: "style,script,iframe", // you can filter tags decode htmlDecode: "style,script,iframe", // you can filter tags decode
taskList: true, taskList: true,
@ -109,17 +75,6 @@
var id = $(this).data('id'); var id = $(this).data('id');
op_confirm_tip_1("是否确认删除?", "destroyLibrary(" + id + ");") op_confirm_tip_1("是否确认删除?", "destroyLibrary(" + id + ");")
}); });
if ($('#private_reason_ul').length != 0) {
var height=document.getElementById("private_reason_ul").offsetHeight;
var one=parseInt($("#private_reason_ul").find("li").eq(0).height())+10;
var two=parseInt($("#private_reason_ul").find("li").eq(1).height());
var plus=one+two;
if(parseInt(height)>166){
$("#actionPanel").html('点击展开<i class="iconfont icon-xiajiantou color-blue font-14 ml5"></i>');
$(".private_reason").css({maxHeight:plus+"px"});
}
}
}) })
function destroyLibrary (id) { function destroyLibrary (id) {

@ -1,7 +1,9 @@
<% group_mode = @competition.competition_staffs.sum(:maximum) > 1 %>
<table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0"> <table class="edu-pop-table edu-txt-center" cellpadding="0" cellspacing="0">
<thead> <thead>
<th>序号</th> <th>序号</th>
<% if @competition.max_num > 1 %> <% if group_mode %>
<th>创建者</th>
<th>战队名称</th> <th>战队名称</th>
<th>指导老师</th> <th>指导老师</th>
<th>队员姓名</th> <th>队员姓名</th>
@ -20,9 +22,10 @@
<% member_user = member.user %> <% member_user = member.user %>
<tr> <tr>
<td><%= (@page.to_i - 1)*50 + index + 1 %></td> <td><%= (@page.to_i - 1)*50 + index + 1 %></td>
<% if @competition.max_num > 1 %> <% if group_mode %>
<td><%= member.competition_team.user.show_real_name %></td>
<td><%= member.competition_team.try(:name) %></td> <td><%= member.competition_team.try(:name) %></td>
<td><%= member.competition_team.teacher.try(:show_real_name) %></td> <td><%= member.competition_team.teachers.map{|t| t.user.show_real_name}.join(',') %></td>
<% end %> <% end %>
<td><%= member_user.try(:show_real_name) %></td> <td><%= member_user.try(:show_real_name) %></td>
<td><%= member_user.try(:student_id) %></td> <td><%= member_user.try(:student_id) %></td>

@ -46,6 +46,10 @@
<% else %> <% else %>
<li class="clearfix<%= com_module.name == "通知公告" ? " noticeLi" : "" %>"> <li class="clearfix<%= com_module.name == "通知公告" ? " noticeLi" : "" %>">
<div class="fl"> <div class="fl">
<% if com_module.name == "首页" %> <!-- disabled导致competition_module为空 -->
<input type="hidden" name="competition_module[]" value="<%= com_module.id %>" />
<% end %>
<input type="checkbox" value="<%= com_module.id %>" name="competition_module[]" <%= com_module.hidden ? "" : "checked" %> <%= com_module.name == "首页" ? "disabled" : "" %> class="magic-checkbox" id="com_module_<%= com_module.id %>"> <input type="checkbox" value="<%= com_module.id %>" name="competition_module[]" <%= com_module.hidden ? "" : "checked" %> <%= com_module.name == "首页" ? "disabled" : "" %> class="magic-checkbox" id="com_module_<%= com_module.id %>">
<label for="com_module_<%= com_module.id %>" style="top:0px"> <label for="com_module_<%= com_module.id %>" style="top:0px">
<% if com_module.name != "首页" && com_module.name != "报名" && com_module.name != "通知公告" && com_module.name != "排行榜" && com_module.name != "资料下载" %> <% if com_module.name != "首页" && com_module.name != "报名" && com_module.name != "通知公告" && com_module.name != "排行榜" && com_module.name != "资料下载" %>

@ -57,7 +57,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
get :publish_success, on: :collection get :publish_success, on: :collection
end end
resources :project_packages, only: [:index, :show, :new, :edit, :destroy] do resources :project_packages, path: 'crowdsourcing', only: [:index, :show, :new, :edit, :destroy] do
get :apply_success, on: :member get :apply_success, on: :member
end end

@ -0,0 +1,8 @@
class MigrateCompetitionMdContent < ActiveRecord::Migration
def up
change_column :competition_module_md_contents, :content, :text
end
def down
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -225,7 +225,7 @@ class App extends Component {
<Route path="/fork_list" component={TPMshixunfork_listIndexComponent}> <Route path="/fork_list" component={TPMshixunfork_listIndexComponent}>
</Route> */} </Route> */}
{/*众包*/} {/*众包*/}
<Route path={"/project_packages"} component={ProjectPackages}/> <Route path={"/crowdsourcing"} component={ProjectPackages}/>
<Route path="/forums" component={ForumsIndexComponent}> <Route path="/forums" component={ForumsIndexComponent}>
</Route> </Route>

@ -26,9 +26,9 @@ class NotFoundPage extends Component {
| |
<Link to="/demo">上海社区</Link> <Link to="/demo">上海社区</Link>
| |
<Link to={"/project_packages"}>zb</Link> <Link to={"/crowdsourcing"}>zb</Link>
| |
<Link to={"/project_packages/new"}>zbne</Link> <Link to={"/crowdsourcing/new"}>zbne</Link>
</div> </div>

@ -51,6 +51,7 @@ class PackageConcent extends Component {
//否 string 排序,默认最新, recently, price //否 string 排序,默认最新, recently, price
// 否 string 类型, front,backend,mobile,database, cloud_compute_and_big_data,devops_and_test,ai,other // 否 string 类型, front,backend,mobile,database, cloud_compute_and_big_data,devops_and_test,ai,other
componentDidMount() { componentDidMount() {
window.document.title = '众包社区'
let {category,keyword,sort_by,sort_direction,page}=this.state let {category,keyword,sort_by,sort_direction,page}=this.state
this.setdatas(category,keyword,sort_by,sort_direction,page) this.setdatas(category,keyword,sort_by,sort_direction,page)
@ -136,7 +137,7 @@ class PackageConcent extends Component {
let {data,page,category,sort_by,sort_direction,project_packages}=this.state; let {data,page,category,sort_by,sort_direction,project_packages}=this.state;
return ( return (
<div className="educontent clearfix" style={{flex: "1 0 auto"}}> <div className="educontent clearfix mtf10" style={{flex: "1 0 auto"}}>
<div className="stud-class-set"> <div className="stud-class-set">
<div className="news"> <div className="news">
@ -156,14 +157,14 @@ class PackageConcent extends Component {
enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>} enterButton={<span><Icon type="search" className="mr5"/> 搜索</span>}
onSearch={ (value)=>this.setdatafuns(value)} /> onSearch={ (value)=>this.setdatafuns(value)} />
<Button type="primary" className="setissues fr" size={"large"}> <Button type="primary" className="setissues fr" size={"large"}>
<a href="/project_packages/new" >发布需求</a> <a href="/crowdsourcing/new" >发布需求</a>
</Button> </Button>
</p> </p>
</p> </p>
</div> </div>
</div> </div>
<div className="edu-back-white mb20"> <div className="edu-back-white mb30">
<p className="clearfix padding30"> <p className="clearfix padding30">
<p className="clearfix mb30 shaiContent"> <p className="clearfix mb30 shaiContent">
<span className="shaiTitle fl mt3">类型</span> <span className="shaiTitle fl mt3">类型</span>
@ -208,7 +209,7 @@ class PackageConcent extends Component {
{project_packages&&project_packages.map((item,key)=>{ {project_packages&&project_packages.map((item,key)=>{
return( return(
<div className="educontent project-packages-list" key={key}> <div className="educontent project-packages-list mb30" key={key}>
<div className="project-package-item"> <div className="project-package-item">
@ -222,7 +223,7 @@ class PackageConcent extends Component {
<div className=" item-head-title"> <div className=" item-head-title">
<a className={"fl mt3 font-20 font-bd color-dark maxwidth700 "} <a className={"fl mt3 font-20 font-bd color-dark maxwidth700 "}
href={"/project_packages/"+item.id} href={"/crowdsourcing/"+item.id}
title={item.title} title={item.title}
>{item.title}</a> >{item.title}</a>
</div> </div>
@ -238,24 +239,24 @@ class PackageConcent extends Component {
</div> </div>
<div className=" item-category"> <div className=" item-category mt10">
<div className=" item-category-item">{item.category_name}</div> <div className=" item-category-item">{item.category_name}</div>
</div> </div>
<div className=" item-other"> <div className=" item-other">
<div className=" item-group item-other-visit"> <div className=" item-group item-other-visit">
<span className=" item-group-icon"><i className="fa fa-eye"></i></span> <span className=" item-group-icon mr10"><i className="fa fa-eye"></i></span>
<span className=" item-group-text">{item.visit_count}人浏览</span> <span className=" item-group-text">{item.visit_count}人浏览</span>
</div> </div>
<div className=" item-group item-other-deadline"> <div className=" item-group item-other-deadline">
<span className=" item-group-icon"><i className="fa fa-clock-o"></i></span> <span className=" item-group-icon mr10"><i className="fa fa-clock-o"></i></span>
<span className=" item-group-text">{moment(item.deadline_at).endOf('day').fromNow()}竞标截止</span> <span className=" item-group-text">{moment(item.deadline_at).endOf('day').fromNow()}竞标截止</span>
</div> </div>
<div className=" item-group item-other-bidding ml0"> <div className=" item-group item-other-bidding ml0">
<span className=" item-group-icon"><i className="fa fa-user" ></i></span> <span className=" item-group-icon mr10"><i className="fa fa-user" ></i></span>
<span className=" item-group-text">{item.bidding_users_count}人竞标</span> <span className=" item-group-text">{item.bidding_users_count}人竞标</span>
</div> </div>

@ -11,7 +11,7 @@ class PackageIndex extends Component{
} }
componentDidMount(){ componentDidMount(){
window.document.title = '众包社区'
} }
render() { render() {

@ -49,6 +49,7 @@ class PackageIndexNEITaskDetails extends Component {
componentDidMount() { componentDidMount() {
this.getdatas() this.getdatas()
window.document.title = '众包社区'
} }
getdatas=()=>{ getdatas=()=>{
@ -248,11 +249,11 @@ class PackageIndexNEITaskDetails extends Component {
<div className={"educontent mt20 mb50"}> <div className={"educontent mt20 mb50"}>
<Breadcrumb separator={'>'} className={"fl"}> <Breadcrumb separator={'>'} className={"fl"}>
<Breadcrumb.Item>{this.props.current_user.username}</Breadcrumb.Item> {/*<Breadcrumb.Item>{this.props.current_user.username}</Breadcrumb.Item>*/}
<Breadcrumb.Item> <Breadcrumb.Item>
<a href="/project_packages">任务大厅</a> <a href="/crowdsourcing">众包社区</a>
</Breadcrumb.Item> </Breadcrumb.Item>
<Breadcrumb.Item>详情</Breadcrumb.Item> <Breadcrumb.Item><span className={"tabelcli"} title={data&&data.title}>{data&&data.title}</span></Breadcrumb.Item>
</Breadcrumb> </Breadcrumb>
<a className="color-grey-6 fr font-15 mr20" onClick={this.goback}>返回</a> <a className="color-grey-6 fr font-15 mr20" onClick={this.goback}>返回</a>
@ -289,8 +290,8 @@ class PackageIndexNEITaskDetails extends Component {
onMouseOver={this.setover} onMouseOver={this.setover}
onMouseOut={this.setout} onMouseOut={this.setout}
> >
{overtype===false?<a className="ContacttheTA fl" href={`/users/${this.props.current_user.login}/private_messages`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>: {overtype===false?<a className="ContacttheTA fl" target="_blank" href={`/users/${this.props.current_user.login}/message_detail?user_id=${data&&data.creator.id}`}> <img alt="头像" class="mr5" src={require('./newsone.png')} />联系TA</a>:
<a className="ContacttheTAs fl" href={`/users/${this.props.current_user.login}/private_messages`}> <img alt="头像" className="mr5" <a className="ContacttheTAs fl" target="_blank" href={`/users/${this.props.current_user.login}/message_detail?user_id=${data&&data.creator.id}`}> <img alt="头像" className="mr5"
src={require('./newstwo.png')}/>联系TA</a>} src={require('./newstwo.png')}/>联系TA</a>}
</div>} </div>}
</div> </div>
@ -344,13 +345,13 @@ class PackageIndexNEITaskDetails extends Component {
</div> </div>
{/*详情*/} {/*详情*/}
<div className={"stud-class-set padding30 coursenavbox edu-back-white mt20"}> <div className={"stud-class-set padding26 coursenavbox edu-back-white mt20"}>
<div> <div>
<div className={"longboxs"}> <div className={"longboxs"}>
需求详情 需求详情
{data&&data.status==="pending"&&data&&data.operation.can_select_bidding_user===true?<div className="fr"> {data&&data.status==="pending"&&data&&data.operation.can_select_bidding_user===true?<div className="fr">
<a className="task-btn-nebules fr" href={`/project_packages/${this.props.match.params.id}/edit`}>编辑</a> <a className="task-btn-nebules fr" href={`/crowdsourcing/${this.props.match.params.id}/edit`}>编辑</a>
<a className="task-btn-nebules fr" onClick={this.deletePackages}>删除</a> <a className="task-btn-nebules fr" onClick={this.deletePackages}>删除</a>
</div>:""} </div>:""}
@ -380,9 +381,9 @@ class PackageIndexNEITaskDetails extends Component {
{/*发布者和竞选者状态show*/} {/*发布者和竞选者状态show*/}
{this.state.setbiddingmantype===false&&data&&data.published_at!=null?<div className={"stud-class-set coursenavbox edu-back-white mt20"}> {this.state.setbiddingmantype===false&&data&&data.published_at!=null?<div className={"stud-class-set coursenavbox edu-back-white mt20"}>
{/*下面是头像*/} {/*下面是头像*/}
<div className={"stud-class-set pd30a0 coursenavbox edu-back-white"}> <div className={"stud-class-set pd26 coursenavbox edu-back-white"}>
<div className={"relativef"}> <div className={"relativef"}>
<div className={"longboxs"}> <div className={"longboxs mb0"}>
报名列表({data&&data.bidding_users.length}) 报名列表({data&&data.bidding_users.length})
</div> </div>
<div className="packageabsolute"> <div className="packageabsolute">
@ -392,7 +393,7 @@ class PackageIndexNEITaskDetails extends Component {
</div> </div>
</div> </div>
<div className={"ysllogin_register_contents edu-back-white "} style={{borderTop: '1px solid rgb(234, 234, 234)'}}> <div className={"ysllogin_register_contents ysllogin_register_contentss edu-back-white "} style={{borderTop: '1px solid rgb(234, 234, 234)'}}>
<div className="ysllogin_section"> <div className="ysllogin_section">
<div className="ysldivhome2"> <div className="ysldivhome2">
<div style={{height: "20px"}}> </div> <div style={{height: "20px"}}> </div>
@ -403,7 +404,7 @@ class PackageIndexNEITaskDetails extends Component {
{item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""} {item.status==="bidding_won"?<img src={gouxuan} className="yslgouxuanimg"/>:""}
<a href={`/users/${item.login}`}><img className="div1img" src={item.avatar_url}/></a> <a href={`/users/${item.login}`}><img className="div1img" src={item.avatar_url}/></a>
<div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div> <div className="textall mt10" title={item.name}> <p className="ptext">{item.name}</p></div>
{this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" href={`/users/${this.props.current_user.login}/private_messages`}> {this.props.current_user.login!=item.login?<a className="ContacttheTAs fl none" target="_blank" href={`/users/${this.props.current_user.login}/message_detail?user_id=${item.id}`}>
<img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA <img alt="头像" className="mr5" src={require('./newstwo.png')}/>联系TA
</a>:""} </a>:""}
</div> </div>
@ -426,9 +427,9 @@ class PackageIndexNEITaskDetails extends Component {
{this.state.setbiddingmantype===true?<div className={"stud-class-set coursenavbox edu-back-white mt20"}> {this.state.setbiddingmantype===true?<div className={"stud-class-set coursenavbox edu-back-white mt20"}>
{/*发布人选择状态*/} {/*发布人选择状态*/}
{/*下面是头像*/} {/*下面是头像*/}
<div className={"stud-class-set pd30a0 coursenavbox edu-back-white"}> <div className={"stud-class-set pd26 coursenavbox edu-back-white"}>
<div className={"relativef"}> <div className={"relativef"}>
<div className={"longboxs"}> <div className={"longboxs mb0"}>
报名列表({data&&data.bidding_users.length}) 报名列表({data&&data.bidding_users.length})
</div> </div>
@ -441,7 +442,7 @@ class PackageIndexNEITaskDetails extends Component {
</div> </div>
</div> </div>
</div> </div>
<div className={"ysllogin_register_contents edu-back-white "} style={{borderTop: '1px solid rgb(234, 234, 234)'}}> <div className={"ysllogin_register_contents ysllogin_register_contentss edu-back-white "} style={{borderTop: '1px solid rgb(234, 234, 234)'}}>
<div className="ysllogin_section"> <div className="ysllogin_section">
<div className="ysldivhome2"> <div className="ysldivhome2">
<div style={{height: "20px"}}> </div> <div style={{height: "20px"}}> </div>
@ -449,7 +450,7 @@ class PackageIndexNEITaskDetails extends Component {
return( return(
<div className="ysldivhomediv1" onClick={()=>this.Clickteacher2(item.id)} key={key}> <div className="ysldivhomediv1" onClick={()=>this.Clickteacher2(item.id)} key={key}>
{item.bool===true?<img src={gouxuan} className="yslgouxuanimg"/>:<img src={weigouxuan} className="yslgouxuanimg"/>} {item.bool===true?<img src={gouxuan} className="yslgouxuanimg"/>:<img src={weigouxuan} className="yslgouxuanimg"/>}
<a href={`/users/${item.login}`}><img className="div1img" src={item.avatar_url}/></a> <a href={`/users/${item.login}`} target="_blank"><img className="div1img" src={item.avatar_url}/></a>
<span className={item.bool===true?"textall mt10 color-blue":"textall mt10"} title={item.name}> <p className="ptext">{item.name}</p></span> <span className={item.bool===true?"textall mt10 color-blue":"textall mt10"} title={item.name}> <p className="ptext">{item.name}</p></span>
</div> </div>
) )

@ -5,13 +5,20 @@
flex-direction: row; flex-direction: row;
margin-bottom: 20px; margin-bottom: 20px;
} }
.ysllogin_register_contents{ .ysllogin_register_contents{
display: flex; display: flex;
margin-top: 20px; margin-top: 20px;
/*justify-content: center;*/ /*justify-content: center;*/
background: #fff; background: #fff;
}
.ysllogin_register_contentss{
margin-top:0px !important;
padding-top: 10px;
padding-bottom: 10px;
} }
.ysldivhomediv1{ .ysldivhomediv1{
width: 80px; width: 80px;
height: 130px; height: 130px;

@ -75,7 +75,7 @@ class PackageIndexNEIBannerConcent extends Component {
} }
componentDidMount() { componentDidMount() {
window.document.title = '众包社区'
if(this.props.match.params.id!=undefined){ if(this.props.match.params.id!=undefined){
let url=`/api/v1/project_packages/${this.props.match.params.id}.json` let url=`/api/v1/project_packages/${this.props.match.params.id}.json`
@ -454,7 +454,7 @@ class PackageIndexNEIBannerConcent extends Component {
if(type===true){ if(type===true){
this.props.setPublicationfun(response.data.id) this.props.setPublicationfun(response.data.id)
}else{ }else{
window.location.href="/project_packages/"+response.data.id window.location.href="/crowdsourcing/"+response.data.id
} }
this.setState({ this.setState({
springtype:false springtype:false
@ -502,7 +502,7 @@ class PackageIndexNEIBannerConcent extends Component {
if(type===true){ if(type===true){
this.props.setPublicationfun(response.data.id) this.props.setPublicationfun(response.data.id)
}else{ }else{
window.location.href="/project_packages/"+response.data.id window.location.href="/crowdsourcing/"+response.data.id
} }
this.setState({ this.setState({
springtype:false springtype:false

@ -10,15 +10,14 @@ class PackageIndexNEISubmit extends Component {
} }
} }
componentDidMount() { componentDidMount() {
window.document.title = '众包社区'
} }
setageload=(sum)=>{ setageload=(sum)=>{
if(sum===undefined){ if(sum===undefined){
window.location.href="/project_packages/new" window.location.href="/crowdsourcing/new"
}else{ }else{
// this.props.history.push("/project_packages/"+sum) // this.props.history.push("/project_packages/"+sum)
window.location.href="/project_packages/"+sum window.location.href="/crowdsourcing/"+sum
} }
} }

@ -18,8 +18,9 @@ class PackageIndexNewandEditIndex extends Component{
} }
componentDidMount(){ componentDidMount(){
window.document.title = '众包社区'
} }
setPublicationfun=(ids)=>{ setPublicationfun=(ids)=>{
this.setState({ this.setState({
setPublication:true, setPublication:true,

@ -31,6 +31,10 @@ class ProjectPackageIndex extends Component {
super(props) super(props)
} }
componentDidMount(){
window.document.title = '众包社区'
}
render() { render() {
return ( return (
@ -39,25 +43,25 @@ class ProjectPackageIndex extends Component {
<Switch> <Switch>
{/*众包首页*/} {/*众包首页*/}
<Route path="/project_packages/:id/edit" <Route path="/crowdsourcing/:id/edit"
render={ render={
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />) (props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route path="/project_packages/new" <Route path="/crowdsourcing/new"
render={ render={
(props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />) (props) => (<PackageIndexNewandEdit {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route path="/project_packages/:id" <Route path="/crowdsourcing/:id"
render={ render={
(props) => (<PackageIndexNEITaskDetails {...this.props} {...props} {...this.state} />) (props) => (<PackageIndexNEITaskDetails {...this.props} {...props} {...this.state} />)
} }
></Route> ></Route>
<Route path="/project_packages" <Route path="/crowdsourcing"
render={ render={
(props) => (<PackageIndex {...this.props} {...props} {...this.state} />) (props) => (<PackageIndex {...this.props} {...props} {...this.state} />)
} }

@ -97,8 +97,8 @@
line-height: 28px; line-height: 28px;
} }
.pd30a0{ .pd26a0{
padding: 30px 30px 16px 30px; padding: 26px 26px 16px 26px;
} }
.newFormbox .attachment .icon-fujian{ .newFormbox .attachment .icon-fujian{
@ -226,7 +226,7 @@
width: 80px; width: 80px;
height: 26px; height: 26px;
font-size: 14px; font-size: 14px;
line-height: 26px; line-height: 24px;
/*display: block;*/ /*display: block;*/
border: 1px solid #fff !important; border: 1px solid #fff !important;
background-color: #4CACFF; background-color: #4CACFF;
@ -275,7 +275,7 @@
.packageabsolute{ .packageabsolute{
position: absolute; position: absolute;
right: -16px; right: -16px;
top: -11px; top: -7px;
} }
.relativef{ .relativef{
position: relative; position: relative;
@ -313,3 +313,26 @@
.ml0{ .ml0{
margin-left: 0px; margin-left: 0px;
} }
.tabelcli{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 850px;
display: table-cell;
}
.mtf10{
margin-top:-10px;
}
.padding26{
padding: 26px;
box-sizing: border-box;
}
.pd26{
padding: 26px;
}
.pd30a0{
padding: 30px 30px 16px 30px;
}

@ -54,13 +54,20 @@ class NewFooter extends Component {
<li><a href="/help?index=6" className="fl" target="_blank">意见反馈</a></li> <li><a href="/help?index=6" className="fl" target="_blank">意见反馈</a></li>
</ul> </ul>
</div> </div>
<div>
<div> <div>
<p className="footer_con-p inline lineh-30 font-14"> <p className="footer_con-p inline lineh-30 font-14">
<span class="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder<span class="ml15 mr15">ICP17009477</span><a href="https://team.trustie.net" style={{"color":"#888"}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;<span>&</span>&nbsp;&nbsp;&nbsp;IntelliDE inside.</p> <span className="font-18 fl">©</span>&nbsp;2019&nbsp;EduCoder
<a style={{color: '#888'}} target="_blank" href="http://beian.miit.gov.cn/" className="ml15 mr15">湘ICP备17009477号</a>
<a style={{color: '#888'}} target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=43019002000962" className="mr15">
<img className="vertical4" src={require('./beian.png')} />湘公网安备43019002000962号</a>
<a href="https://team.trustie.net" style={{color: '#888'}} target="_blank">Trustie</a>&nbsp;&nbsp;&nbsp;&&nbsp;&nbsp;&nbsp;IntelliDE inside. <span className="mr15"> </span>
</p>
</div> </div>
<div className="cl"></div> <div className="cl"></div>
</div> </div>
</div> </div>
</div>
); );
} }
} }

@ -303,7 +303,7 @@ class NewHeader extends Component {
<li className={`${competitions === true ? 'active' : ''}`} ><a href="/competitions">在线竞赛</a></li> <li className={`${competitions === true ? 'active' : ''}`} ><a href="/competitions">在线竞赛</a></li>
<li className={`${competitions === true ? 'active' : ''}`} style={{display:project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'none':'block'}} > <li className={`${competitions === true ? 'active' : ''}`} style={{display:project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'none':'block'}} >
<a href="/project_packages"> <a href="/crowdsourcing">
{project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包'} {project_packages_url===null||project_packages_url===undefined||project_packages_url===""?'':'众包'}
</a> </a>
</li> </li>

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -3511,3 +3511,8 @@ line-height: 16px;display: inline-block;color: rgba(65, 140, 205, 1) !important;
width: 412px; width: 412px;
display: inline-block; display: inline-block;
} }
.vertical4{
vertical-align: -4px;
margin-right: 0px !important;
}

@ -578,7 +578,12 @@ a.user_greybg_btn{background-color:#747A7F;color: #fff;}
.new_li li{ list-style-type: disc!important; } .new_li li{ list-style-type: disc!important; }
.new_li ol li{ list-style-type: decimal!important; } .new_li ol li{ list-style-type: decimal!important; }
.new_li li{ margin-bottom: 0!important; } .new_li li{ margin-bottom: 0!important; }
.markdown-toc .markdown-toc-list li{
/*list-style-type: disc!important;*/
/*list-style-type: decimal!important;*/
/*margin-bottom: 0!important;*/
list-style-type: none !important;
}
/*搜索框*/ /*搜索框*/
#pollingPanel{position: relative;width: 248px;height: 32px;} #pollingPanel{position: relative;width: 248px;height: 32px;}
#pollingPanel > input{width: 100%;height: 100%;border:1px solid #eaeaea;border-radius: 4px;padding: 0px 30px 0px 5px;box-sizing: border-box;background-color: #F4F4F4;} #pollingPanel > input{width: 100%;height: 100%;border:1px solid #eaeaea;border-radius: 4px;padding: 0px 30px 0px 5px;box-sizing: border-box;background-color: #F4F4F4;}
@ -1115,3 +1120,22 @@ html>body #ajax-indicator { position: fixed; }
color: coral; color: coral;
padding: 0 3px; padding: 0 3px;
} }
.applycompetitions{
line-height: 30px;
border-radius: 14px;
color: #666;
background: rgba(41,189,139,1);
opacity: 0.8;
font-size: 14px;
font-family: MicrosoftYaHei;
font-weight: 400;
color: rgba(255,255,255,1);
position: absolute;
bottom: 139px;
left: 18px;
width: 73px;
height: 30px;
text-align: center;
}
Loading…
Cancel
Save