homeland-jobs 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b99146f855f0645e342dc2b284820ab6ed804221
4
- data.tar.gz: badb6e58323ec98cb4796968970b38d997a7f5bc
3
+ metadata.gz: f4b17df6ecdd807228db94f72e35bff85ffb376a
4
+ data.tar.gz: 03c91dcd0b527fb43a89fa307f168ec4b41038fe
5
5
  SHA512:
6
- metadata.gz: 0d4db3e76254e9cae18269fba3b97495bdf36c24dff8489a6fb6a5585ce0cd3836c7f4e9b5d09bf48a348f934d18110fbbd344ac31902bef253a620f338aa826
7
- data.tar.gz: ec2614ec978ff0e98f74f0e2d1cecbfe0e0d2b63cffd6f501894bd8f02f516987addbdde6faf89b6760e0e461b3f0eafdd06f0416288d3d5e92e59be6631965f
6
+ metadata.gz: 9f7207e0d73ff668afaa4faae42b4ceeff16181598dd4b95fd6bfb9ab547b1f69c39f4a5e95d20a26025ec7200be57bc8e5d372ad11235dc9423dd5e5c3144a8
7
+ data.tar.gz: f728612e72205396974a39d691d4d929d1a0228c5d61be8cc5cb0fc0363ad422b27467b2a671e62d11b4f882e98b3b761dc576d09eae140e204c346df0acc497
@@ -0,0 +1,23 @@
1
+ module Homeland::Jobs
2
+ class JobsController < ::ApplicationController
3
+ before_action :set_node
4
+
5
+ def index
6
+ @suggest_topics = Topic.where(node_id: @node.id).suggest.limit(3)
7
+ suggest_topic_ids = @suggest_topics.map(&:id)
8
+ @topics = Topic.where(node_id: @node.id)
9
+ @topics = @topics.where.not(id: suggest_topic_ids) if suggest_topic_ids.count > 0
10
+ @topics = @topics.last_actived.includes(:user).page(params[:page])
11
+ render '/topics/index' if stale?(etag: [@node, @suggest_topics, @topics], template: '/topics/index')
12
+ end
13
+
14
+ def show
15
+ end
16
+
17
+ private
18
+
19
+ def set_node
20
+ @node = Node.find_builtin_node(25, '招聘')
21
+ end
22
+ end
23
+ end
@@ -1,3 +1,3 @@
1
1
  Homeland::Jobs::Engine.routes.draw do
2
- resources :jobs, controller: '/jobs'
2
+ get '/jobs', to: 'jobs#index'
3
3
  end
@@ -14,10 +14,8 @@ module Homeland
14
14
  plugin.root_path = "/jobs"
15
15
  end
16
16
 
17
- User.send :include, Homeland::Press::UserMixin
18
-
19
17
  app.routes.prepend do
20
- mount Homeland::Jobs::Engine => '/'
18
+ mount Homeland::Jobs::Engine, at: '/'
21
19
  end
22
20
  end
23
21
  end
@@ -2,6 +2,6 @@ module Homeland
2
2
  module Jobs
3
3
  NAME = 'jobs'
4
4
  DESCRIPTION = 'Display Job channel in navbar for list jobs.'
5
- VERSION = '0.1.0'
5
+ VERSION = '0.1.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homeland-jobs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Lee
@@ -34,7 +34,7 @@ files:
34
34
  - MIT-LICENSE
35
35
  - README.md
36
36
  - Rakefile
37
- - app/controllers/jobs_controller.rb
37
+ - app/controllers/homeland/jobs/jobs_controller.rb
38
38
  - config/routes.rb
39
39
  - lib/homeland/jobs.rb
40
40
  - lib/homeland/jobs/engine.rb
@@ -1,20 +0,0 @@
1
- class JobsController < ApplicationController
2
- helper Rails.application.routes.url_helpers
3
-
4
- before_action :set_node
5
-
6
- def index
7
- @suggest_topics = Topic.where(node_id: @node.id).suggest.limit(3)
8
- suggest_topic_ids = @suggest_topics.map(&:id)
9
- @topics = Topic.where(node_id: @node.id)
10
- @topics = @topics.where.not(id: suggest_topic_ids) if suggest_topic_ids.count > 0
11
- @topics = @topics.last_actived.includes(:user).page(params[:page])
12
- render '/topics/index' if stale?(etag: [@node, @suggest_topics, @topics], template: '/topics/index')
13
- end
14
-
15
- private
16
-
17
- def set_node
18
- @node = Node.find_builtin_node(25, '招聘')
19
- end
20
- end