From 8040dd819eeb57bdff394e9c6250241705476aee Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 15 Jul 2019 10:47:47 +0800 Subject: [PATCH 01/19] test pull --- test.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.rb diff --git a/test.rb b/test.rb new file mode 100644 index 00000000..e69de29b From c69ee9562592381edb771f7500c4b60301c4c267 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 15 Jul 2019 10:49:06 +0800 Subject: [PATCH 02/19] test pull --- test.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.yml diff --git a/test.yml b/test.yml new file mode 100644 index 00000000..e69de29b From 5a56db748ffa704dc3911edbb1443dee82b25f79 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 15 Jul 2019 10:49:19 +0800 Subject: [PATCH 03/19] test pull --- test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/test.yml b/test.yml index e69de29b..6f0166af 100644 --- a/test.yml +++ b/test.yml @@ -0,0 +1 @@ +12312312312 \ No newline at end of file From 2d8b435bf8ae9f27d40075816673b85db27e1837 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 15 Jul 2019 10:51:17 +0800 Subject: [PATCH 04/19] test pull --- config/test.rb | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 config/test.rb diff --git a/config/test.rb b/config/test.rb new file mode 100644 index 00000000..e69de29b From 42dc22e0872f6954070598e5be1a48cb54dc1dac Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 15 Jul 2019 10:51:33 +0800 Subject: [PATCH 05/19] tes push --- config/test.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 config/test.yml diff --git a/config/test.yml b/config/test.yml new file mode 100644 index 00000000..e69de29b From 972957f55e689241c3d567098d7be30ce3da1649 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 15 Jul 2019 10:55:09 +0800 Subject: [PATCH 06/19] remove test pull code --- config/test.rb | 0 config/test.yml | 0 test.rb | 0 test.yml | 1 - 4 files changed, 1 deletion(-) delete mode 100644 config/test.rb delete mode 100644 config/test.yml delete mode 100644 test.rb delete mode 100644 test.yml diff --git a/config/test.rb b/config/test.rb deleted file mode 100644 index e69de29b..00000000 diff --git a/config/test.yml b/config/test.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/test.rb b/test.rb deleted file mode 100644 index e69de29b..00000000 diff --git a/test.yml b/test.yml deleted file mode 100644 index 6f0166af..00000000 --- a/test.yml +++ /dev/null @@ -1 +0,0 @@ -12312312312 \ No newline at end of file From 609acda8858051790b80804ee8666c9ca810b107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 15 Jul 2019 11:15:49 +0800 Subject: [PATCH 07/19] b --- .../PackageIndex/PackageConcent.js | 6 +++--- .../PackageIndexNEITaskDetails.js | 14 +++++++------- .../PackageIndexNEITaskDetails/pds.css | 7 +++++++ .../modules/projectPackages/packageconcnet.css | 15 ++++++++++++--- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js index 699d8c9c..2abbf3a4 100644 --- a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js @@ -136,7 +136,7 @@ class PackageConcent extends Component { let {data,page,category,sort_by,sort_direction,project_packages}=this.state; return ( -
+
@@ -163,7 +163,7 @@ class PackageConcent extends Component {
-
+

类型: @@ -208,7 +208,7 @@ class PackageConcent extends Component { {project_packages&&project_packages.map((item,key)=>{ return( -

+
diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js index 83367498..0fe51311 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js @@ -289,8 +289,8 @@ class PackageIndexNEITaskDetails extends Component { onMouseOver={this.setover} onMouseOut={this.setout} > - {overtype===false? 头像联系TA: - 头像 头像联系TA: + 头像联系TA}
}
@@ -344,7 +344,7 @@ class PackageIndexNEITaskDetails extends Component {
{/*详情*/} -
+
需求详情: @@ -380,7 +380,7 @@ class PackageIndexNEITaskDetails extends Component { {/*发布者和竞选者状态show*/} {this.state.setbiddingmantype===false&&data&&data.published_at!=null?
{/*下面是头像*/} -
+
报名列表({data&&data.bidding_users.length}) @@ -392,7 +392,7 @@ class PackageIndexNEITaskDetails extends Component {
-
+
@@ -403,7 +403,7 @@ class PackageIndexNEITaskDetails extends Component { {item.status==="bidding_won"?:""}

{item.name}

- {this.props.current_user.login!=item.login? + {this.props.current_user.login!=item.login? 头像联系TA :""}
@@ -441,7 +441,7 @@ class PackageIndexNEITaskDetails extends Component {
-
+
diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/pds.css b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/pds.css index 7d699763..a6f9e10d 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/pds.css +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/pds.css @@ -5,13 +5,20 @@ flex-direction: row; margin-bottom: 20px; } + .ysllogin_register_contents{ display: flex; margin-top: 20px; /*justify-content: center;*/ background: #fff; +} +.ysllogin_register_contentss{ + margin-top:0px !important; + padding-top: 10px; + padding-bottom: 10px; } + .ysldivhomediv1{ width: 80px; height: 130px; diff --git a/public/react/src/modules/projectPackages/packageconcnet.css b/public/react/src/modules/projectPackages/packageconcnet.css index 0a690822..45ea361d 100644 --- a/public/react/src/modules/projectPackages/packageconcnet.css +++ b/public/react/src/modules/projectPackages/packageconcnet.css @@ -97,8 +97,8 @@ line-height: 28px; } -.pd30a0{ - padding: 30px 30px 16px 30px; +.pd26a0{ + padding: 26px 26px 16px 26px; } .newFormbox .attachment .icon-fujian{ @@ -226,7 +226,7 @@ width: 80px; height: 26px; font-size: 14px; - line-height: 26px; + line-height: 24px; /*display: block;*/ border: 1px solid #fff !important; background-color: #4CACFF; @@ -319,4 +319,13 @@ white-space: nowrap; max-width: 850px; display: table-cell; +} + +.mtf10{ + margin-top:-10px; +} + +.padding26{ + padding: 26px; + box-sizing: border-box; } \ No newline at end of file From 3953b52a091cea891d9ac8e1b487a5377da6b590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 15 Jul 2019 15:30:28 +0800 Subject: [PATCH 08/19] =?UTF-8?q?=E4=BC=97=E5=8C=85=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/competitions/index.html.erb | 3 ++- public/react/src/index.js | 4 ++-- .../PackageIndexNEITaskDetails.js | 10 +++++----- .../projectPackages/packageconcnet.css | 6 +++++- public/stylesheets/educoder/edu-all.css | 1 + public/stylesheets/educoder/edu-main.css | 19 +++++++++++++++++++ 6 files changed, 34 insertions(+), 9 deletions(-) diff --git a/app/views/competitions/index.html.erb b/app/views/competitions/index.html.erb index c8743251..0ff957e3 100644 --- a/app/views/competitions/index.html.erb +++ b/app/views/competitions/index.html.erb @@ -4,7 +4,8 @@ <% @competitions.each do |competition| %> <% if competition.status? %>
-
+
+
报名中
<%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %> diff --git a/public/react/src/index.js b/public/react/src/index.js index b691e1d5..739ceebe 100644 --- a/public/react/src/index.js +++ b/public/react/src/index.js @@ -38,8 +38,8 @@ window.__useKindEditor = false; // TODO 读取到package.json中的配置? var proxy = "http://localhost:3000" -// proxy = "http://testbdweb.trustie.net" -// proxy = "http://testbdweb.educoder.net" +// proxy = "http://testbdweb.trustie.net" + proxy = "http://testbdweb.educoder.net" // proxy ="http://192.168.2.63:3000" // proxy='https://www.educoder.net' const requestMap={}; diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js index 0fe51311..ebd532c9 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js @@ -362,7 +362,7 @@ class PackageIndexNEITaskDetails extends Component {
{data&&data.attachments.length>0?
-
+
需求文件:
{data&&data.attachments.map((item,key)=>{ @@ -380,9 +380,9 @@ class PackageIndexNEITaskDetails extends Component { {/*发布者和竞选者状态show*/} {this.state.setbiddingmantype===false&&data&&data.published_at!=null?
{/*下面是头像*/} -
+
-
+
报名列表({data&&data.bidding_users.length})
@@ -426,9 +426,9 @@ class PackageIndexNEITaskDetails extends Component { {this.state.setbiddingmantype===true?
{/*发布人选择状态*/} {/*下面是头像*/} -
+
-
+
报名列表({data&&data.bidding_users.length})
diff --git a/public/react/src/modules/projectPackages/packageconcnet.css b/public/react/src/modules/projectPackages/packageconcnet.css index 45ea361d..e49e5c9c 100644 --- a/public/react/src/modules/projectPackages/packageconcnet.css +++ b/public/react/src/modules/projectPackages/packageconcnet.css @@ -275,7 +275,7 @@ .packageabsolute{ position: absolute; right: -16px; - top: -11px; + top: -7px; } .relativef{ position: relative; @@ -328,4 +328,8 @@ .padding26{ padding: 26px; box-sizing: border-box; +} + +.pd26{ + padding: 26px; } \ No newline at end of file diff --git a/public/stylesheets/educoder/edu-all.css b/public/stylesheets/educoder/edu-all.css index 4354798b..2822c384 100644 --- a/public/stylesheets/educoder/edu-all.css +++ b/public/stylesheets/educoder/edu-all.css @@ -3514,4 +3514,5 @@ line-height: 16px;display: inline-block;color: rgba(65, 140, 205, 1) !important; .vertical4{ vertical-align: -4px; + margin-right: 0px !important; } \ No newline at end of file diff --git a/public/stylesheets/educoder/edu-main.css b/public/stylesheets/educoder/edu-main.css index 27873001..5b9f41fa 100644 --- a/public/stylesheets/educoder/edu-main.css +++ b/public/stylesheets/educoder/edu-main.css @@ -1114,4 +1114,23 @@ html>body #ajax-indicator { position: fixed; } .list-count span { color: coral; 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; } \ No newline at end of file From 3532564c6898af2d5508f739b6093914668607f6 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 15 Jul 2019 15:56:00 +0800 Subject: [PATCH 09/19] modify competition path --- app/controllers/competitions_controller.rb | 10 +++++++++- app/helpers/application_helper.rb | 4 +++- app/helpers/libraries_helper.rb | 2 +- app/views/competitions/index.html.erb | 4 +++- config/routes.rb | 2 +- 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/controllers/competitions_controller.rb b/app/controllers/competitions_controller.rb index a868cbf0..c0862dc2 100644 --- a/app/controllers/competitions_controller.rb +++ b/app/controllers/competitions_controller.rb @@ -25,7 +25,15 @@ class CompetitionsController < ApplicationController end 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 'end' then + competitions = competitions.where('end_time < NOW()') + end + @competitions = competitions.reorder("published_at desc, online_time desc") respond_to do |format| format.html { render :layout => "base_edu"} format.js diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 345dfadc..39298061 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2996,6 +2996,8 @@ module ApplicationHelper else title << "教学案例" end + elsif params[:controller] == "project_packages" + title << "众包社区" elsif @course title << (@course.name.nil? ? "课堂" : @course.name) 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) when 'ProjectPackage' 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 'javascript:void(0)' end diff --git a/app/helpers/libraries_helper.rb b/app/helpers/libraries_helper.rb index 4d6956b7..e2e74324 100644 --- a/app/helpers/libraries_helper.rb +++ b/app/helpers/libraries_helper.rb @@ -2,7 +2,7 @@ module LibrariesHelper def show_library_tags(library) html = '' 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 raw html diff --git a/app/views/competitions/index.html.erb b/app/views/competitions/index.html.erb index 0ff957e3..29df9cd1 100644 --- a/app/views/competitions/index.html.erb +++ b/app/views/competitions/index.html.erb @@ -5,7 +5,9 @@ <% if competition.status? %>
-
报名中
+ <% if competition.enroll_end_time.present? && competition.enroll_end_time > Time.now %> +
报名中
+ <% end %> <%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %> diff --git a/config/routes.rb b/config/routes.rb index a05298c6..a92555c1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -57,7 +57,7 @@ RedmineApp::Application.routes.draw do ## oauth相关 get :publish_success, on: :collection 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 end From 96b758d7d7c8320148048d6cdcf6d802df7fd6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 15 Jul 2019 16:10:35 +0800 Subject: [PATCH 10/19] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E5=AF=BC=E8=88=AA?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/competitions/index.html.erb | 7 +++++++ public/react/src/index.js | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/competitions/index.html.erb b/app/views/competitions/index.html.erb index 0ff957e3..dd2ef7fc 100644 --- a/app/views/competitions/index.html.erb +++ b/app/views/competitions/index.html.erb @@ -1,4 +1,11 @@
+ + + <% if @competitions.count > 0 %>
<% @competitions.each do |competition| %> diff --git a/public/react/src/index.js b/public/react/src/index.js index 739ceebe..36fbf15c 100644 --- a/public/react/src/index.js +++ b/public/react/src/index.js @@ -36,10 +36,10 @@ window.__useKindEditor = false; // TODO 避免重复的请求 https://github.com/axios/axios#cancellation // https://github.com/axios/axios/issues/1497 -// TODO 读取到package.json中的配置? +// TODO 读取到package.json中的配置? var proxy = "http://localhost:3000" // proxy = "http://testbdweb.trustie.net" - proxy = "http://testbdweb.educoder.net" +// proxy = "http://testbdweb.educoder.net" // proxy ="http://192.168.2.63:3000" // proxy='https://www.educoder.net' const requestMap={}; From 0da53b9b6af976e656fe0aa4472d1d69ac73ef01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 15 Jul 2019 16:23:04 +0800 Subject: [PATCH 11/19] =?UTF-8?q?=E4=BC=97=E5=8C=85=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 2 +- .../projectPackages/PackageIndex/PackageConcent.js | 1 + .../projectPackages/PackageIndex/PackageIndex.js | 2 +- .../PackageIndexNEITaskDetails.js | 1 + .../PackageIndexNEIBannerConcent.js | 2 +- .../PackageIndexNewandEdit/PackageIndexNEISubmit.js | 3 +-- .../PackageIndexNewandEditIndex.js | 3 ++- .../modules/projectPackages/ProjectPackageIndex.js | 12 ++++++++---- 8 files changed, 16 insertions(+), 10 deletions(-) diff --git a/public/react/src/App.js b/public/react/src/App.js index 4e643cd8..0b4e34f0 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -225,7 +225,7 @@ class App extends Component { */} {/*众包*/} - + diff --git a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js index 2abbf3a4..1764de1f 100644 --- a/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndex/PackageConcent.js @@ -51,6 +51,7 @@ class PackageConcent extends Component { //否 string 排序,默认最新, ‘recently’, ‘price’ // 否 string 类型, front,backend,mobile,database, cloud_compute_and_big_data,devops_and_test,ai,other componentDidMount() { + window.document.title = '交流问答' let {category,keyword,sort_by,sort_direction,page}=this.state this.setdatas(category,keyword,sort_by,sort_direction,page) diff --git a/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js b/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js index 08487613..594d8765 100644 --- a/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js +++ b/public/react/src/modules/projectPackages/PackageIndex/PackageIndex.js @@ -11,7 +11,7 @@ class PackageIndex extends Component{ } componentDidMount(){ - + window.document.title = '交流问答' } render() { diff --git a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js index ebd532c9..63ae5a70 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js +++ b/public/react/src/modules/projectPackages/PackageIndexNEITaskDetails/PackageIndexNEITaskDetails.js @@ -49,6 +49,7 @@ class PackageIndexNEITaskDetails extends Component { componentDidMount() { this.getdatas() + window.document.title = '交流问答' } getdatas=()=>{ diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js index 17adfbac..0f5b62f6 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js @@ -75,7 +75,7 @@ class PackageIndexNEIBannerConcent extends Component { } componentDidMount() { - + window.document.title = '交流问答' if(this.props.match.params.id!=undefined){ let url=`/api/v1/project_packages/${this.props.match.params.id}.json` diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js index dc702068..5cd36e7b 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEISubmit.js @@ -10,8 +10,7 @@ class PackageIndexNEISubmit extends Component { } } componentDidMount() { - - + window.document.title = '交流问答' } setageload=(sum)=>{ if(sum===undefined){ diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js index 1059bc34..daab53e4 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNewandEditIndex.js @@ -18,8 +18,9 @@ class PackageIndexNewandEditIndex extends Component{ } componentDidMount(){ - + window.document.title = '交流问答' } + setPublicationfun=(ids)=>{ this.setState({ setPublication:true, diff --git a/public/react/src/modules/projectPackages/ProjectPackageIndex.js b/public/react/src/modules/projectPackages/ProjectPackageIndex.js index 73dd1719..f309664f 100644 --- a/public/react/src/modules/projectPackages/ProjectPackageIndex.js +++ b/public/react/src/modules/projectPackages/ProjectPackageIndex.js @@ -31,6 +31,10 @@ class ProjectPackageIndex extends Component { super(props) } + componentDidMount(){ + window.document.title = '交流问答' + } + render() { return ( @@ -39,25 +43,25 @@ class ProjectPackageIndex extends Component { {/*众包首页*/} - () } > - () } > - () } > - () } From f62f35a7062ac4a09bcdadb9ade160bedd667287 Mon Sep 17 00:00:00 2001 From: p31729568 Date: Mon, 15 Jul 2019 16:26:24 +0800 Subject: [PATCH 12/19] competition list add category filter --- app/controllers/competitions_controller.rb | 2 +- .../competitions/_competition_list.html.erb | 100 +++++++++++++++ app/views/competitions/index.html.erb | 114 ++---------------- app/views/competitions/index.js.erb | 1 + 4 files changed, 113 insertions(+), 104 deletions(-) create mode 100644 app/views/competitions/_competition_list.html.erb create mode 100644 app/views/competitions/index.js.erb diff --git a/app/controllers/competitions_controller.rb b/app/controllers/competitions_controller.rb index c0862dc2..86ea9e08 100644 --- a/app/controllers/competitions_controller.rb +++ b/app/controllers/competitions_controller.rb @@ -30,7 +30,7 @@ class CompetitionsController < ApplicationController case params[:category] when 'progressing' then competitions = competitions.where('end_time > NOW()') - when 'end' then + when 'ended' then competitions = competitions.where('end_time < NOW()') end @competitions = competitions.reorder("published_at desc, online_time desc") diff --git a/app/views/competitions/_competition_list.html.erb b/app/views/competitions/_competition_list.html.erb new file mode 100644 index 00000000..13e8d3c8 --- /dev/null +++ b/app/views/competitions/_competition_list.html.erb @@ -0,0 +1,100 @@ +<% if @competitions.count > 0 %> +
+ <% @competitions.each do |competition| %> + <% if competition.status? %> +
+
+ <% if competition.enroll_end_time.present? && competition.enroll_end_time > Time.now %> +
报名中
+ <% end %> + + <%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %> + +
+ <%= [competition.name, competition.sub_title.presence].compact.join('——') %> + <% if competition.start_time > Time.now %> + <% unless competition.enroll_end_time.present? && competition.enroll_end_time < Time.now %> +
+ + 报名中 +
+ <% else %> +
+ + 即将开始 +
+ <% end %> + <% elsif competition.end_time < Time.now %> +
+ + 已结束 +
+ <% else %> + <% max_min_stage = max_min_stage_time competition %> + <% if max_min_stage.count == 1 %> +
+ + 距离结束还剩<%= how_much_day competition.end_time %> +
+ <% else %> + <% max_min_stage.each do |stage| %> + <% if stage.min_start_time > Time.now %> +
+ + <%= stage.competition_stage.name %>即将开始 +
+ <% break %> + <% elsif stage.max_end_time > Time.now %> +
+ + <%= stage.competition_stage.name %>正在进行 +
+ <% break %> + <% end %> + <% end %> + <% end %> + <% end %> +
+

+ <%= format_date competition.start_time %> ~ <%= com_end_date competition.end_time %> + + <%= competition.visits %> + <% if competition.member_count > 0 %> + + + <%= competition.identifier == "hn" ? 1125 : competition.member_count %> + + + <% end %> + +

+
+
+ <% elsif competition.published_at.present? %> + <% url = admin_or_business? ? competition_path(competition) : 'javascript:void(0)' %> + + <% end %> + <% end %> +
+<% else %> + <%= render :partial => "welcome/no_data" %> +<% end %> \ No newline at end of file diff --git a/app/views/competitions/index.html.erb b/app/views/competitions/index.html.erb index 06f0bef6..36743613 100644 --- a/app/views/competitions/index.html.erb +++ b/app/views/competitions/index.html.erb @@ -1,111 +1,19 @@
- 全部 - 进行中 - 往期比赛 + <%= link_to '全部', competitions_path(category: ''), remote: true, + class: "fl mr20 font-16 bestChoose shixun_repertoire #{params[:category].blank? ? 'active' : ''}" %> + <%= link_to '进行中', competitions_path(category: 'progressing'), remote: true, + class: "fl mr20 font-16 bestChoose shixun_repertoire #{params[:category] == 'progressing' ? 'active' : ''}" %> + <%= link_to '往期比赛', competitions_path(category: 'ended'), remote: true, + class: "fl mr20 font-16 bestChoose shixun_repertoire #{params[:category] == 'ended' ? 'active' : ''}" %>
- <% if @competitions.count > 0 %> -
- <% @competitions.each do |competition| %> - <% if competition.status? %> -
-
- <% if competition.enroll_end_time.present? && competition.enroll_end_time > Time.now %> -
报名中
- <% end %> - - <%= image_tag(url_to_avatar(competition), :width => "100%", :height => "100%") %> - -
- <%= [competition.name, competition.sub_title.presence].compact.join('——') %> - <% if competition.start_time > Time.now %> - <% unless competition.enroll_end_time.present? && competition.enroll_end_time < Time.now %> -
- - 报名中 -
- <% else %> -
- - 即将开始 -
- <% end %> - <% elsif competition.end_time < Time.now %> -
- - 已结束 -
- <% else %> - <% max_min_stage = max_min_stage_time competition %> - <% if max_min_stage.count == 1 %> -
- - 距离结束还剩<%= how_much_day competition.end_time %> -
- <% else %> - <% max_min_stage.each do |stage| %> - <% if stage.min_start_time > Time.now %> -
- - <%= stage.competition_stage.name %>即将开始 -
- <% break %> - <% elsif stage.max_end_time > Time.now %> -
- - <%= stage.competition_stage.name %>正在进行 -
- <% break %> - <% end %> - <% end %> - <% end %> - <% end %> -
-

- <%= format_date competition.start_time %> ~ <%= com_end_date competition.end_time %> - - <%= competition.visits %> - <% if competition.member_count > 0 %> - - - <%= competition.identifier == "hn" ? 1125 : competition.member_count %> - - - <% end %> - -

-
-
- <% elsif competition.published_at.present? %> - <% url = admin_or_business? ? competition_path(competition) : 'javascript:void(0)' %> - - <% end %> - <% end %> -
- <% else %> - <%= render :partial => "welcome/no_data" %> - <% end %> +
+ <%= render 'competitions/competition_list' %> +
+ +