dev_aliyun
daiao 6 years ago
commit 49df1430dd

@ -1133,6 +1133,12 @@ end
render :json => {:status => 1}
end
def update_competition_text
text = CompetitionTextConfig.find(params[:id])
text.update_attributes(name: params[:name], description: params[:description])
render :json => {:status => 1}
end
def delete_competition_text
ctc = CompetitionTextConfig.find params[:id]
ctc.destroy

@ -1,4 +1,4 @@
class CompetitionTextConfig < ActiveRecord::Base
# attr_accessible :title, :body
attr_accessible :name, :description, :competition_id
belongs_to :competition
end

@ -4,54 +4,59 @@
<div class="openSource_2" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
<% index += 1 %>
<% @competition.competition_stages.each_with_index do |stage, i| %>
<div class="openSource_<%= index + 1 %>" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;">
<%
first_section = stage.competition_stage_sections[0]
second_section = stage.competition_stage_sections[1]
%>
<div class="enter_panel" style="height: 285px">
<ul>
<p class="font-22 enter_title padding30 clearfix">
<span class="fl ml30">
<span class="mr20 font-bd"><%= first_section.try(:name) %></span>
<span><%= first_section.start_time.try(:strftime, '%Y年%m月%d日') %>~<%= first_section.end_time.try(:strftime, '%Y年%m月%d日') %></span>
</span>
<span class="fr mr30">
<span class="mr20 font-bd"><%= second_section.try(:name) %></span>
<span><%= second_section.try(:start_time).try(:strftime, '%Y年%m月%d日') %>~<%= second_section.try(:end_time).try(:strftime, '%Y年%m月%d日') %></span>
</span>
</p>
<li class="inline enter_btn mt20">
<% is_start = Time.now > first_section.start_time %>
<% first_section.competition_entries.each_with_index do |entry, j| %>
<%
competition_url = User.current.logged? ? "#{entry.url}?eid=#{User.current.id}" : "#{entry.url}"
btn_url = is_start ? "#{competition_url}" : "javascript:void(0);"
%>
<a class="li-1 <%= is_start ? 'active' : '' %>"
href="javascript:void(0);"
data-url="<%= btn_url %>"><%= entry.name %></a>
<% end %>
</li>
</ul>
<div class="openSource_3" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;">
<div class="enter_panel" style="height: 300px">
<p class="desc_game">
<%= @competition.competition_text_configs.first.try(:description) %>
</p>
</div>
</div>
<% index += 1 %>
<%
first_stage = @competition.competition_stages.first
first_section = first_stage.competition_stage_sections.first
first_entry = first_section.competition_entries.first
is_start = Time.now > first_section.start_time
competition_url = User.current.logged? ? "#{first_entry.url}?eid=#{User.current.id}" : "#{first_entry.url}"
btn_url = is_start ? "#{competition_url}" : "javascript:void(0);"
%>
<div class="openSource_4" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;">
<div class="educontent">
<a href="javascript:void(0)" data-url="<%= btn_url %>" class="enroll-btn <%= is_start ? 'active' : '' %>" style="float:right;height:282px;width:50%"></a>
</div>
</div>
<% index += 1 %>
<% end %>
<div class="openSource_5" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
<% index += 1 %>
<div class="openSource_6" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
<% index += 1 %>
<div class="openSource_7" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
<% index += 1 %>
<div class="openSource_7" style="background: url('<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>') no-repeat top center;"></div>
<script>
$(function(){
var userLogged = <%= @user.present? && @user.logged? %>;
var userEnrolled = <%= @enrolled %>;
<%
course_id = nil
user_enrolled = false
invite_code = nil
if first_entry.url.present?
course_id = first_entry.url.split('/')[-2, 1]
course = Course.find_by_id(course_id)
if course.present? && @user && @user.logged?
user_enrolled = @user.member_of_course?(course)
invite_code = course.invite_code
end
end
%>
var userEnrolled = <%= user_enrolled %>;
$(".enter_btn .li-1.active").on("click", function(){
$(".enroll-btn.active").on("click", function(){
var url = $(this).data("url");
if (!userLogged) {
@ -60,7 +65,20 @@
}
if (!userEnrolled) {
sure_box_redirect_without_newtab_btn("<%= enroll_competition_path(id: params[:id]) %>", "完成报名后即可参赛", "我要报名");
$.ajax({
url: "/api/courses/apply_to_join_course.json",
type: "post",
dataType: 'json',
data: {
student: 1,
invite_code: "<%= invite_code %>"
},
success: function(){
var newTab = window.open("_blank");
newTab.location = url;
window.location.reload()
}
})
return;
}

@ -43,7 +43,7 @@
</ul>
</div>
<div class="seperateLine"></div>
<input type="text" class="search-input fl" id="search-input" name="search_keyword" placeholder="搜索实训项目"/>
<input type="text" class="search-input fl" id="search-input" name="search_keyword" placeholder="实践课程/翻转课堂/开发社区/交流问答"/>
<a href="javascript:void(0)" class="search-icon fl" id="header_keyword_search">
<i class="iconfont icon-sousuo color-blue mt14 fl"></i>
</a>

@ -41,7 +41,7 @@
</ul>
</div>
<div class="seperateLine"></div>
<input type="text" class="search-input fl" id="search-input" name="search_keyword" placeholder="搜索实训项目"/>
<input type="text" class="search-input fl" id="search-input" name="search_keyword" placeholder="实践课程/翻转课堂/开发社区/交流问答"/>
<a href="javascript:void(0)" class="search-icon fl" id="header_keyword_search">
<!--<svg class="icon fl mt23" width="20px" height="20px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#333333" d="M463.9 804.4c-194.7 0-353.1-158.4-353.1-353.1S269.2 98.2 463.9 98.2 817 256.6 817 451.3 658.6 804.4 463.9 804.4z m0-651.9c-164.8 0-298.8 134-298.8 298.8s134 298.8 298.8 298.8 298.8-134 298.8-298.8-134-298.8-298.8-298.8zM884.9 926.6c-7.2 0-14.4-2.9-19.8-8.6l-198-210.6c-10.3-10.9-9.7-28.1 1.2-38.4 10.9-10.3 28.1-9.8 38.4 1.2l198 210.6c10.3 10.9 9.7 28.1-1.2 38.4-5.2 5-11.9 7.4-18.6 7.4z" /></svg>-->
<i class="iconfont icon-sousuo color-blue mt14 fl"></i>

@ -3,7 +3,7 @@
<div class="bor-grey-e mb20" id="homePagePara">
<p class="clearfix bor-bottom-greyE pr20 pt5 pb5">
<input type="text" value="首页文字说明" name="config_name" class="panel-box-sizing childcenter_title_input"/>
<a href="javascript:void(0)" class="fr color-blue" onclick="create_submit_data(this);">保存</a>
<a href="javascript:void(0)" class="fr color-blue" onclick="save_submit_data(null, this);">保存</a>
<a href="javascript:void(0)" class="fr mr20" onclick="removePanel();">删除</a>
</p>
<div class="padding15">
@ -130,7 +130,7 @@
<div class="bor-grey-e mb20" id="homePagePara_<%= text.id %>">
<p class="clearfix bor-bottom-greyE pr20 pt5 pb5">
<input type="text" value="<%= text.name %>" name="config_name" class="panel-box-sizing childcenter_title_input">
<a href="javascript:void(0)" class="fr color-blue" onclick="create_submit_data(this);">保存</a>
<a href="javascript:void(0)" class="fr color-blue" onclick="save_submit_data(<%= text.id %>, this);">保存</a>
<a href="javascript:void(0)" class="fr mr20" onclick="removePanel(<%= text.id %>);">删除</a>
</p>
<div class="padding15">
@ -563,6 +563,27 @@
})
}
function save_submit_data(id, nThis){
if (!id) {
create_submit_data(nThis);
return;
}
var textContainer = $('#homePagePara_' + id);
var name = textContainer.find('input[name="config_name"]').val();
var description = textContainer.find('textarea[name="config_description"]').val();
$.ajax({
url: "<%= update_competition_text_managements_path %>",
data: {id: id, name: name, description: description},
type: "post",
success: function (data) {
if(data.status == 1) {
notice_box("保存成功!");
}
}
});
}
$(function(){
$('.add-competition-staff-btn').on('click', function(){
$('.competition-staff-settings').append($('.competition-staff-row-example').html());

@ -2,7 +2,8 @@
<% @tids.each do |tids| %>
<% Rails.logger.info("------------------------tid_id---#{tids.id}") %>
<div class="pl25 ridinglist edu-back-white">
<div class="ridinglist-sub clearfix df tiding_item" data-url="<%= tiding_url tids %>">
<!-- <div class="ridinglist-sub clearfix df tiding_item" data-url="<%#= tiding_url tids %>">-->
<div class="ridinglist-sub clearfix df tiding_item">
<% system = tids.tiding_type == "System" %>
<% trigger_user = tids.user %>
<% eval_user = (tids.container_type == "StudentWorksScore" && tids.extra == "3") || (tids.container_type == "StudentWorksScoresAppeal" && tids.parent_container_type == "StudentWork" && tids.tiding_type == "HomeworkCommon") || (tids.container_type == "JournalsForMessage" && tids.tiding_type != "Mentioned" && tids.parent_container_type == "StudentWorksScore" && tids.container.jour.try(:reviewer_role) == 3 && !trigger_user.allowed_to?(:as_teacher, tids.container.jour.student_work.homework_common.course)) %>

@ -265,6 +265,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'export_chart_score'
post 'competition_images'
post 'publish'
post 'join_course'
end
collection do
post 'new_competition'
@ -730,6 +731,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
get 'graduation_standard'
post 'create_standard'
post 'create_competition_text'
post 'update_competition_text'
delete 'delete_competition_text'
post 'add_contents_for_school'
post 'add_course_info_for_school'

@ -0,0 +1,8 @@
class ChangeCompetitionTextConfigs < ActiveRecord::Migration
def up
change_column :competition_text_configs, :description, :text
end
def down
end
end

@ -405,7 +405,7 @@ function header_search(){
// $.get('/users/search_shixuns_or_course',
// { search: keyword,
// index: index});
window.location.href = "/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index;
window.location.href = "/search" + "?value=" + keyword;
//e.stopPropagation();//阻止冒泡
}

@ -5,10 +5,10 @@ $(function(){
$(".headphoto").find(".headphoto-black").hide();
});
$("#user_tiddings").on("click", ".tiding_item", function(e){
window.open($(this).attr("data-url"), "_blank");
e.stopPropagation();
});
// $("#user_tiddings").on("click", ".tiding_item", function(e){
// window.open($(this).attr("data-url"), "_blank");
// e.stopPropagation();
// });
$("#user_tiddings").on("click", ".tiding_user_a", function(e){
window.open($(this).attr("data-url"), "_blank");

@ -1,14 +1,23 @@
import React, { Component } from 'react';
import { BrowserRouter as Router, Route, Link } from "react-router-dom";
import { Spin } from 'antd';
class Loading extends Component {
render() {
// Loading
return (
<div className="App" style={{minHeight: '800px'}}>
</div>
<div className="App" style={{minHeight: '800px',width:"100%"}}>
<style>
{
`
.margintop{
margin-top:20%;
}
`
}
</style>
<Spin size="large" className={"margintop"}/>
</div>
);
}
}

@ -100,7 +100,7 @@ function header_search(){
// $.get('/users/search_shixuns_or_course',
// { search: keyword,
// index: index});
window.location.href = "/users/search_shixuns_or_courses" + "?search=" + keyword + "&index=" + index;
window.location.href = "/search" + "?value=" + keyword;
//e.stopPropagation();//阻止冒泡
}
//头部导航条的隐藏
@ -394,7 +394,7 @@ class NewHeader extends Component {
<li><a href="javascript:void(0)">用户</a></li>
</ul>
</div>
<input type="text" className="search-input fl" id="search-input" name="search_keyword" placeholder="搜索实训项目"/>
<input type="text" className="search-input fl" id="search-input" name="search_keyword" placeholder="实践课程/翻转课堂/开发社区/交流问答"/>
<a href="javascript:void(0)" className="search-icon fl" id="header_keyword_search">
{/*<i className="fa fa-search font-16 mt23 color-grey-6"></i>*/}
<i className="iconfont icon-sousuo color-blue"></i>

@ -12,7 +12,7 @@ body>.-task-title {
}
/*<2A><><EFBFBD><EFBFBD><EFBFBD>Ŵ󾵵<C5B4><F3BEB5B5><EFBFBD><EFBFBD><EFBFBD>·Ŵ󾵵<C5B4>λ<EFBFBD><CEBB>*/
#root .search-all {
width: 219px;
/*width: 219px;*/
}
/*Header START*/

@ -36,16 +36,16 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
.yellowBar{position: absolute;top: 0px;height: 8px;border-radius: 4px;left: 0px;background-color: #FFA800;display: block}
.ratePanelContent-left span{display: block;text-align: center}
/*----------------------------------首页查询输入框*/
.search-all{width: 216px;margin: 0px auto;position: relative;background-color: #24292D;}
.search-all{width: 296px;margin: 0px auto;position: relative;background-color: #24292D;}
.seperateLine { border-left: 1px solid #EAEAEA;float: left;height: 16px;margin-top: 22px; visibility: hidden;}
.search-all .search-input{ width: 181px; outline: none;border: none;height: 30px;margin-top: 15px;border-bottom: 1px solid #eee;background: none;padding-left: 10px;box-sizing: border-box;color: #fff}
.search-all .search-input{ width: 260px; outline: none;border: none;height: 30px;margin-top: 15px;border-bottom: 1px solid #eee;background: none;padding-left: 10px;box-sizing: border-box;color: #fff}
.search-all .search-clear{font-size: 14px;display: inline-block;width: 50px;text-align: center;color: #656565;line-height: 60px;cursor: pointer}
.search-icon{color: #656565;display: block;display: inline-block;height: 60px;width: 30px;cursor: pointer;}
.search-icon path{ fill: #4CACFF;}
/* 右侧内容宽度变化的话需要调整posi-search right的值*/
.posi-search{opacity: 1;position: absolute;top: -2px;background: #fff;z-index: 2; right: -241px;}
.posi-search.unlogin{right: -191px;}
.posi-search{opacity: 1;position: absolute;top: -2px;background: #fff;z-index: 2; right: -200px;}
.posi-search.unlogin{right: -161px;}
.search-content{box-sizing: border-box;position: absolute;height: 300px;background: #fff;border-radius: 0px 0px 5px 5px;width: 100%;left: 0px;top:58px;box-shadow: 0 4px 8px 0 rgba(0,0,0,.2);overflow-y: auto}
.search-title{height: 40px;line-height: 40px;padding-left: 20px;font-size: 12px;color: #bbb;text-align: left}
.search-content a{display: inline-block;width:100%;height: 30px;line-height: 30px;padding:0px 20px;box-sizing: border-box;text-align: left;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;}
@ -663,13 +663,16 @@ a.enterLink{cursor: pointer;color: #418CCD!important;background: none!important;
.second_code_7{min-height: 1116px;}
.second_code_8{min-height: 711px;}
/*开源创新竞赛*/
.openSource_1{min-height: 803px;}
.openSource_2{min-height: 427px;}
.openSource_3{min-height: 524px;padding-top: 190px;box-sizing: border-box;position: relative}
.openSource_4{min-height: 526px;padding-top: 190px;box-sizing: border-box;position: relative}
.openSource_5{min-height: 1061px;}
.openSource_6{min-height: 1090px;}
.openSource_7{min-height: 683px;}
.openSource_1{min-height: 659px;}
.openSource_2{min-height: 436px;}
.openSource_3{min-height: 539px;padding-top: 190px;box-sizing: border-box;position: relative}
.openSource_4{min-height: 282px;box-sizing: border-box;position: relative}
.openSource_5{min-height: 367px;}
.openSource_6{min-height: 689px;}
.openSource_7{min-height: 574px;}
.openSource_8{min-height: 632px;}
.desc_game{color: #0B8298;font-weight: 400;text-align: justify;font-size: 18px;white-space: pre-wrap;line-height:30px;}
.challenge_title{
color: #41ABEF;font-size: 30px;font-weight: bold;text-align: center;letter-spacing: 1px;line-height: 60px;margin-bottom: 20px;

Loading…
Cancel
Save