hr_engine6 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 (97) 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/hr_engine6_manifest.js +1 -0
  6. data/app/assets/stylesheets/hr_engine6/admins.css +4 -0
  7. data/app/assets/stylesheets/hr_engine6/application.css +15 -0
  8. data/app/assets/stylesheets/hr_engine6/clients.css +4 -0
  9. data/app/assets/stylesheets/hr_engine6/job_applicants.css +4 -0
  10. data/app/assets/stylesheets/hr_engine6/job_applications.css +4 -0
  11. data/app/assets/stylesheets/hr_engine6/job_listings.css +4 -0
  12. data/app/assets/stylesheets/scaffold.css +80 -0
  13. data/app/controllers/hr_engine6/admins_controller.rb +79 -0
  14. data/app/controllers/hr_engine6/application_controller.rb +5 -0
  15. data/app/controllers/hr_engine6/clients_controller.rb +79 -0
  16. data/app/controllers/hr_engine6/job_applicants_controller.rb +129 -0
  17. data/app/controllers/hr_engine6/job_applications_controller.rb +81 -0
  18. data/app/controllers/hr_engine6/job_listings_controller.rb +86 -0
  19. data/app/helpers/hr_engine6/admins_helper.rb +4 -0
  20. data/app/helpers/hr_engine6/application_helper.rb +4 -0
  21. data/app/helpers/hr_engine6/clients_helper.rb +4 -0
  22. data/app/helpers/hr_engine6/job_applicants_helper.rb +4 -0
  23. data/app/helpers/hr_engine6/job_applications_helper.rb +4 -0
  24. data/app/helpers/hr_engine6/job_listings_helper.rb +4 -0
  25. data/app/jobs/hr_engine6/application_job.rb +4 -0
  26. data/app/mailers/hr_engine6/application_mailer.rb +6 -0
  27. data/app/models/hr_engine6/admin.rb +4 -0
  28. data/app/models/hr_engine6/application_record.rb +5 -0
  29. data/app/models/hr_engine6/client.rb +4 -0
  30. data/app/models/hr_engine6/job_applicant.rb +6 -0
  31. data/app/models/hr_engine6/job_application.rb +6 -0
  32. data/app/models/hr_engine6/job_listing.rb +6 -0
  33. data/app/views/hr_engine6/admins/_admin.json.jbuilder +2 -0
  34. data/app/views/hr_engine6/admins/_form.html.erb +17 -0
  35. data/app/views/hr_engine6/admins/edit.html.erb +6 -0
  36. data/app/views/hr_engine6/admins/index.html.erb +25 -0
  37. data/app/views/hr_engine6/admins/index.json.jbuilder +1 -0
  38. data/app/views/hr_engine6/admins/new.html.erb +5 -0
  39. data/app/views/hr_engine6/admins/show.html.erb +4 -0
  40. data/app/views/hr_engine6/admins/show.json.jbuilder +1 -0
  41. data/app/views/hr_engine6/clients/_client.json.jbuilder +2 -0
  42. data/app/views/hr_engine6/clients/_form.html.erb +17 -0
  43. data/app/views/hr_engine6/clients/edit.html.erb +6 -0
  44. data/app/views/hr_engine6/clients/index.html.erb +25 -0
  45. data/app/views/hr_engine6/clients/index.json.jbuilder +1 -0
  46. data/app/views/hr_engine6/clients/new.html.erb +5 -0
  47. data/app/views/hr_engine6/clients/show.html.erb +4 -0
  48. data/app/views/hr_engine6/clients/show.json.jbuilder +1 -0
  49. data/app/views/hr_engine6/job_applicants/_form.html.erb +96 -0
  50. data/app/views/hr_engine6/job_applicants/_job_applicant.json.jbuilder +2 -0
  51. data/app/views/hr_engine6/job_applicants/edit.html.erb +6 -0
  52. data/app/views/hr_engine6/job_applicants/index.html.erb +49 -0
  53. data/app/views/hr_engine6/job_applicants/index.json.jbuilder +1 -0
  54. data/app/views/hr_engine6/job_applicants/new.html.erb +5 -0
  55. data/app/views/hr_engine6/job_applicants/show.html.erb +72 -0
  56. data/app/views/hr_engine6/job_applicants/show.json.jbuilder +1 -0
  57. data/app/views/hr_engine6/job_applications/_form.html.erb +20 -0
  58. data/app/views/hr_engine6/job_applications/_job_application.json.jbuilder +2 -0
  59. data/app/views/hr_engine6/job_applications/edit.html.erb +6 -0
  60. data/app/views/hr_engine6/job_applications/index.html.erb +36 -0
  61. data/app/views/hr_engine6/job_applications/index.json.jbuilder +1 -0
  62. data/app/views/hr_engine6/job_applications/new.html.erb +6 -0
  63. data/app/views/hr_engine6/job_applications/show.html.erb +35 -0
  64. data/app/views/hr_engine6/job_applications/show.json.jbuilder +1 -0
  65. data/app/views/hr_engine6/job_listings/_form.html.erb +32 -0
  66. data/app/views/hr_engine6/job_listings/_job_listing.json.jbuilder +2 -0
  67. data/app/views/hr_engine6/job_listings/clientindex.html.erb +32 -0
  68. data/app/views/hr_engine6/job_listings/clientindex.json.jbuilder +1 -0
  69. data/app/views/hr_engine6/job_listings/clientshow.html.erb +18 -0
  70. data/app/views/hr_engine6/job_listings/clientshow.json.jbuilder +1 -0
  71. data/app/views/hr_engine6/job_listings/edit.html.erb +6 -0
  72. data/app/views/hr_engine6/job_listings/index.html.erb +32 -0
  73. data/app/views/hr_engine6/job_listings/index.json.jbuilder +1 -0
  74. data/app/views/hr_engine6/job_listings/new.html.erb +5 -0
  75. data/app/views/hr_engine6/job_listings/show.html.erb +19 -0
  76. data/app/views/hr_engine6/job_listings/show.json.jbuilder +1 -0
  77. data/app/views/layouts/hr_engine6/application.html.erb +15 -0
  78. data/config/routes.rb +16 -0
  79. data/db/migrate/20200818121456_create_hr_engine6_job_applicants.rb +21 -0
  80. data/db/migrate/20200818121603_create_hr_engine6_job_applications.rb +8 -0
  81. data/db/migrate/20200818121658_create_hr_engine6_job_listings.rb +11 -0
  82. data/db/migrate/20200818121718_create_hr_engine6_admins.rb +8 -0
  83. data/db/migrate/20200818121745_create_hr_engine6_clients.rb +8 -0
  84. data/db/migrate/20200818122121_job_applicant_belongs_to_admin.rb +7 -0
  85. data/db/migrate/20200818122511_job_listings_belong_to_admin.rb +7 -0
  86. data/db/migrate/20200818122602_job_application_belongs_to_admin.rb +7 -0
  87. data/db/migrate/20200818122713_job_applicant_belongs_to_client.rb +7 -0
  88. data/db/migrate/20200818122753_job_application_belongs_to_client.rb +7 -0
  89. data/db/migrate/20200818122831_job_listing_belongs_to_client.rb +7 -0
  90. data/db/migrate/20200818123256_job_application_belongs_to_all2.rb +13 -0
  91. data/db/migrate/20200820135913_job_application_has_all2.rb +15 -0
  92. data/db/migrate/20200820145522_job_applicant_belongs_to_listings.rb +9 -0
  93. data/lib/hr_engine6.rb +5 -0
  94. data/lib/hr_engine6/engine.rb +5 -0
  95. data/lib/hr_engine6/version.rb +3 -0
  96. data/lib/tasks/hr_engine6_tasks.rake +4 -0
  97. metadata +172 -0
@@ -0,0 +1,81 @@
1
+ require_dependency "hr_engine6/application_controller"
2
+
3
+ module HrEngine6
4
+ class JobApplicationsController < ApplicationController
5
+ before_action :set_job_application, only: [:show, :edit, :update, :destroy]
6
+
7
+ # GET /job_applications
8
+ # GET /job_applications.json
9
+ def index
10
+ @job_applications = HrEngine6::JobApplication.all
11
+ end
12
+
13
+ # GET /job_applications/1
14
+ # GET /job_applications/1.json
15
+ def show
16
+ end
17
+
18
+ # GET /job_applications/new
19
+ def new
20
+ @job_application = HrEngine6::JobApplication.new(hr_engine6_job_applicant_id: params[:applicant_id],
21
+ hr_engine6_job_listing_id: params[:listing_id])
22
+ end
23
+
24
+ # GET /job_applications/1/edit
25
+ def edit
26
+ end
27
+
28
+ # POST /job_applications
29
+ # POST /job_applications.json
30
+ def create
31
+ @job_application = HrEngine6::JobApplication.new(hr_engine6_job_applicant_id: params[:applicant_id],
32
+ hr_engine6_job_listing_id: params[:listing_id])
33
+
34
+ respond_to do |format|
35
+ if @job_application.save
36
+ format.html { redirect_to @job_application, notice: 'İş başvurunuz başarıyla alındı.' }
37
+ format.json { render :show, status: :created, location: @job_application }
38
+ else
39
+ format.html { render :new }
40
+ format.json { render json: @job_application.errors, status: :unprocessable_entity }
41
+ end
42
+ end
43
+ end
44
+
45
+ # PATCH/PUT /job_applications/1
46
+ # PATCH/PUT /job_applications/1.json
47
+ def update
48
+ respond_to do |format|
49
+ if @job_application.update(job_application_params)
50
+ format.html { redirect_to @job_application, notice: 'İş başvurusu başarıyla güncellendi.' }
51
+ format.json { render :show, status: :ok, location: @job_application }
52
+ else
53
+ format.html { render :edit }
54
+ format.json { render json: @job_application.errors, status: :unprocessable_entity }
55
+ end
56
+ end
57
+ end
58
+
59
+ # DELETE /job_applications/1
60
+ # DELETE /job_applications/1.json
61
+ def destroy
62
+ @job_application.destroy
63
+ respond_to do |format|
64
+ format.html { redirect_to job_applications_url, notice: 'İş başvurusu başarıyla silindi.' }
65
+ format.json { head :no_content }
66
+ end
67
+ end
68
+
69
+ private
70
+ # Use callbacks to share common setup or constraints between actions.
71
+ def set_job_application
72
+ @job_application = JobApplication.find(params[:id])
73
+ end
74
+
75
+ # Only allow a list of trusted parameters through.
76
+ def job_application_params
77
+ params.fetch(:job_application, {})
78
+ end
79
+ end
80
+
81
+ end
@@ -0,0 +1,86 @@
1
+ require_dependency "hr_engine6/application_controller"
2
+
3
+ module HrEngine6
4
+ class JobListingsController < ApplicationController
5
+ before_action :set_job_listing, only: [:clientshow, :show, :edit, :update, :destroy]
6
+
7
+ # GET /job_listings
8
+ # GET /job_listings.json
9
+ def index
10
+ @job_listings = JobListing.all
11
+ end
12
+
13
+ def clientindex
14
+ @job_listings = JobListing.all
15
+ end
16
+
17
+ # GET /job_listings/1
18
+ # GET /job_listings/1.json
19
+ def show
20
+ end
21
+
22
+ def clientshow
23
+ end
24
+
25
+ # GET /job_listings/new
26
+ def new
27
+ @job_listing = JobListing.new
28
+ end
29
+
30
+ # GET /job_listings/1/edit
31
+ def edit
32
+ end
33
+
34
+ # POST /job_listings
35
+ # POST /job_listings.json
36
+ def create
37
+ @job_listing = JobListing.new(job_listing_params)
38
+
39
+ respond_to do |format|
40
+ if @job_listing.save
41
+ format.html { redirect_to @job_listing, notice: 'İş ilanı başarıyla oluşturuldu.' }
42
+ format.json { render 'job_listings/clientshow', status: :created, location: @job_listing }
43
+ else
44
+ format.html { render :new }
45
+ format.json { render json: @job_listing.errors, status: :unprocessable_entity }
46
+ end
47
+ end
48
+ end
49
+
50
+ # PATCH/PUT /job_listings/1
51
+ # PATCH/PUT /job_listings/1.json
52
+ def update
53
+ respond_to do |format|
54
+ if @job_listing.update(job_listing_params)
55
+ format.html { redirect_to @job_listing, notice: 'İş başvurusu başarıyla güncellendi.' }
56
+ format.json { render :'job_listings/clientshow', status: :ok, location: @job_listing }
57
+ else
58
+ format.html { render :edit }
59
+ format.json { render json: @job_listing.errors, status: :unprocessable_entity }
60
+ end
61
+ end
62
+ end
63
+
64
+ # DELETE /job_listings/1
65
+ # DELETE /job_listings/1.json
66
+ def destroy
67
+ @job_listing.destroy
68
+ respond_to do |format|
69
+ format.html { redirect_to job_listings_url, notice: 'İş başvurusu başarıyla silindi.' }
70
+ format.json { head :no_content }
71
+ end
72
+ end
73
+
74
+ private
75
+ # Use callbacks to share common setup or constraints between actions.
76
+ def set_job_listing
77
+ @job_listing = JobListing.find(params[:id])
78
+ end
79
+
80
+ # Only allow a list of trusted parameters through.
81
+ def job_listing_params
82
+ params.require(:job_listing).permit(:title, :description, :qualifications)
83
+ end
84
+ end
85
+
86
+ end
@@ -0,0 +1,4 @@
1
+ module HrEngine6
2
+ module AdminsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module HrEngine6
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module HrEngine6
2
+ module ClientsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module HrEngine6
2
+ module JobApplicantsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module HrEngine6
2
+ module JobApplicationsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module HrEngine6
2
+ module JobListingsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module HrEngine6
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module HrEngine6
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ module HrEngine6
2
+ class Admin < ApplicationRecord
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module HrEngine6
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module HrEngine6
2
+ class Client < ApplicationRecord
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module HrEngine6
2
+ class JobApplicant < ApplicationRecord
3
+ has_one :hr_engine6_job_applications, :class_name => 'HrEngine6::JobApplication'
4
+ has_many :hr_engine6_job_listings, :through => :hr_engine6_job_application, :class_name => 'HrEngine6::JobListing'
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module HrEngine6
2
+ class JobApplication < ApplicationRecord
3
+ belongs_to :hr_engine6_job_applicant, :class_name => 'HrEngine6::JobApplicant'
4
+ belongs_to :hr_engine6_job_listing, :class_name => 'HrEngine6::JobListing'
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ module HrEngine6
2
+ class JobListing < ApplicationRecord
3
+ has_one :hr_engine6_job_application, :class_name => 'HrEngine6::JobApplication'
4
+ has_many :hr_engine6_job_applicants, :through => :hr_engine6_job_application, :class_name => 'HrEngine6::JobApplicant'
5
+ end
6
+ end
@@ -0,0 +1,2 @@
1
+ json.extract! admin, :id, :created_at, :updated_at
2
+ json.url admin_url(admin, format: :json)
@@ -0,0 +1,17 @@
1
+ <%= form_with(model: admin, local: true) do |form| %>
2
+ <% if admin.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(admin.errors.count, "error") %> prohibited this admin from being saved:</h2>
5
+
6
+ <ul>
7
+ <% admin.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="actions">
15
+ <%= form.submit %>
16
+ </div>
17
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Admin</h1>
2
+
3
+ <%= render 'form', admin: @admin %>
4
+
5
+ <%= link_to 'Show', @admin %> |
6
+ <%= link_to 'Back', admins_path %>
@@ -0,0 +1,25 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Admin Paneli</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th colspan="3"></th>
9
+ </tr>
10
+ </thead>
11
+
12
+ <tbody>
13
+ <% @admins.each do |admin| %>
14
+ <tr>
15
+
16
+ </tr>
17
+ <% end %>
18
+ </tbody>
19
+ </table>
20
+
21
+ <br>
22
+
23
+ <%= link_to 'İş İlanları', job_listings_path %> |
24
+ <%= link_to 'Başvuruları Gör', job_applications_path %>
25
+
@@ -0,0 +1 @@
1
+ json.array! @admins, partial: "admins/admin", as: :admin
@@ -0,0 +1,5 @@
1
+ <h1>Yeni Admin</h1>
2
+
3
+ <%= render 'form', admin: @admin %>
4
+
5
+ <%= link_to 'Geri', admins_path %>
@@ -0,0 +1,4 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <%= link_to 'Edit', edit_admin_path(@admin) %> |
4
+ <%= link_to 'Back', admins_path %>
@@ -0,0 +1 @@
1
+ json.partial! "admins/admin", admin: @admin
@@ -0,0 +1,2 @@
1
+ json.extract! client, :id, :created_at, :updated_at
2
+ json.url client_url(client, format: :json)
@@ -0,0 +1,17 @@
1
+ <%= form_with(model: client, local: true) do |form| %>
2
+ <% if client.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(client.errors.count, "error") %> prohibited this client from being saved:</h2>
5
+
6
+ <ul>
7
+ <% client.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <div class="actions">
15
+ <%= form.submit %>
16
+ </div>
17
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing Client</h1>
2
+
3
+ <%= render 'form', client: @client %>
4
+
5
+ <%= link_to 'Show', @client %> |
6
+ <%= link_to 'Back', clients_path %>
@@ -0,0 +1,25 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <h1>Yeni Bir İş Başvurusunda Bulun</h1>
4
+
5
+ <table>
6
+ <thead>
7
+ <tr>
8
+ <th colspan="3"></th>
9
+ </tr>
10
+ </thead>
11
+
12
+ <tbody>
13
+ <% @clients.each do |client| %>
14
+ <tr>
15
+ </tr>
16
+ <% end %>
17
+ </tbody>
18
+ </table>
19
+
20
+ <br>
21
+
22
+
23
+ <%= link_to 'İş İlanlarını Gör', job_listings_client_path %> |
24
+ <%= link_to 'Yeni Başvuru', new_job_applicant_path %>
25
+
@@ -0,0 +1 @@
1
+ json.array! @clients, partial: "clients/client", as: :client
@@ -0,0 +1,5 @@
1
+ <h1>New Client</h1>
2
+
3
+ <%= render 'form', client: @client %>
4
+
5
+ <%= link_to 'Back', clients_path %>
@@ -0,0 +1,4 @@
1
+ <p id="notice"><%= notice %></p>
2
+
3
+ <%= link_to 'Edit', edit_client_path(@client) %> |
4
+ <%= link_to 'Back', clients_path %>
@@ -0,0 +1 @@
1
+ json.partial! "clients/client", client: @client
@@ -0,0 +1,96 @@
1
+ <%= form_with(model: job_applicant, local: true) do |form| %>
2
+ <% if job_applicant.errors.any? %>
3
+ <div id="error_explanation">
4
+ <h2><%= pluralize(job_applicant.errors.count, "error") %> prohibited this job_applicant from being saved:</h2>
5
+
6
+ <ul>
7
+ <% job_applicant.errors.full_messages.each do |message| %>
8
+ <li><%= message %></li>
9
+ <% end %>
10
+ </ul>
11
+ </div>
12
+ <% end %>
13
+
14
+ <%= form.collection_select :hr_engine6_job_listing_id, HrEngine6::JobListing.order(:id), :id, :title, include_blank: false %>
15
+
16
+ <div class="field">
17
+ <%= form.label "İsim" %>
18
+ <%= form.text_field :name %>
19
+ </div>
20
+
21
+ <div class="field">
22
+ <%= form.label "Soyisim" %>
23
+ <%= form.text_field :surname %>
24
+ </div>
25
+
26
+ <div class="field">
27
+ <%= form.label "Doğum Tarihi" %>
28
+ <%= form.date_select :birth_date, start_year: Time.now.year,
29
+ end_year: 1920, :use_month_names => ['Ocak', 'Şubat', 'Mart', 'Nisan', 'Mayıs', 'Haziran',
30
+ 'Temmuz', 'Ağustos', 'Eylül', 'Ekim', 'Kasım','Aralık']
31
+ %>
32
+ <!-- Ay isimleri lokalize ediliyor-->
33
+
34
+
35
+ </div>
36
+
37
+ <div class="field">
38
+ <%= form.label "Doğum Yeri" %>
39
+ <%= form.text_field :birth_place %>
40
+ </div>
41
+
42
+ <div class="field">
43
+ <%= form.label "Adres" %>
44
+ <%= form.text_field :address %>
45
+ </div>
46
+
47
+ <div class="field">
48
+ <%= form.label "E-posta" %>
49
+ <%= form.text_field :e_mail %>
50
+ </div>
51
+
52
+ <div class="field">
53
+ <%= form.label "Cep Telefonu" %>
54
+ <%= form.text_field :mobile_phone %>
55
+ </div>
56
+
57
+ <div class="field">
58
+ <%= form.label "Ev Telefonu" %>
59
+ <%= form.text_field :house_phone %>
60
+ </div>
61
+
62
+ <div class="field">
63
+ <%= form.label "Uyruk" %>
64
+ <%= form.text_field :nationality %>
65
+ </div>
66
+
67
+ <div class="field">
68
+ <%= form.label "Mezun Olunan Üniversite-Bölüm" %>
69
+ <%= form.text_field :graduated_school %>
70
+ </div>
71
+
72
+ <div class="field">
73
+ <%= form.label "Pozisyon" %>
74
+ <%= form.text_field :position %>
75
+ </div>
76
+
77
+ <div class="field">
78
+ <%= form.label "Bilinen Yabancı Diller" %>
79
+ <%= form.text_field :foreign_language %>
80
+ </div>
81
+
82
+ <div class="form-group">
83
+ <%= form.label "Fotoğraf" %>
84
+ <%= form.file_field :image, class: "form-control", accept: 'image/jpeg,image/png,image/jpg' %>
85
+ </div>
86
+
87
+ <div class="form-group">
88
+ <%= form.label :cv %>
89
+ <%= form.file_field :cv, class: "form-control", accept: 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document' %>
90
+ </div>
91
+
92
+
93
+ <div class="actions">
94
+ <%= form.submit "Gönder" %>
95
+ </div>
96
+ <% end %>