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,80 @@
1
+ require_dependency "futurino_hr/application_controller"
2
+
3
+ module FuturinoHr
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 = FuturinoHr::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 = FuturinoHr::JobApplication.new(job_applicant_id: params[:applicant_id],
21
+ 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 = FuturinoHr::JobApplication.new(job_applicant_id: params[:applicant_id],
32
+ 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
+ end
@@ -0,0 +1,86 @@
1
+ require_dependency "futurino_hr/application_controller"
2
+
3
+ module FuturinoHr
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 = FuturinoHr::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
+
75
+ private
76
+ # Use callbacks to share common setup or constraints between actions.
77
+ def set_job_listing
78
+ @job_listing = JobListing.find(params[:id])
79
+ end
80
+
81
+ # Only allow a list of trusted parameters through.
82
+ def job_listing_params
83
+ params.require(:job_listing).permit(:title, :description, :qualifications)
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,4 @@
1
+ module FuturinoHr
2
+ module AdminsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module FuturinoHr
2
+ module ApplicationHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module FuturinoHr
2
+ module ClientsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module FuturinoHr
2
+ module JobApplicantsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module FuturinoHr
2
+ module JobApplicationsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module FuturinoHr
2
+ module JobListingsHelper
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module FuturinoHr
2
+ class ApplicationJob < ActiveJob::Base
3
+ end
4
+ end
@@ -0,0 +1,6 @@
1
+ module FuturinoHr
2
+ class ApplicationMailer < ActionMailer::Base
3
+ default from: 'from@example.com'
4
+ layout 'mailer'
5
+ end
6
+ end
@@ -0,0 +1,4 @@
1
+ module FuturinoHr
2
+ class Admin < ActiveRecord::Base
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module FuturinoHr
2
+ class ApplicationRecord < ActiveRecord::Base
3
+ self.abstract_class = true
4
+ end
5
+ end
@@ -0,0 +1,4 @@
1
+ module FuturinoHr
2
+ class Client < ActiveRecord::Base
3
+ end
4
+ end
@@ -0,0 +1,5 @@
1
+ module FuturinoHr
2
+ class JobApplicant < ActiveRecord::Base
3
+ has_many :futurino_hr_job_applications, :class_name => 'FuturinoHr::JobApplication'
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ module FuturinoHr
2
+ class JobApplication < ActiveRecord::Base
3
+ belongs_to :futurino_hr_job_applicant, :class_name => 'FuturinoHr::JobApplicant'
4
+ belongs_to :futurino_hr_job_listing, :class_name => 'FuturinoHr::JobListing'
5
+ end
6
+ end
@@ -0,0 +1,7 @@
1
+ module FuturinoHr
2
+ class JobListing < ActiveRecord::Base
3
+ has_many :futurino_hr_job_applications, :class_name => 'FuturinoHr::JobApplication'
4
+ has_many :futurino_hr_job_applicants, :class_name => 'FuturinoHr::JobApplicant',
5
+ through: :futurino_hr_job_applications
6
+ end
7
+ 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_for(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,26 @@
1
+ <%= javascript_include_tag "application" %>
2
+ <p id="notice"><%= notice %></p>
3
+
4
+ <h1>Admin Paneli</h1>
5
+
6
+ <table>
7
+ <thead>
8
+ <tr>
9
+ <th colspan="3"></th>
10
+ </tr>
11
+ </thead>
12
+
13
+ <tbody>
14
+ <% @admins.each do |admin| %>
15
+ <tr>
16
+
17
+ </tr>
18
+ <% end %>
19
+ </tbody>
20
+ </table>
21
+
22
+ <br>
23
+
24
+ <%= link_to 'İş İlanları', job_listings_path %> |
25
+ <%= link_to 'Başvuruları Gör', job_applications_path %>
26
+
@@ -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_for :job_applicant, url: {action: "create"} 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 :job_listing_id, FuturinoHr::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 %>