diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb index fec768a19..1bc1c9d61 100644 --- a/app/controllers/hacks_controller.rb +++ b/app/controllers/hacks_controller.rb @@ -232,6 +232,11 @@ class HacksController < ApplicationController hacks = hacks.where(category: params[:category]) end + # 语言 + if params[:language] + hacks = hacks.joins(:hack_codes).where(hack_codes: {language: params[:language]}) + end + # 排序 sort_by = params[:sort_by] || "hack_user_lastest_codes_count" sort_direction = params[:sort_direction] || "desc" diff --git a/app/models/discuss.rb b/app/models/discuss.rb index 4491a886c..54ceb46be 100644 --- a/app/models/discuss.rb +++ b/app/models/discuss.rb @@ -53,11 +53,11 @@ class Discuss < ApplicationRecord def send_tiding if dis_type == 'Shixun' - user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id + send_user_id = has_parent? ? parent.user_id : Challenge.find(challenge_id).user_id parent_container_type = 'Challenge' challenge_id = challenge_id elsif dis_type == 'Hack' - user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id + send_user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id parent_container_type = 'Hack' challenge_id = dis_id end @@ -65,6 +65,6 @@ class Discuss < ApplicationRecord trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: parent_container_type, belong_container_id: dis_id, belong_container_type: dis_type, viewed: 0, tiding_type: 'Comment' } - tidings.create!(base_attrs.merge(user_id: user_id)) + tidings.create!(base_attrs.merge(user_id: send_user_id)) end end diff --git a/public/react/src/common/quillForEditor/ImageBlot.js b/public/react/src/common/quillForEditor/ImageBlot.js index 85f176aff..d00f2bafd 100644 --- a/public/react/src/common/quillForEditor/ImageBlot.js +++ b/public/react/src/common/quillForEditor/ImageBlot.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2019-12-16 15:50:45 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-27 11:04:43 + * @LastEditTime : 2019-12-27 15:07:11 */ import Quill from "quill"; @@ -37,7 +37,7 @@ export default class ImageBlot extends BlockEmbed { node.setAttribute('width', '100%'); } - node.setAttribute('style', { cursor: 'pointer' }); + // node.setAttribute('style', { cursor: 'pointer' }); // if (node.onclick) { // console.log('image 有图片点击事件======》》》》》》'); @@ -60,7 +60,7 @@ export default class ImageBlot extends BlockEmbed { height: node.height, display: node.getAttribute('display'), id: node.id, - style: node.style + // style: node.style }; } } diff --git a/public/react/src/common/quillForEditor/index.scss b/public/react/src/common/quillForEditor/index.scss index ca3071b58..3e951e2b6 100644 --- a/public/react/src/common/quillForEditor/index.scss +++ b/public/react/src/common/quillForEditor/index.scss @@ -2,4 +2,9 @@ .ql-editing{ left: 0 !important; } + .ql-editor{ + img{ + cursor: pointer; + } + } } \ No newline at end of file diff --git a/public/react/src/modules/developer/DeveloperHome.js b/public/react/src/modules/developer/DeveloperHome.js index b45342150..ae230677a 100644 --- a/public/react/src/modules/developer/DeveloperHome.js +++ b/public/react/src/modules/developer/DeveloperHome.js @@ -9,7 +9,7 @@ import './index.scss'; import React from 'react'; -import { Table, Button, Dropdown, Icon, Menu, Card, Input, Select, Tag, Modal } from 'antd'; +import { Table, Button, Dropdown, Icon, Menu, Card, Input, Select, Tag } from 'antd'; import { connect } from 'react-redux'; import actions from '../../redux/actions'; import MultipTags from './components/multiptags'; @@ -46,9 +46,24 @@ const maps = { ], 'languageMenu': [ { - 'key': 'c', - 'name': 'C语言', - 'value': 'c' + 'key': 'C', + 'name': 'C', + 'value': 'C' + }, + { + 'key': 'C++', + 'name': 'C++', + 'value': 'C++' + }, + { + 'key': 'Python', + 'name': 'Python', + 'value': 'Python' + }, + { + 'key': 'Java', + 'name': 'Java', + 'value': 'Java' } ], 'difficultMenu': [ @@ -491,7 +506,7 @@ class DeveloperHome extends React.PureComponent {