Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

dev_home
杨树明 5 years ago
commit 7353f9dbcf

@ -19,6 +19,13 @@ class Admins::LaboratoryShixunsController < Admins::BaseController
render_ok render_ok
end end
def destroy
return render_js_error('不能删除自建实训', type: :notify) if current_laboratory_shixun.ownership?
current_laboratory_shixun.destroy!
render_delete_success
end
def homepage def homepage
current_laboratory_shixun.update!(homepage: true) current_laboratory_shixun.update!(homepage: true)
render_ok render_ok

@ -21,6 +21,15 @@ class Admins::LaboratorySubjectsController < Admins::BaseController
render_ok render_ok
end end
def destroy
return render_js_error('不能删除自建课程', type: :notify) if current_laboratory_subject.ownership?
current_laboratory_subject.destroy!
render_delete_success
end
def homepage def homepage
current_laboratory_subject.update!(homepage: true) current_laboratory_subject.update!(homepage: true)
render_ok render_ok

@ -16,7 +16,7 @@ class Cooperative::BaseController < ApplicationController
private private
def current_laboratory def current_laboratory
@_current_laboratory ||= Laboratory.find_by_subdomain(request.subdomain) @_current_laboratory ||= Laboratory.find_by_subdomain('hut' || request.subdomain)
end end
def current_setting_or_default(name) def current_setting_or_default(name)

@ -15,6 +15,13 @@ class Cooperative::LaboratoryShixunsController < Cooperative::BaseController
end end
def destroy
return render_js_error('不能删除自建实训', type: :notify) if current_laboratory_shixun.ownership?
current_laboratory_shixun.destroy!
render_delete_success
end
def homepage def homepage
current_laboratory_shixun.update!(homepage: true) current_laboratory_shixun.update!(homepage: true)
render_ok render_ok

@ -18,6 +18,13 @@ class Cooperative::LaboratorySubjectsController < Cooperative::BaseController
current_laboratory_subject.subject.update!(update_params) current_laboratory_subject.subject.update!(update_params)
end end
def destroy
return render_js_error('不能删除自建实践课程', type: :notify) if current_laboratory_subject.ownership?
current_laboratory_subject.destroy!
render_delete_success
end
def homepage def homepage
current_laboratory_subject.update!(homepage: true) current_laboratory_subject.update!(homepage: true)
render_ok render_ok

@ -25,4 +25,8 @@
<%= link_to('去修改', admins_shixun_settings_path(id: laboratory_shixun.shixun_id)) %> <%= link_to('去修改', admins_shixun_settings_path(id: laboratory_shixun.shixun_id)) %>
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? 'display:none' : '') %> <%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? '' : 'display:none') %> <%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? '' : 'display:none') %>
<% unless laboratory_shixun.ownership? %>
<%= delete_link '删除', admins_laboratory_laboratory_shixun_path(current_laboratory, laboratory_shixun, element: ".laboratory-shixun-item-#{laboratory_shixun.id}") %>
<% end %>
</td> </td>

@ -36,6 +36,10 @@
<%= link_to('去修改', admins_subjects_path(id: laboratory_subject.subject_id)) %> <%= link_to('去修改', admins_subjects_path(id: laboratory_subject.subject_id)) %>
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? 'display:none' : '') %> <%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? '' : 'display:none') %> <%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? '' : 'display:none') %>
<% unless laboratory_subject.ownership? %>
<%= delete_link '删除', admins_laboratory_laboratory_subject_path(current_laboratory, laboratory_subject, element: ".laboratory-subject-item-#{laboratory_subject.id}") %>
<% end %>
</td> </td>
</tr> </tr>
<% end %> <% end %>

@ -29,4 +29,8 @@
<% end %> <% end %>
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? 'display:none' : '') %> <%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? '' : 'display:none') %> <%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_shixun.id }, style: laboratory_shixun.homepage? ? '' : 'display:none') %>
<% unless laboratory_shixun.ownership? %>
<%= delete_link '删除', cooperative_laboratory_shixun_path(laboratory_shixun, element: ".laboratory-shixun-item-#{laboratory_shixun.id}") %>
<% end %>
</td> </td>

@ -25,4 +25,8 @@
<%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? 'display:none' : '') %> <%= javascript_void_link('首页展示', class: 'action homepage-show-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? 'display:none' : '') %>
<%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? '' : 'display:none') %> <%= javascript_void_link('取消首页展示', class: 'action homepage-hide-action', data: { id: laboratory_subject.id }, style: laboratory_subject.homepage? ? '' : 'display:none') %>
<% unless laboratory_subject.ownership? %>
<%= delete_link '删除', cooperative_laboratory_subject_path(laboratory_subject, element: ".laboratory-subject-item-#{laboratory_subject.id}") %>
<% end %>
</td> </td>

@ -3,11 +3,11 @@ json.images_url @images_url
json.reps @rep_list json.reps @rep_list
json.shixuns do json.shixuns do
json.partial! 'shixuns/shixun', locals: {shixuns: @shixuns.present? ? @shixuns : @main_shixuns} json.partial! 'shixuns/shixun', locals: {shixuns: @shixuns}
end end
json.subjects do json.subjects do
json.partial! 'subjects/subject', locals: {subjects: @subjects.present? ? @subjects : @main_subjects} json.partial! 'subjects/subject', locals: {subjects: @subjects}
end end
if current_laboratory.main_site? if current_laboratory.main_site?

@ -13,6 +13,7 @@ json.phone @user.phone
json.email @user.mail json.email @user.mail
json.profile_completed @user.profile_completed? json.profile_completed @user.profile_completed?
json.professional_certification @user.professional_certification json.professional_certification @user.professional_certification
json.main_site current_laboratory.main_site?
if @course if @course
json.course_identity @course_identity json.course_identity @course_identity
json.course_name @course.name json.course_name @course.name

@ -1049,13 +1049,13 @@ Rails.application.routes.draw do
post :drag, on: :collection post :drag, on: :collection
end end
resources :laboratory_shixuns, only: [:index, :create] do resources :laboratory_shixuns, only: [:index, :create, :destroy] do
member do member do
post :homepage post :homepage
post :cancel_homepage post :cancel_homepage
end end
end end
resources :laboratory_subjects, only: [:index, :create] do resources :laboratory_subjects, only: [:index, :create, :destroy] do
member do member do
post :homepage post :homepage
post :cancel_homepage post :cancel_homepage
@ -1132,13 +1132,13 @@ Rails.application.routes.draw do
resources :carousels, only: [:index, :create, :update, :destroy] do resources :carousels, only: [:index, :create, :update, :destroy] do
post :drag, on: :collection post :drag, on: :collection
end end
resources :laboratory_shixuns, only: [:index, :edit, :update] do resources :laboratory_shixuns, only: [:index, :edit, :update, :destroy] do
member do member do
post :homepage post :homepage
post :cancel_homepage post :cancel_homepage
end end
end end
resources :laboratory_subjects, only: [:index, :edit, :update] do resources :laboratory_subjects, only: [:index, :edit, :update, :destroy] do
member do member do
post :homepage post :homepage
post :cancel_homepage post :cancel_homepage

@ -6,7 +6,8 @@ class MigrateGccProjectTeam < ActiveRecord::Migration[5.2]
all_login = [['mu2pwryse', 'pljq3f9xp', 'pfx7gfmiz'], ['p9rs7xtfl', 'prx72s8uc', 'plezci23p', 'pjysrikw7'], ['m40352189', 'p05394287'], all_login = [['mu2pwryse', 'pljq3f9xp', 'pfx7gfmiz'], ['p9rs7xtfl', 'prx72s8uc', 'plezci23p', 'pjysrikw7'], ['m40352189', 'p05394287'],
['m9ozhx83t', 'p05296348'], ['p35490268', 'p48921607', 'p24019738'], ['p29165708', 'm43960821']] ['m9ozhx83t', 'p05296348'], ['p35490268', 'p48921607', 'p24019738'], ['p29165708', 'm43960821']]
all_login.each do |user_login| all_login.each do |user_login|
leader = User.find_by!(login: user_login.first) leader = User.find_by(login: user_login.first)
next if leader.blank?
team = CompetitionTeam.create!(name: "#{leader.real_name}", user_id: leader.id, competition_id: 8) team = CompetitionTeam.create!(name: "#{leader.real_name}", user_id: leader.id, competition_id: 8)
team.generate_invite_code team.generate_invite_code
team.save! team.save!

@ -45,6 +45,7 @@ class ModulationModal_exercise extends Component {
} }
Saves = () => { Saves = () => {
debugger
let { let {
textareaval, textareaval,
subjective_questions, subjective_questions,
@ -123,7 +124,7 @@ class ModulationModal_exercise extends Component {
Inputsvaltests: "请输入0-100的分数", Inputsvaltests: "请输入0-100的分数",
}) })
return; return;
} else if (parseFloat(Inputsval) > this.props.objective_score) { } else if (parseFloat(Inputsvals) > this.props.objective_score) {
this.setState({ this.setState({
Inputsvals: Inputsvals, Inputsvals: Inputsvals,
Inputsvaltypes: true, Inputsvaltypes: true,
@ -312,7 +313,9 @@ class ModulationModal_exercise extends Component {
"" ""
} }
<div className="mexertwo"> <div className="mexertwo" style={{
marginTop: "20px",
}}>
<p className="mexeheigth2">主观题成绩:</p> <p className="mexeheigth2">主观题成绩:</p>
<Input <Input
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"} className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}

@ -428,7 +428,7 @@ class Studentshavecompletedthelist extends Component {
textAlign: "center", textAlign: "center",
width:'255px', width:'255px',
}}>--</span>: }}>--</span>:
<a className="maxnamewidth255" tyle={{ <a className="maxnamewidth255" style={{
color: '#07111B', color: '#07111B',
textAlign: "center", textAlign: "center",
width:'255px', width:'255px',
@ -661,7 +661,7 @@ class Studentshavecompletedthelist extends Component {
key: 'classroom', key: 'classroom',
dataIndex: 'classroom', dataIndex: 'classroom',
align: 'center', align: 'center',
className: "edu-txt-center font-14", className: "edu-txt-center font-14 maxnamewidth260",
width:"260px", width:"260px",
render: (text, record) => ( render: (text, record) => (
<span> <span>
@ -669,15 +669,15 @@ class Studentshavecompletedthelist extends Component {
<span style={{ <span style={{
color: '#999999', color: '#999999',
textAlign: "center" textAlign: "center"
}}>--</span> : record.classroom === "" ? }} className="maxnamewidth260">--</span> : record.classroom === "" ?
<span style={{ <span style={{
color: '#999999', color: '#999999',
textAlign: "center" textAlign: "center"
}}>--</span> : }} className="maxnamewidth260">--</span> :
<span style={{ <span style={{
color: '#07111B', color: '#07111B',
textAlign: "center" textAlign: "center"
}}>{record.classroom}</span> }} className="maxnamewidth260">{record.classroom}</span>
} }
</span> </span>
@ -904,14 +904,14 @@ class Studentshavecompletedthelist extends Component {
key: 'classroom', key: 'classroom',
dataIndex: 'classroom', dataIndex: 'classroom',
align: 'center', align: 'center',
className: "edu-txt-center font-14", className: "edu-txt-center font-14 maxnamewidth260",
width:'260px', width:'260px',
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.classroom==="--"? {record.classroom==="--"?
<span style={{color: '#999999', textAlign: "center"}}>{record.classroom}</span> <span style={{color: '#999999', textAlign: "center"}} className="maxnamewidth260">{record.classroom}</span>
: :
<span style={{color: '#07111B', textAlign: "center"}}>{record.classroom}</span> <a style={{color: '#07111B', textAlign: "center"}} className="maxnamewidth260" title={record.classroom}>{record.classroom}</a>
} }
</span> </span>
) )
@ -1100,14 +1100,14 @@ class Studentshavecompletedthelist extends Component {
key: 'classroom', key: 'classroom',
dataIndex: 'classroom', dataIndex: 'classroom',
align: 'center', align: 'center',
className: "edu-txt-center font-14", className: "edu-txt-center font-14 maxnamewidth260 ",
width:'260px', width:'260px',
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.classroom==="--"? {record.classroom==="--"?
<span style={{color: '#999999', textAlign: "center"}}>{record.classroom}</span> <span style={{color: '#999999', textAlign: "center"}} className="maxnamewidth260">{record.classroom}</span>
: :
<span style={{color: '#07111B', textAlign: "center"}}>{record.classroom}</span> <a style={{color: '#07111B', textAlign: "center"}} className="maxnamewidth260" title={record.classroom}>{record.classroom}</a>
} }
</span> </span>
) )

@ -47,3 +47,11 @@
white-space:nowrap; white-space:nowrap;
cursor: default; cursor: default;
} }
.maxnamewidth260 {
max-width: 260px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}

Loading…
Cancel
Save