From 36adfcf016faf599ba50eeac7e6fc5873980b55a Mon Sep 17 00:00:00 2001 From: jasder Date: Thu, 9 Sep 2021 17:34:09 +0800 Subject: [PATCH] =?UTF-8?q?FIX=20=E6=95=B4=E7=90=86=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E7=AE=A1=E7=90=86=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .merge_file_a17580 | 529 ------------------ app/views/admins/laboratories/index.html.erb | 2 +- .../shared/_laboratory_item.html.erb | 38 +- .../admins/laboratories/shared/_list.html.erb | 3 - .../admins/laboratory_settings/show.html.erb | 8 +- .../admins/reversed_keywords/index.html.erb | 4 + app/views/admins/shared/_sidebar.html.erb | 3 +- 7 files changed, 17 insertions(+), 570 deletions(-) delete mode 100644 .merge_file_a17580 diff --git a/.merge_file_a17580 b/.merge_file_a17580 deleted file mode 100644 index 47e471767..000000000 --- a/.merge_file_a17580 +++ /dev/null @@ -1,529 +0,0 @@ -import React, {Component} from 'react'; -import logo from './logo.svg'; -import './App.css'; -import {LocaleProvider} from 'antd' -import zhCN from 'antd/lib/locale-provider/zh_CN'; -import { - BrowserRouter as Router, - Route, - Switch -} from 'react-router-dom'; -import axios from 'axios'; -import '@icedesign/base/dist/ICEDesignBase.css'; - -import '@icedesign/base/index.scss'; - -import LoginDialog from './modules/login/LoginDialog'; -import Notcompletedysl from './modules/user/Notcompletedysl'; -import Trialapplicationysl from './modules/login/Trialapplicationysl'; -import Trialapplicationreview from './modules/user/Trialapplicationreview'; -import Addcourses from "./modules/courses/coursesPublic/Addcourses"; -import AccountProfile from"./modules/user/AccountProfile"; - - -import Trialapplication from './modules/login/Trialapplication' - -import NotFoundPage from './NotFoundPage' - -import Loading from './Loading' - -import Loadable from 'react-loadable'; - - -import moment from 'moment' - -import {MuiThemeProvider, createMuiTheme} from 'material-ui/styles'; - -// import './AppConfig' - -import history from './history'; - -import {SnackbarHOC} from 'educoder' -import {initAxiosInterceptors} from './AppConfig' - - -// !!!tpi需要这个来加载css -import {TPMIndexHOC} from './modules/tpm/TPMIndexHOC'; - - -const theme = createMuiTheme({ - palette: { - primary: { - main: '#4CACFF', - contrastText: 'rgba(255, 255, 255, 0.87)' - }, - secondary: {main: '#4CACFF'}, // #11cb5f This is just green.A700 as hex. - }, -}); -// -// const Trialapplication= Loadable({ -// loader: () =>import('./modules/login/Trialapplication'), -// loading:Loading, -// }) -//登入 -const EducoderLogin = Loadable({ - loader: () => import('./modules/login/EducoderLogin'), - loading: Loading, -}) -const TestIndex = Loadable({ - loader: () => import('./modules/test'), - loading: Loading, -}) - -const IndexWrapperComponent = Loadable({ - loader: () => import('./modules/page/IndexWrapper'), - loading: Loading, -}) - -const CommentComponent = Loadable({ - loader: () => import('./modules/comment/CommentContainer'), - loading: Loading, -}) - -const TestMaterialDesignComponent = Loadable({ - loader: () => import('./modules/test/md/TestMaterialDesign'), - loading: Loading, -}) -const TestCodeMirrorComponent = Loadable({ - loader: () => import('./modules/test/codemirror/TestCodeMirror'), - loading: Loading, -}) - -const TestComponent = Loadable({ - loader: () => import('./modules/test/TestRC'), - loading: Loading, -}) -const TestUrlQueryComponent = Loadable({ - loader: () => import('./modules/test/urlquery/TestUrlQuery'), - loading: Loading, -}) - -const TPMIndexComponent = Loadable({ - loader: () => import('./modules/tpm/TPMIndex'), - loading: Loading, -}) -const TPMShixunsIndexComponent = Loadable({ - loader: () => import('./modules/tpm/shixuns/ShixunsIndex'), - loading: Loading, -}) - -//实训课程(原实训路径) -const ShixunPaths = Loadable({ - loader: () => import('./modules/paths/Index'), - loading: Loading, -}) - -//在线课堂 -const CoursesIndex = Loadable({ - loader: () => import('./modules/courses/Index'), - loading: Loading, -}) -const SearchPage = Loadable({ - loader: () => import('./search/SearchPage'), - loading: Loading, -}) - -//教学案例 -const MoopCases = Loadable({ - loader: () => import('./modules/moop_cases/index'), - loading: Loading, -}) - -// 课堂讨论 -// const BoardIndex = Loadable({ -// loader: () => import('./modules/courses/boards/BoardIndex'), -// loading:Loading, -// }) - -// //课堂普通作业&分组作业 -// const CoursesWorkIndex = Loadable({ -// loader: () => import('./modules/courses/busyWork/Index'), -// loading:Loading, -// }) -// - -// const TPMShixunchildIndexComponent = Loadable({ -// loader: () => import('./modules/tpm/shixunchild/ShixunChildIndex'), -// loading: Loading, -// }) - - -// const TPMshixunfork_listIndexComponent = Loadable({ -// loader: () => import('./modules/tpm/shixunchild/Shixunfork_list'), -// loading: Loading, -// }) - - -const ForumsIndexComponent = Loadable({ - loader: () => import('./modules/forums/ForumsIndex'), - loading: Loading, -}) - -// trustie plus forum -// const TPForumsIndexComponent = Loadable({ -// loader: () => import('./modules/tp-forums/TPForumsIndex'), -// loading: Loading, -// }) - - -// const TestPageComponent = Loadable({ -// loader: () => import('./modules/page/Index'), -// loading: Loading, -// }) - - -//新建实训 -const Newshixuns = Loadable({ - loader: () => import('./modules/tpm/newshixuns/Newshixuns'), - loading: Loading, -}) - - -//实训首页 -const ShixunsHome = Loadable({ - loader: () => import('./modules/home/shixunsHome'), - loading: Loading, -}) - - -const CompatibilityPageLoadable = Loadable({ - loader: () => import('./modules/common/CompatibilityPage'), - loading: Loading, -}) - -//403页面 -const Shixunauthority = Loadable({ - loader: () => import('./modules/403/Shixunauthority'), - loading: Loading, -}) - - -//404页面 -const Shixunnopage = Loadable({ - loader: () => import('./modules/404/Shixunnopage'), - loading: Loading, -}) - -//500页面 -const http500 = Loadable({ - loader: () => import('./modules/500/http500'), - loading: Loading, -}) - -// 登录注册 -const LoginRegisterPage = Loadable({ - loader: () => import('./modules/user/LoginRegisterPage'), - loading: Loading, -}) -const AccountPage = Loadable({ - loader: () => import('./modules/user/AccountPage'), - loading: Loading, -}) - -// 个人主页 -const UsersInfo = Loadable({ - loader: () => import('./modules/user/usersInfo/Infos'), - loading: Loading, -}) - -// 兴趣页面 -const Interestpage = Loadable({ - loader: () => import('./modules/login/EducoderInteresse'), - loading: Loading, -}) - -//众包创新 -const ProjectPackages=Loadable({ - loader: () => import('./modules/projectPackages/ProjectPackageIndex'), - loading: Loading, -}) - -class App extends Component { - constructor(props) { - super(props) - // this.state = { - // isRenders:false, - // } - - } - - componentDidMount() { - // force an update if the URL changes - history.listen(() => { - this.forceUpdate() - const $ = window.$ - // https://www.trustie.net/issues/21919 可能会有问题 - $("html").animate({ scrollTop: $('html').scrollTop() - 0 }) - }); - - initAxiosInterceptors(this.props) - - // - // axios.interceptors.response.use((response) => { - // // console.log("response"+response); - // if(response!=undefined) - // // console.log("response"+response.data.statu); - // if (response&&response.data.status === 407) { - // this.setState({ - // isRenders: true, - // }) - // } - // return response; - // }, (error) => { - // //TODO 这里如果样式变了会出现css不加载的情况 - // }); - } - //修改登录方法 - Modifyloginvalue=()=>{ - this.setState({ - isRender:false, - }) - } - - render() { - - - return ( - - - - - this.Modifyloginvalue()}> - - - - - - {/*{*/} - {/* isRender === true?*/} - {/* : ""*/} - {/*}*/} - - {/*{*/} - {/* isRenders === true?*/} - {/**/} - {/*:""*/} - {/*}*/} - - - - {/**/} - - {/*众包创新*/} - - {/*认证*/} - - - {/*403*/} - - - - - {/*404*/} - - - - - - () - }> - {/**/} - - - - - - - - - - - - {/*列表页*/} - - - {/* - - - */} - - {/**/} - {/**/} - - - {/*实训课程(原实训路径)*/} - - - () - } - > - - {/*课堂*/} - - - {/* 课堂讨论 */} - {/* */} - - {/* - */} - - {/* */} - {/* 兴趣页面*/} - {/**/} - - - - - - - - - {/* 教学案例 */} - () - }/> - - {/* */} - {/*列表页*/} - {/**/} - {/*首页*/} - - - - {/**/} - - - - - - ); - } -} - -// moment国际化,设置为中文 -moment.defineLocale('zh-cn', { - months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), - weekdaysShort: '周日_周一_周二_周三_周四_周五_周六'.split('_'), - weekdaysMin: '日_一_二_三_四_五_六'.split('_'), - longDateFormat: { - LT: 'Ah点mm分', - LTS: 'Ah点m分s秒', - L: 'YYYY-MM-DD', - LL: 'YYYY年MMMD日', - LLL: 'YYYY年MMMD日Ah点mm分', - LLLL: 'YYYY年MMMD日ddddAh点mm分', - l: 'YYYY-MM-DD', - ll: 'YYYY年MMMD日', - lll: 'YYYY年MMMD日Ah点mm分', - llll: 'YYYY年MMMD日ddddAh点mm分' - }, - meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === '凌晨' || meridiem === '早上' || - meridiem === '上午') { - return hour; - } else if (meridiem === '下午' || meridiem === '晚上') { - return hour + 12; - } else { - // '中午' - return hour >= 11 ? hour : hour + 12; - } - }, - meridiem: function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return '凌晨'; - } else if (hm < 900) { - return '早上'; - } else if (hm < 1130) { - return '上午'; - } else if (hm < 1230) { - return '中午'; - } else if (hm < 1800) { - return '下午'; - } else { - return '晚上'; - } - }, - calendar: { - sameDay: function () { - return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT'; - }, - nextDay: function () { - return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT'; - }, - lastDay: function () { - return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT'; - }, - nextWeek: function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - lastWeek: function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - sameElse: 'LL' - }, - ordinalParse: /\d{1,2}(日|月|周)/, - ordinal: function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '日'; - case 'M': - return number + '月'; - case 'w': - case 'W': - return number + '周'; - default: - return number; - } - }, - relativeTime: { - future: '%s内', - past: '%s前', - s: '几秒', - m: '1分钟', - mm: '%d分钟', - h: '1小时', - hh: '%d小时', - d: '1天', - dd: '%d天', - M: '1个月', - MM: '%d个月', - y: '1年', - yy: '%d年' - }, - week: { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } -}); -export default SnackbarHOC()(App); \ No newline at end of file diff --git a/app/views/admins/laboratories/index.html.erb b/app/views/admins/laboratories/index.html.erb index 397f50cbe..8811f4ab3 100644 --- a/app/views/admins/laboratories/index.html.erb +++ b/app/views/admins/laboratories/index.html.erb @@ -4,7 +4,7 @@
<%= form_tag(admins_laboratories_path(unsafe_params), method: :get, class: 'form-inline search-form flex-1', remote: true) do %> - <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-6 col-md-4 ml-3', placeholder: '学校名称/二级域名前缀检索') %> + <%= text_field_tag(:keyword, params[:keyword], class: 'form-control col-6 col-md-4 ml-3', placeholder: '单位名称/二级域名前缀检索') %> <%= submit_tag('搜索', class: 'btn btn-primary ml-3', 'data-disable-with': '搜索中...') %> <% end %> diff --git a/app/views/admins/laboratories/shared/_laboratory_item.html.erb b/app/views/admins/laboratories/shared/_laboratory_item.html.erb index a121528e3..b4b4921ee 100644 --- a/app/views/admins/laboratories/shared/_laboratory_item.html.erb +++ b/app/views/admins/laboratories/shared/_laboratory_item.html.erb @@ -1,6 +1,6 @@ <% school = laboratory&.school %> <%= list_index_no((params[:page] || 1).to_i, index) %> -<%= school&.name || 'Trustie主站' %> +<%= school&.name || '主站' %> <% if laboratory.identifier %> <%= link_to laboratory.site, "https://#{laboratory.site}", target: '_blank' %> @@ -29,40 +29,10 @@
<%= laboratory.created_at.strftime('%Y-%m-%d %H:%M') %> - - <% if school.present? && laboratory.id != 1 %> - <%= check_box_tag :sync_course,!laboratory.sync_course,laboratory.sync_course,remote:true,data:{id:laboratory.id},class:"laboratory-sync-form" %> - <% end %> - - - <% if school.present? && laboratory.id != 1 %> - <%= check_box_tag :sync_subject,!laboratory.sync_subject,laboratory.sync_subject,remote:true,data:{id:laboratory.id},class:"laboratory-sync-form" %> - <% end %> - - - <% if school.present? && laboratory.id != 1 %> - <%= check_box_tag :sync_shixun,!laboratory.sync_shixun,laboratory.sync_shixun,remote:true,data:{id:laboratory.id},class:"laboratory-sync-form" %> - <% end %> - - <%= link_to '定制', admins_laboratory_laboratory_setting_path(laboratory), class: 'action' %> + <%= link_to '设置', admins_laboratory_laboratory_setting_path(laboratory), class: 'action' %> <% if school.present? && laboratory.id != 1 %> - <%= javascript_void_link '添加管理员', class: 'action', data: { laboratory_id: laboratory.id, toggle: 'modal', target: '.admin-add-laboratory-user-modal' } %> - <%= link_to '同步用户', synchronize_user_admins_laboratory_path(laboratory), remote: true, data: { confirm: '确认同步该单位下的所有用户到云上实验室吗?' }, class: 'action' %> -<% end %> - -
- <%= javascript_void_link('更多', class: 'action dropdown-toggle', 'data-toggle': 'dropdown', 'aria-haspopup': true, 'aria-expanded': false) %> - -
+ <%= delete_link '删除', admins_laboratory_path(laboratory, element: ".laboratory-item-#{laboratory.id}"), class: 'action' %> + <% end %> diff --git a/app/views/admins/laboratories/shared/_list.html.erb b/app/views/admins/laboratories/shared/_list.html.erb index 621ad7a41..0b6466039 100644 --- a/app/views/admins/laboratories/shared/_list.html.erb +++ b/app/views/admins/laboratories/shared/_list.html.erb @@ -7,9 +7,6 @@ 统计链接 管理员 <%= sort_tag('创建时间', name: 'id', path: admins_laboratories_path) %> - 同步课堂 - 同步实践课程 - 同步实训 操作 diff --git a/app/views/admins/laboratory_settings/show.html.erb b/app/views/admins/laboratory_settings/show.html.erb index 67536af24..735f19f0a 100644 --- a/app/views/admins/laboratory_settings/show.html.erb +++ b/app/views/admins/laboratory_settings/show.html.erb @@ -86,7 +86,9 @@ -
+ <% +=begin%> +
Banner设置
@@ -140,7 +142,9 @@
- + +<% +=end%>
diff --git a/app/views/admins/reversed_keywords/index.html.erb b/app/views/admins/reversed_keywords/index.html.erb index 3907b32fc..a5218c9c9 100644 --- a/app/views/admins/reversed_keywords/index.html.erb +++ b/app/views/admins/reversed_keywords/index.html.erb @@ -11,6 +11,10 @@ <%= link_to "新增", new_admins_reversed_keyword_path, remote: true, class: "btn btn-primary pull-right", "data-disabled-with":"...新增" %>
+
+ 旨在为特殊用户群体、特殊场景、路由而保留的关键词,如:Gitlink、Trustie等;目前主要在用户注册、创建组织、创建项目等场景下做关键词的验证. +
+
<%= render partial: 'admins/reversed_keywords/list', locals: { keywords: @keywords } %>
diff --git a/app/views/admins/shared/_sidebar.html.erb b/app/views/admins/shared/_sidebar.html.erb index cffcf6583..b4959c3ff 100644 --- a/app/views/admins/shared/_sidebar.html.erb +++ b/app/views/admins/shared/_sidebar.html.erb @@ -26,10 +26,11 @@
  • <%= sidebar_item(admins_project_categories_path, '分类列表', icon: 'sitemap', controller: 'admins-project_categories') %>
  • <%= sidebar_item(admins_project_licenses_path, '开源许可证', icon: 'file-text-o', controller: 'admins-project_licenses') %>
  • <%= sidebar_item(admins_project_ignores_path, '忽略文件', icon: 'git', controller: 'admins-project_ignores') %>
  • -
  • <%= sidebar_item(admins_reversed_keywords_path, '系统保留关键词', icon: 'key', controller: 'admins-reversed_keywords') %>
  • <% end %> +
  • <%= sidebar_item(admins_reversed_keywords_path, '系统保留关键词', icon: 'key', controller: 'admins-reversed_keywords') %>
  • +
  • <%= sidebar_item(admins_laboratories_path, '云上实验室', icon: 'cloud', controller: 'admins-laboratories') %>