submitter 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +39 -0
- data/Rakefile +1 -0
- data/lib/submitter/controllers/job_applications_controller.rb +119 -0
- data/lib/submitter/controllers/jobs_controller.rb +83 -0
- data/lib/submitter/generators/install/install_generator.rb +24 -0
- data/lib/submitter/generators/install/tamplates/create_applications_and_jobs.rb +29 -0
- data/lib/submitter/version.rb +3 -0
- data/lib/submitter.rb +12 -0
- data/submitter.gemspec +23 -0
- metadata +84 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 155c066f6129e75809e084f947ca4731acb59afe
|
4
|
+
data.tar.gz: 37afc484a8ae8dbc29cbe073f602948d0f1f7565
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e430e0a93f34a76004f859229ffd784a8e2423032feffac20ec22ec726a872f34b13eb5e1e65b0a732235025b67361ea794d23dcf0703f736d1466d4e58fa30d
|
7
|
+
data.tar.gz: b1f7bc2690e894bdd74d6717442153275fdaf00cc4e4eca0d50851a3b95ed8b0c234a726bf9226055fe886d866411a432c767d813f05a8117a72166139445764
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Ori Wwininger
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Submitter
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
gem 'submitter'
|
8
|
+
|
9
|
+
And then execute:
|
10
|
+
|
11
|
+
$ bundle
|
12
|
+
|
13
|
+
Or install it yourself as:
|
14
|
+
|
15
|
+
$ gem install submitter
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
You can add to the model a CV or what that you want with paperclip :
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
add_attachment :job_applications, :cv
|
23
|
+
|
24
|
+
Just remember to include paperclip in your app :
|
25
|
+
|
26
|
+
gem 'paperclip'
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
## Contributing
|
31
|
+
|
32
|
+
1. Fork it
|
33
|
+
2. Create your feature branch (`git checkout -b "your branch name"`)
|
34
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
35
|
+
4. Push to the branch (`git push origin "your branch name"`)
|
36
|
+
5. Ask for a pull request
|
37
|
+
|
38
|
+
##Created by :
|
39
|
+
######Ori wininger
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,119 @@
|
|
1
|
+
class JobApplicationsController < ApplicationController
|
2
|
+
|
3
|
+
# http_basic_authenticate_with name: "fiverr", password: "G0FiveRR", only: :index
|
4
|
+
|
5
|
+
|
6
|
+
def delete
|
7
|
+
@application = JobApplication.find(params[:id])
|
8
|
+
@application.destroy
|
9
|
+
|
10
|
+
respond_to do |format|
|
11
|
+
format.html { redirect_to job_applications_path }
|
12
|
+
format.json { head :no_content }
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def hide
|
17
|
+
@application = JobApplication.find(params[:id])
|
18
|
+
@application.status = 'hide'
|
19
|
+
@application.save!
|
20
|
+
redirect_to root_path
|
21
|
+
end
|
22
|
+
|
23
|
+
def approve
|
24
|
+
@application = JobApplication.find(params[:id])
|
25
|
+
@application.status = 'approved'
|
26
|
+
@application.save!
|
27
|
+
redirect_to root_path
|
28
|
+
end
|
29
|
+
# GET /applications
|
30
|
+
# GET /applications.json
|
31
|
+
def index
|
32
|
+
Graylog.notify!('my message')
|
33
|
+
@applications = JobApplication.all
|
34
|
+
@jobs = Job.all
|
35
|
+
#respond_to do |format|
|
36
|
+
#format.html # index.html.erb
|
37
|
+
#format.json { render json: @applications }
|
38
|
+
#end
|
39
|
+
end
|
40
|
+
|
41
|
+
# GET /applications/1
|
42
|
+
# GET /applications/1.json
|
43
|
+
def show
|
44
|
+
@application = JobApplication.find(params[:id])
|
45
|
+
|
46
|
+
respond_to do |format|
|
47
|
+
format.html # show.html.erb
|
48
|
+
format.json { render json: @application }
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
# GET /applications/new
|
54
|
+
# GET /applications/new.json
|
55
|
+
def new
|
56
|
+
@job = Job.find_by_parameter(params["jobapp"])
|
57
|
+
if @job.nil?
|
58
|
+
redirect_to 'http://www.fiverr.com/jobs'
|
59
|
+
else
|
60
|
+
@action = :new
|
61
|
+
@application = JobApplication.new
|
62
|
+
@company = User.find_by_company(params[:company_id])
|
63
|
+
respond_to do |format|
|
64
|
+
format.html # new.html.erb
|
65
|
+
format.json { render json: @application }
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# GET /applications/1/edit
|
71
|
+
def edit
|
72
|
+
@application = JobApplication.find(params[:id])
|
73
|
+
end
|
74
|
+
|
75
|
+
# POST /applications
|
76
|
+
# POST /applications.json
|
77
|
+
def create
|
78
|
+
job_application = JobApplication.new(params[:JobApplication])
|
79
|
+
@job = Job.find_by_parameter(params[:jobapp])
|
80
|
+
job_application.job = @job.name
|
81
|
+
job_application.location = @job.job_location
|
82
|
+
job_application.status = :pending
|
83
|
+
# application.status = :pending
|
84
|
+
job_application.save!
|
85
|
+
#binding.pry
|
86
|
+
redirect_to 'http://www.fiverr.com'
|
87
|
+
# else
|
88
|
+
# @application = JobApplication.new(params[:job_application])
|
89
|
+
# render action: "new"
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# PUT /applications/1
|
94
|
+
# PUT /applications/1.json
|
95
|
+
def update
|
96
|
+
@application = JobApplication.find(params[:id])
|
97
|
+
|
98
|
+
respond_to do |format|
|
99
|
+
if @application.update_attributes(params[:application])
|
100
|
+
format.html { redirect_to @application, notice: 'Application was successfully updated.' }
|
101
|
+
format.json { head :no_content }
|
102
|
+
else
|
103
|
+
format.html { render action: "edit" }
|
104
|
+
format.json { render json: @application.errors, status: :unprocessable_entity }
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
# DELETE /applications/1
|
110
|
+
# DELETE /applications/1.json
|
111
|
+
def destroy
|
112
|
+
@application = JobApplication.find(params[:id])
|
113
|
+
@application.destroy
|
114
|
+
|
115
|
+
respond_to do |format|
|
116
|
+
format.html { redirect_to job_applications_path }
|
117
|
+
format.json { head :no_content }
|
118
|
+
end
|
119
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
class JobsController < ApplicationController
|
2
|
+
# GET /jobs
|
3
|
+
# GET /jobs.json
|
4
|
+
def index
|
5
|
+
@jobs = Job.all
|
6
|
+
|
7
|
+
respond_to do |format|
|
8
|
+
format.html # index.html.erb
|
9
|
+
format.json { render json: @jobs }
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
# GET /jobs/1
|
14
|
+
# GET /jobs/1.json
|
15
|
+
def show
|
16
|
+
@job = Job.find(params[:id])
|
17
|
+
|
18
|
+
respond_to do |format|
|
19
|
+
format.html # show.html.erb
|
20
|
+
format.json { render json: @job }
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
# GET /jobs/new
|
25
|
+
# GET /jobs/new.json
|
26
|
+
def new
|
27
|
+
@job = Job.new
|
28
|
+
|
29
|
+
respond_to do |format|
|
30
|
+
format.html # new.html.erb
|
31
|
+
format.json { render json: @job }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# GET /jobs/1/edit
|
36
|
+
def edit
|
37
|
+
@job = Job.find(params[:id])
|
38
|
+
end
|
39
|
+
|
40
|
+
# POST /jobs
|
41
|
+
# POST /jobs.json
|
42
|
+
def create
|
43
|
+
@job = Job.new(params[:job])
|
44
|
+
@job.parameter = Digest::MD5.hexdigest(@job.name + @job.job_location)
|
45
|
+
respond_to do |format|
|
46
|
+
if @job.save
|
47
|
+
format.html { redirect_to @job, notice: 'Job was successfully created.' }
|
48
|
+
format.json { render json: @job, status: :created, location: @job }
|
49
|
+
else
|
50
|
+
format.html { render action: "new" }
|
51
|
+
format.json { render json: @job.errors, status: :unprocessable_entity }
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# PUT /jobs/1
|
57
|
+
# PUT /jobs/1.json
|
58
|
+
def update
|
59
|
+
@job = Job.find(params[:id])
|
60
|
+
|
61
|
+
respond_to do |format|
|
62
|
+
if @job.update_attributes(params[:job])
|
63
|
+
format.html { redirect_to @job, notice: 'Job was successfully updated.' }
|
64
|
+
format.json { head :no_content }
|
65
|
+
else
|
66
|
+
format.html { render action: "edit" }
|
67
|
+
format.json { render json: @job.errors, status: :unprocessable_entity }
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
# DELETE /jobs/1
|
73
|
+
# DELETE /jobs/1.json
|
74
|
+
def destroy
|
75
|
+
@job = Job.find(params[:id])
|
76
|
+
@job.destroy
|
77
|
+
|
78
|
+
respond_to do |format|
|
79
|
+
format.html { redirect_to job_applications_path }
|
80
|
+
format.json { head :no_content }
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'rails/generators/migration'
|
2
|
+
|
3
|
+
module Submitter
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < ::Rails::Generators::Base
|
6
|
+
include Rails::Generators::Migration
|
7
|
+
source_root File.expand_path('../templates', __FILE__)
|
8
|
+
desc "add the migrations"
|
9
|
+
|
10
|
+
def self.next_migration_number(path)
|
11
|
+
unless @prev_migration_nr
|
12
|
+
@prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
|
13
|
+
else
|
14
|
+
@prev_migration_nr += 1
|
15
|
+
end
|
16
|
+
@prev_migration_nr.to_s
|
17
|
+
end
|
18
|
+
|
19
|
+
def copy_migrations
|
20
|
+
migration_template "create_applications_and_jobs.rb", "db/migrate/create_applications_and_jobs.rb"
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class CreateApplicationsAndJobs < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
create_table :job_applications do |t|
|
4
|
+
t.string :name
|
5
|
+
t.string :status
|
6
|
+
t.string :portfolio
|
7
|
+
t.string :email
|
8
|
+
t.string :phone
|
9
|
+
t.string :location
|
10
|
+
|
11
|
+
t.timestamps
|
12
|
+
end
|
13
|
+
|
14
|
+
create_table :jobs do |t|
|
15
|
+
t.string :location
|
16
|
+
t.boolean :portfolio
|
17
|
+
t.string :title
|
18
|
+
t.string :token
|
19
|
+
|
20
|
+
t.timestamps
|
21
|
+
end
|
22
|
+
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.down
|
26
|
+
drop_table :job_applications
|
27
|
+
drop_table :jobs
|
28
|
+
end
|
29
|
+
end
|
data/lib/submitter.rb
ADDED
data/submitter.gemspec
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'submitter/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "submitter"
|
8
|
+
spec.version = Submitter::VERSION
|
9
|
+
spec.authors = ["Ori Wininger"]
|
10
|
+
spec.email = ["oriwininger0@gmail.com"]
|
11
|
+
spec.description = %q{submitter}
|
12
|
+
spec.summary = %q{submitter}
|
13
|
+
spec.homepage = "http://www.github.com/oriwininger/submitter"
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: submitter
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Ori Wininger
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-07-29 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ~>
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: submitter
|
42
|
+
email:
|
43
|
+
- oriwininger0@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- .gitignore
|
49
|
+
- Gemfile
|
50
|
+
- LICENSE.txt
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- lib/submitter.rb
|
54
|
+
- lib/submitter/controllers/job_applications_controller.rb
|
55
|
+
- lib/submitter/controllers/jobs_controller.rb
|
56
|
+
- lib/submitter/generators/install/install_generator.rb
|
57
|
+
- lib/submitter/generators/install/tamplates/create_applications_and_jobs.rb
|
58
|
+
- lib/submitter/version.rb
|
59
|
+
- submitter.gemspec
|
60
|
+
homepage: http://www.github.com/oriwininger/submitter
|
61
|
+
licenses:
|
62
|
+
- MIT
|
63
|
+
metadata: {}
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
requirements: []
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 2.0.3
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: submitter
|
84
|
+
test_files: []
|