futurino_hr 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +28 -0
  4. data/Rakefile +32 -0
  5. data/app/assets/config/futurino_hr_manifest.js +1 -0
  6. data/app/assets/javascripts/futurino_hr/admins.js +2 -0
  7. data/app/assets/javascripts/futurino_hr/clients.js +2 -0
  8. data/app/assets/javascripts/futurino_hr/job_applicants.js +2 -0
  9. data/app/assets/javascripts/futurino_hr/job_applications.js +2 -0
  10. data/app/assets/javascripts/futurino_hr/job_listings.js +2 -0
  11. data/app/assets/stylesheets/futurino_hr/admins.css +4 -0
  12. data/app/assets/stylesheets/futurino_hr/application.css +15 -0
  13. data/app/assets/stylesheets/futurino_hr/clients.css +4 -0
  14. data/app/assets/stylesheets/futurino_hr/job_applicants.css +4 -0
  15. data/app/assets/stylesheets/futurino_hr/job_applications.css +4 -0
  16. data/app/assets/stylesheets/futurino_hr/job_listings.css +4 -0
  17. data/app/assets/stylesheets/scaffold.css +56 -0
  18. data/app/controllers/futurino_hr/admins_controller.rb +62 -0
  19. data/app/controllers/futurino_hr/application_controller.rb +5 -0
  20. data/app/controllers/futurino_hr/clients_controller.rb +62 -0
  21. data/app/controllers/futurino_hr/job_applicants_controller.rb +127 -0
  22. data/app/controllers/futurino_hr/job_applications_controller.rb +80 -0
  23. data/app/controllers/futurino_hr/job_listings_controller.rb +86 -0
  24. data/app/helpers/futurino_hr/admins_helper.rb +4 -0
  25. data/app/helpers/futurino_hr/application_helper.rb +4 -0
  26. data/app/helpers/futurino_hr/clients_helper.rb +4 -0
  27. data/app/helpers/futurino_hr/job_applicants_helper.rb +4 -0
  28. data/app/helpers/futurino_hr/job_applications_helper.rb +4 -0
  29. data/app/helpers/futurino_hr/job_listings_helper.rb +4 -0
  30. data/app/jobs/futurino_hr/application_job.rb +4 -0
  31. data/app/mailers/futurino_hr/application_mailer.rb +6 -0
  32. data/app/models/futurino_hr/admin.rb +4 -0
  33. data/app/models/futurino_hr/application_record.rb +5 -0
  34. data/app/models/futurino_hr/client.rb +4 -0
  35. data/app/models/futurino_hr/job_applicant.rb +5 -0
  36. data/app/models/futurino_hr/job_application.rb +6 -0
  37. data/app/models/futurino_hr/job_listing.rb +7 -0
  38. data/app/views/futurino_hr/admins/_admin.json.jbuilder +2 -0
  39. data/app/views/futurino_hr/admins/_form.html.erb +17 -0
  40. data/app/views/futurino_hr/admins/edit.html.erb +6 -0
  41. data/app/views/futurino_hr/admins/index.html.erb +26 -0
  42. data/app/views/futurino_hr/admins/index.json.jbuilder +1 -0
  43. data/app/views/futurino_hr/admins/new.html.erb +5 -0
  44. data/app/views/futurino_hr/admins/show.html.erb +4 -0
  45. data/app/views/futurino_hr/admins/show.json.jbuilder +1 -0
  46. data/app/views/futurino_hr/clients/_client.json.jbuilder +2 -0
  47. data/app/views/futurino_hr/clients/_form.html.erb +17 -0
  48. data/app/views/futurino_hr/clients/edit.html.erb +6 -0
  49. data/app/views/futurino_hr/clients/index.html.erb +25 -0
  50. data/app/views/futurino_hr/clients/index.json.jbuilder +1 -0
  51. data/app/views/futurino_hr/clients/new.html.erb +5 -0
  52. data/app/views/futurino_hr/clients/show.html.erb +4 -0
  53. data/app/views/futurino_hr/clients/show.json.jbuilder +1 -0
  54. data/app/views/futurino_hr/job_applicants/_form.html.erb +96 -0
  55. data/app/views/futurino_hr/job_applicants/_job_applicant.json.jbuilder +2 -0
  56. data/app/views/futurino_hr/job_applicants/edit.html.erb +6 -0
  57. data/app/views/futurino_hr/job_applicants/index.html.erb +49 -0
  58. data/app/views/futurino_hr/job_applicants/index.json.jbuilder +1 -0
  59. data/app/views/futurino_hr/job_applicants/new.html.erb +5 -0
  60. data/app/views/futurino_hr/job_applicants/show.html.erb +72 -0
  61. data/app/views/futurino_hr/job_applicants/show.json.jbuilder +1 -0
  62. data/app/views/futurino_hr/job_applications/_form.html.erb +19 -0
  63. data/app/views/futurino_hr/job_applications/_job_application.json.jbuilder +2 -0
  64. data/app/views/futurino_hr/job_applications/edit.html.erb +6 -0
  65. data/app/views/futurino_hr/job_applications/index.html.erb +36 -0
  66. data/app/views/futurino_hr/job_applications/index.json.jbuilder +1 -0
  67. data/app/views/futurino_hr/job_applications/new.html.erb +6 -0
  68. data/app/views/futurino_hr/job_applications/show.html.erb +35 -0
  69. data/app/views/futurino_hr/job_applications/show.json.jbuilder +1 -0
  70. data/app/views/futurino_hr/job_listings/_form.html.erb +32 -0
  71. data/app/views/futurino_hr/job_listings/_job_listing.json.jbuilder +2 -0
  72. data/app/views/futurino_hr/job_listings/clientindex.html.erb +32 -0
  73. data/app/views/futurino_hr/job_listings/clientindex.json.jbuilder +1 -0
  74. data/app/views/futurino_hr/job_listings/clientshow.html.erb +18 -0
  75. data/app/views/futurino_hr/job_listings/clientshow.json.jbuilder +1 -0
  76. data/app/views/futurino_hr/job_listings/edit.html.erb +6 -0
  77. data/app/views/futurino_hr/job_listings/index.html.erb +32 -0
  78. data/app/views/futurino_hr/job_listings/index.json.jbuilder +1 -0
  79. data/app/views/futurino_hr/job_listings/new.html.erb +5 -0
  80. data/app/views/futurino_hr/job_listings/show.html.erb +19 -0
  81. data/app/views/futurino_hr/job_listings/show.json.jbuilder +1 -0
  82. data/app/views/layouts/futurino_hr/application.html.erb +14 -0
  83. data/config/routes.rb +18 -0
  84. data/db/migrate/20200824122156_create_futurino_hr_admins.rb +8 -0
  85. data/db/migrate/20200824122209_create_futurino_hr_clients.rb +8 -0
  86. data/db/migrate/20200824122219_create_futurino_hr_job_listings.rb +13 -0
  87. data/db/migrate/20200824122226_create_futurino_hr_job_applications.rb +11 -0
  88. data/db/migrate/20200824122231_create_futurino_hr_job_applicants.rb +24 -0
  89. data/lib/futurino_hr.rb +5 -0
  90. data/lib/futurino_hr/engine.rb +5 -0
  91. data/lib/futurino_hr/version.rb +3 -0
  92. data/lib/tasks/futurino_hr_tasks.rake +4 -0
  93. metadata +168 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ba44f2a388a7f2a3e274f5c6e275dd90ec193c9f22e8b6ff65723ae040264f39
4
+ data.tar.gz: 1ab4bf5d10ae43bfeed689b3ffa3087134802d07f54df576345a793433ec13f1
5
+ SHA512:
6
+ metadata.gz: 00d9f0e158c668a27ec40c5fac33aa1daf48ff73fcfef20f2533d77608a9fdf797015277a98ce8f5ec3a7e2897f14bac584c0cd8228547e534cd483e305c778c
7
+ data.tar.gz: a26ab548cf1ccffae9c0b5b2c14ed3be4aab69d7abbdef5640e3f0ed4424bf3f54496f0fcd71dfbdc542230ecb6f32d210444463ac61bed1c5e9061cac5aa682
@@ -0,0 +1,20 @@
1
+ Copyright 2020 Emre Boyaci
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.
@@ -0,0 +1,28 @@
1
+ # FuturinoHr
2
+ Short description and motivation.
3
+
4
+ ## Usage
5
+ How to use my plugin.
6
+
7
+ ## Installation
8
+ Add this line to your application's Gemfile:
9
+
10
+ ```ruby
11
+ gem 'futurino_hr'
12
+ ```
13
+
14
+ And then execute:
15
+ ```bash
16
+ $ bundle
17
+ ```
18
+
19
+ Or install it yourself as:
20
+ ```bash
21
+ $ gem install futurino_hr
22
+ ```
23
+
24
+ ## Contributing
25
+ Contribution directions go here.
26
+
27
+ ## License
28
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,32 @@
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 = 'FuturinoHr'
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", __dir__)
18
+ load 'rails/tasks/engine.rake'
19
+
20
+ load 'rails/tasks/statistics.rake'
21
+
22
+ require 'bundler/gem_tasks'
23
+
24
+ require 'rake/testtask'
25
+
26
+ Rake::TestTask.new(:test) do |t|
27
+ t.libs << 'test'
28
+ t.pattern = 'test/**/*_test.rb'
29
+ t.verbose = false
30
+ end
31
+
32
+ task default: :test
@@ -0,0 +1 @@
1
+ //= link_directory ../stylesheets/futurino_hr .css
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,2 @@
1
+ // Place all the behaviors and hooks related to the matching controller here.
2
+ // All this logic will automatically be available in application.js.
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,4 @@
1
+ /*
2
+ Place all the styles related to the matching controller here.
3
+ They will automatically be included in application.css.
4
+ */
@@ -0,0 +1,56 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ a { color: #000; }
16
+ a:visited { color: #666; }
17
+ a:hover { color: #fff; background-color:#000; }
18
+
19
+ div.field, div.actions {
20
+ margin-bottom: 10px;
21
+ }
22
+
23
+ #notice {
24
+ color: green;
25
+ }
26
+
27
+ .field_with_errors {
28
+ padding: 2px;
29
+ background-color: red;
30
+ display: table;
31
+ }
32
+
33
+ #error_explanation {
34
+ width: 450px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 0;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #error_explanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ margin-bottom: 0px;
49
+ background-color: #c00;
50
+ color: #fff;
51
+ }
52
+
53
+ #error_explanation ul li {
54
+ font-size: 12px;
55
+ list-style: square;
56
+ }
@@ -0,0 +1,62 @@
1
+ require_dependency "futurino_hr/application_controller"
2
+
3
+ module FuturinoHr
4
+ class AdminsController < ApplicationController
5
+ before_action :set_admin, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /admins
8
+ def index
9
+ @admins = Admin.all
10
+ end
11
+
12
+ # GET /admins/1
13
+ def show
14
+ end
15
+
16
+ # GET /admins/new
17
+ def new
18
+ @admin = Admin.new
19
+ end
20
+
21
+ # GET /admins/1/edit
22
+ def edit
23
+ end
24
+
25
+ # POST /admins
26
+ def create
27
+ @admin = Admin.new(admin_params)
28
+
29
+ if @admin.save
30
+ redirect_to @admin, notice: 'Admin was successfully created.'
31
+ else
32
+ render :new
33
+ end
34
+ end
35
+
36
+ # PATCH/PUT /admins/1
37
+ def update
38
+ if @admin.update(admin_params)
39
+ redirect_to @admin, notice: 'Admin was successfully updated.'
40
+ else
41
+ render :edit
42
+ end
43
+ end
44
+
45
+ # DELETE /admins/1
46
+ def destroy
47
+ @admin.destroy
48
+ redirect_to admins_url, notice: 'Admin was successfully destroyed.'
49
+ end
50
+
51
+ private
52
+ # Use callbacks to share common setup or constraints between actions.
53
+ def set_admin
54
+ @admin = Admin.find(params[:id])
55
+ end
56
+
57
+ # Only allow a trusted parameter "white list" through.
58
+ def admin_params
59
+ params[:admin]
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,5 @@
1
+ module FuturinoHr
2
+ class ApplicationController < ActionController::Base
3
+ protect_from_forgery with: :exception
4
+ end
5
+ end
@@ -0,0 +1,62 @@
1
+ require_dependency "futurino_hr/application_controller"
2
+
3
+ module FuturinoHr
4
+ class ClientsController < ApplicationController
5
+ before_action :set_client, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /clients
8
+ def index
9
+ @clients = Client.all
10
+ end
11
+
12
+ # GET /clients/1
13
+ def show
14
+ end
15
+
16
+ # GET /clients/new
17
+ def new
18
+ @client = Client.new
19
+ end
20
+
21
+ # GET /clients/1/edit
22
+ def edit
23
+ end
24
+
25
+ # POST /clients
26
+ def create
27
+ @client = Client.new(client_params)
28
+
29
+ if @client.save
30
+ redirect_to @client, notice: 'Client was successfully created.'
31
+ else
32
+ render :new
33
+ end
34
+ end
35
+
36
+ # PATCH/PUT /clients/1
37
+ def update
38
+ if @client.update(client_params)
39
+ redirect_to @client, notice: 'Client was successfully updated.'
40
+ else
41
+ render :edit
42
+ end
43
+ end
44
+
45
+ # DELETE /clients/1
46
+ def destroy
47
+ @client.destroy
48
+ redirect_to clients_url, notice: 'Client was successfully destroyed.'
49
+ end
50
+
51
+ private
52
+ # Use callbacks to share common setup or constraints between actions.
53
+ def set_client
54
+ @client = Client.find(params[:id])
55
+ end
56
+
57
+ # Only allow a trusted parameter "white list" through.
58
+ def client_params
59
+ params[:client]
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,127 @@
1
+ require_dependency "futurino_hr/application_controller"
2
+
3
+ module FuturinoHr
4
+ class JobApplicantsController < ApplicationController
5
+ before_action :set_job_applicant, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /job_applicants
8
+ # GET /job_applicants.json
9
+ def index
10
+ @job_applicants = JobApplicant.all
11
+ end
12
+
13
+ # GET /job_applicants/1
14
+ # GET /job_applicants/1.json
15
+ def show
16
+ end
17
+
18
+ # GET /job_applicants/new
19
+ def new
20
+ @job_applicant = JobApplicant.new
21
+ end
22
+
23
+ # GET /job_applicants/1/edit
24
+ def edit
25
+ end
26
+
27
+ # POST /job_applicants
28
+ # POST /job_applicants.json
29
+ def create
30
+ @job_applicant = JobApplicant.new(job_applicant_params)
31
+
32
+ respond_to do |format|
33
+ if @job_applicant.save
34
+ s3 = Aws::S3::Resource.new
35
+
36
+ #dosyanın kabul edilen fotoğraf formatlarından biriyle bitmesi önemli
37
+ if(params['job_applicant'][:image].present?) #image seçilmişse yükle
38
+ if params['job_applicant'][:image].original_filename.include?('png')
39
+ upload_file('png', s3)
40
+ elsif params['job_applicant'][:image].original_filename.include?('jpeg')
41
+ upload_file('jpeg', s3)
42
+ elsif params['job_applicant'][:image].original_filename.include?('jpg')
43
+ upload_file('jpeg', s3)
44
+ end
45
+ end
46
+
47
+ #dosyanın kabul edilen döküman formatlarından biriyle bitmesi önemli
48
+ if(params['job_applicant'][:cv].present?) #cv seçilmişse yükle
49
+ if params['job_applicant'][:cv].original_filename.include?('doc')
50
+ upload_file('doc', s3)
51
+ elsif params['job_applicant'][:cv].original_filename.include?('docx')
52
+ upload_file('docx', s3)
53
+ elsif params['job_applicant'][:cv].original_filename.include?('pdf')
54
+ upload_file('pdf', s3)
55
+ end
56
+ end
57
+
58
+
59
+ format.html { redirect_to @job_applicant, notice: 'Aday profili başarıyla oluşturuldu.' }
60
+ format.json { render :show, status: :created, location: @job_applicant }
61
+ else
62
+ format.html { render :new }
63
+ format.json { render json: @job_applicant.errors, status: :unprocessable_entity }
64
+ end
65
+ end
66
+ end
67
+
68
+ # PATCH/PUT /job_applicants/1
69
+ # PATCH/PUT /job_applicants/1.json
70
+ def update
71
+ respond_to do |format|
72
+ if @job_applicant.update(job_applicant_params)
73
+ format.html { redirect_to @job_applicant, notice: 'Aday profili başarıyla güncellendi.' }
74
+ format.json { render :show, status: :ok, location: @job_applicant }
75
+ else
76
+ format.html { render :edit }
77
+ format.json { render json: @job_applicant.errors, status: :unprocessable_entity }
78
+ end
79
+ end
80
+ end
81
+
82
+ # DELETE /job_applicants/1
83
+ # DELETE /job_applicants/1.json
84
+ def destroy
85
+ @job_applicant.destroy
86
+ respond_to do |format|
87
+ format.html { redirect_to job_applicants_url, notice: 'Aday profili başarıyla silindi.' }
88
+ format.json { head :no_content }
89
+ end
90
+ end
91
+
92
+ private
93
+
94
+ # Use callbacks to share common setup or constraints between actions.
95
+ def set_job_applicant
96
+ @job_applicant = JobApplicant.find(params[:id])
97
+ end
98
+
99
+ # Only allow a list of trusted parameters through.
100
+ def job_applicant_params
101
+ params.require(:job_applicant).permit(:name, :surname, :birth_date, :birth_place, :address, :e_mail,
102
+ :mobile_phone, :house_phone, :nationality, :graduated_school, :position,
103
+ :foreign_language, :job_listing_id)
104
+ end
105
+
106
+ #dosyayı aws'ye yükleyen metod
107
+ def upload_file(ext, s3)
108
+
109
+ #dosyayı oluştur ve içine veriyi yaz
110
+ open("/tmp/file#{@job_applicant.id}.#{ext}", 'w+') do |file|
111
+ if ext == 'png' || ext == 'jpeg' || ext == 'jpg'
112
+ file << File.open(params['job_applicant'][:image].tempfile).read
113
+ elsif ext == 'doc' || ext == 'docx' || ext == 'pdf'
114
+ file << File.open(params['job_applicant'][:cv].tempfile).read
115
+ end
116
+
117
+ name = File.basename(file) #extension'ıyla birlikte döndürüyor
118
+ object = s3.bucket('futurino').object("hr/#{name}")
119
+ #Parametre olarak File objesini değil de path'ini vermemiz önemli, aksi takdirde çok yavaş çalışıyor
120
+ object.upload_file(file.path)
121
+
122
+ #bitince dosyayı local makineden silebiliriz, ihtiyacımız kalmadı
123
+ FileUtils.rm_rf(file.path)
124
+ end
125
+ end
126
+ end
127
+ end