homeland-jobs 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b99146f855f0645e342dc2b284820ab6ed804221
4
+ data.tar.gz: badb6e58323ec98cb4796968970b38d997a7f5bc
5
+ SHA512:
6
+ metadata.gz: 0d4db3e76254e9cae18269fba3b97495bdf36c24dff8489a6fb6a5585ce0cd3836c7f4e9b5d09bf48a348f934d18110fbbd344ac31902bef253a620f338aa826
7
+ data.tar.gz: ec2614ec978ff0e98f74f0e2d1cecbfe0e0d2b63cffd6f501894bd8f02f516987addbdde6faf89b6760e0e461b3f0eafdd06f0416288d3d5e92e59be6631965f
data/MIT-LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright 2017 Jason Lee
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,34 @@
1
+ Homeland::Jobs
2
+ --------------
3
+
4
+ 招聘栏目插件 for [Homeland](https://gethomeland.com)
5
+
6
+ 简单的实现 /jobs 栏目,并在导航栏显示。
7
+
8
+ ## Usage
9
+
10
+ ## Installation
11
+
12
+ 在 Homeland 应用的 Gemfile 增加:
13
+
14
+ ```ruby
15
+ gem 'homeland-jobs'
16
+ ```
17
+
18
+ And then execute:
19
+ ```bash
20
+ $ bundle
21
+ ```
22
+
23
+ ## Configuration
24
+
25
+ 修改 Homeland 的 `modules` 配置,增加 `jobs` 以启用。
26
+
27
+ ```yml
28
+ defaults: &defaults
29
+ # add "press" to modules
30
+ modules: 'topic,...,jobs'
31
+ ```
32
+
33
+ ## License
34
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
data/Rakefile ADDED
@@ -0,0 +1,36 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ require 'rdoc/task'
8
+
9
+ RDoc::Task.new(:rdoc) do |rdoc|
10
+ rdoc.rdoc_dir = 'rdoc'
11
+ rdoc.title = 'Homeland::Jobs'
12
+ rdoc.options << '--line-numbers'
13
+ rdoc.rdoc_files.include('README.md')
14
+ rdoc.rdoc_files.include('lib/**/*.rb')
15
+ end
16
+
17
+ APP_RAKEFILE = File.expand_path("../test/dummy/Rakefile", __FILE__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+
21
+ load 'rails/tasks/statistics.rake'
22
+
23
+
24
+
25
+ require 'bundler/gem_tasks'
26
+
27
+ require 'rake/testtask'
28
+
29
+ Rake::TestTask.new(:test) do |t|
30
+ t.libs << 'test'
31
+ t.pattern = 'test/**/*_test.rb'
32
+ t.verbose = false
33
+ end
34
+
35
+
36
+ task default: :test
@@ -0,0 +1,20 @@
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
data/config/routes.rb ADDED
@@ -0,0 +1,3 @@
1
+ Homeland::Jobs::Engine.routes.draw do
2
+ resources :jobs, controller: '/jobs'
3
+ end
@@ -0,0 +1,7 @@
1
+ require "homeland/jobs/version"
2
+ require "homeland/jobs/engine"
3
+
4
+ module Homeland
5
+ module Jobs
6
+ end
7
+ end
@@ -0,0 +1,26 @@
1
+ module Homeland
2
+ module Jobs
3
+ class Engine < ::Rails::Engine
4
+ isolate_namespace Homeland::Jobs
5
+
6
+ initializer 'homeland.jobs.init' do |app|
7
+ if Setting.has_module?(:jobs)
8
+ Homeland.register_plugin do |plugin|
9
+ plugin.name = 'jobs'
10
+ plugin.display_name = '招聘'
11
+ plugin.description = Homeland::Jobs::DESCRIPTION
12
+ plugin.version = Homeland::Jobs::VERSION
13
+ plugin.navbar_link = true
14
+ plugin.root_path = "/jobs"
15
+ end
16
+
17
+ User.send :include, Homeland::Press::UserMixin
18
+
19
+ app.routes.prepend do
20
+ mount Homeland::Jobs::Engine => '/'
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,7 @@
1
+ module Homeland
2
+ module Jobs
3
+ NAME = 'jobs'
4
+ DESCRIPTION = 'Display Job channel in navbar for list jobs.'
5
+ VERSION = '0.1.0'
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,66 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: homeland-jobs
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Jason Lee
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-03-02 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5'
27
+ description: Display Job channel in navbar for list jobs.
28
+ email:
29
+ - huacnlee@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - MIT-LICENSE
35
+ - README.md
36
+ - Rakefile
37
+ - app/controllers/jobs_controller.rb
38
+ - config/routes.rb
39
+ - lib/homeland/jobs.rb
40
+ - lib/homeland/jobs/engine.rb
41
+ - lib/homeland/jobs/version.rb
42
+ homepage: https://github.com/ruby-china/homeland-jobs
43
+ licenses:
44
+ - MIT
45
+ metadata: {}
46
+ post_install_message:
47
+ rdoc_options: []
48
+ require_paths:
49
+ - lib
50
+ required_ruby_version: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ required_rubygems_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: '0'
60
+ requirements: []
61
+ rubyforge_project:
62
+ rubygems_version: 2.6.8
63
+ signing_key:
64
+ specification_version: 4
65
+ summary: Display Job channel in navbar for list jobs.
66
+ test_files: []