Create admin page
I have created admin page to manage another site.
-
Xuan Trung Le @trunglx
added 5 commits
-
837b9e7e...9bed3589 - 4 commits from branch
master - 4506d3a9 - fix creating role admin
added 5 commits
-
837b9e7e...9bed3589 - 4 commits from branch
master - 4506d3a9 - fix creating role admin
added 5 commits * 837b9e7e...9bed3589 - 4 commits from branch `master` * 4506d3a9 - fix creating role admin [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3832&start_sha=837b9e7e2f6c9e1b9a68949b22d595b51f923132)Toggle commit list -
837b9e7e...9bed3589 - 4 commits from branch
-
Xuan Trung Le @trunglx
added 1 commit
- d820e01d - add gem rsolr
added 1 commit * d820e01d - add gem rsolr [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3833&start_sha=4506d3a947327adb9fcdb1c85d8f57da5ffca5a1)Toggle commit list -
Xuan Trung Le @trunglx
added 1 commit
- c4767154 - fix bugs
added 1 commit * c4767154 - fix bugs [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3844&start_sha=d820e01d54a70d403e9b1e1bdf5b6a3bd4fa7b1d)Toggle commit list -
Xuan Trung Le @trunglx
added 1 commit
- 173c9bf2 - fig bugs
added 1 commit * 173c9bf2 - fig bugs [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3848&start_sha=c476715437d8be6772b13dd01506dadd43388b8b)Toggle commit list -
1 <% @applications.each do |application| %> 2 <div class="job-intro well mr0 mrBot20"> 3 <h4 class="mr0"><%= link_to application.job.name, job_path(application.job) %></h4> 4 <p><%= "Candidate Name: #{application.user.name}" %></p> -
Ba Toi Dang @toidb commentedMasterEdited by Ba Toi Dang
@trunglx move the unnecessary text out of
<%%>:EX:
<%= "Candidate Name: #{application.user.name}" %>=>Candidate Name: <%= application.user.name %>Please check others.
@trunglx move the unnecessary text out of `<%%>`: EX: `<%= "Candidate Name: #{application.user.name}" %>` => `Candidate Name: <%= application.user.name %>` Please check others. -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 16 of the diff
changed this line in version 16 of the diff
changed this line in [version 16 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3870&start_sha=9d7fa59dc4ce62abec5390aa31e34ace0569f4d7#2e9f68ae74724cf70939e231ffec1672bf32a632_4_4)Toggle commit list
Please register or sign in to reply -
-
1 <% @applications.each do |application| %> 2 <div class="job-intro well mr0 mrBot20"> 3 <h4 class="mr0"><%= link_to application.job.name, job_path(application.job) %></h4> 4 <p><%= "Candidate Name: #{application.user.name}" %></p> 5 <p><%= "Candidate CV: #{application.user.cv}" %></p> 6 <p> 7 <span><%= "Candidate Email: #{application.user.email}" %></span> 8 <span class="navbar-right"><%= "Applied at: #{application.created_at.strftime('%m/%d/%y')}" %></span> -
Ba Toi Dang @toidb commentedMaster
@trunglx please use I18n
EX:
application.created_at.strftime('%m/%d/%y')=>l(application.created_at, format: :short)Please check others.
@trunglx please use I18n EX: `application.created_at.strftime('%m/%d/%y')` => `l(application.created_at, format: :short)` Please check others. -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 7 of the diff
changed this line in version 7 of the diff
changed this line in [version 7 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3850&start_sha=173c9bf28d71ed204d72c4c75f88c55b5e8b6cfe#2e9f68ae74724cf70939e231ffec1672bf32a632_8_7)Toggle commit list
-
-
1 <% @applications.each do |application| %> 2 <div class="job-intro well mr0 mrBot20"> 3 <h4 class="mr0"><%= link_to application.job.name, job_path(application.job) %></h4> 4 <p><%= "Candidate Name: #{application.user.name}" %></p> 5 <p><%= "Candidate CV: #{application.user.cv}" %></p> -
Ba Toi Dang @toidb commentedMaster
@trunglx please check here again
application.user.cvORapplication.user.cv_path?@trunglx please check here again `application.user.cv` OR `application.user.cv_path`? -
Xuan Trung Le @trunglx commentedMaster
I will fix this error when feature/create_admin_page merge with master.
I will fix this error when feature/create_admin_page merge with master. -
Xuan Trung Le @trunglx
changed this line in version 16 of the diff
changed this line in version 16 of the diff
changed this line in [version 16 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3870&start_sha=9d7fa59dc4ce62abec5390aa31e34ace0569f4d7#2e9f68ae74724cf70939e231ffec1672bf32a632_5_4)Toggle commit list
-
-
14 14 //= require_tree . 15 15 //= require javascripts/jquery-3.2.1.min.js 16 16 //= require javascripts/bootstrap.min.js 17 //= require javascripts/bootstrap.min.js 18 //= require bootstrap-datetimepicker.min.js 17 19 18 20 $(document).ready(function(){ 19 21 $('.message').delay(5000).fadeOut('slow'); 22 23 $('.form_date').datetimepicker({ 24 language: 'fr', -
Ba Toi Dang @toidb commentedMaster
Why you use
frlang?Why you use `fr` lang? -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 7 of the diff
changed this line in version 7 of the diff
changed this line in [version 7 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3850&start_sha=173c9bf28d71ed204d72c4c75f88c55b5e8b6cfe#431311cbb9902e2a56811443372061424f388e2c_24_24)Toggle commit list
-
-
14 14 //= require_tree . 15 15 //= require javascripts/jquery-3.2.1.min.js -
Ba Toi Dang @toidb commentedMaster
-
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 8 of the diff
changed this line in version 8 of the diff
changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3851&start_sha=8868ae1d16cbd0eb2f8c4d8ce6f635ffb0e34a12#431311cbb9902e2a56811443372061424f388e2c_15_15)Toggle commit list
-
-
14 14 //= require_tree . 15 15 //= require javascripts/jquery-3.2.1.min.js -
Ba Toi Dang @toidb commentedMaster
-
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 8 of the diff
changed this line in version 8 of the diff
changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3851&start_sha=8868ae1d16cbd0eb2f8c4d8ce6f635ffb0e34a12#431311cbb9902e2a56811443372061424f388e2c_15_15)Toggle commit list
-
-
1 1 @import "stylesheets/bootstrap-theme.min.css"; -
Ba Toi Dang @toidb commentedMaster
I think it should be (do not need
stylesheets/andjsextension):@import 'bootstrap-theme.min'; @import 'bootstrap.min'; ...I think it should be (do not need `stylesheets/` and `js` extension): ``` @import 'bootstrap-theme.min'; @import 'bootstrap.min'; ... ``` -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 8 of the diff
changed this line in version 8 of the diff
changed this line in [version 8 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3851&start_sha=8868ae1d16cbd0eb2f8c4d8ce6f635ffb0e34a12#1637dd5207d3586063c883b080a13b0322095524_1_1)Toggle commit list
-
-
24 <input class="form-control" size="16" type="text" value="" readonly> 25 <span class="input-group-addon"><span class="glyphicon glyphicon-remove fa fa-trash-o"></span></span> 26 <span class="input-group-addon"><span class="glyphicon glyphicon-calendar fa fa-calendar"></span></span> 27 </div> 28 <%= hidden_field_tag('dtp_input2', params[:date_to], value: '') %> 29 </div> 30 <div class="field form-group form-inline text-center"> 31 <%= submit_tag "search", class: "btn btn-default" %> 32 <%= submit_tag "Down csv", class: "btn btn-default" %> 33 </div> 34 <% end %> 35 </div> 36 37 <div class="col-md-12 jobs"> 38 <div class="panel border_bot clearfix"> 39 <%= render "admins/applies/application", applications: @application %> -
Ba Toi Dang @toidb commentedMaster
@trunglx I think there is an error and I should be
applications: @applications.Please check again.
@trunglx I think there is an error and I should be `applications: @applications`. Please check again. -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 7 of the diff
changed this line in version 7 of the diff
changed this line in [version 7 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3850&start_sha=173c9bf28d71ed204d72c4c75f88c55b5e8b6cfe#9b383afb46a5fd497d16b6c002564a916d2ee00c_39_39)Toggle commit list
-
-
Xuan Trung Le @trunglx
added 1 commit
- 8868ae1d - fix bugs
added 1 commit * 8868ae1d - fix bugs [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3850&start_sha=173c9bf28d71ed204d72c4c75f88c55b5e8b6cfe)Toggle commit list -
Xuan Trung Le @trunglx
added 1 commit
- 5297dcb4 - fix bugs
added 1 commit * 5297dcb4 - fix bugs [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3851&start_sha=8868ae1d16cbd0eb2f8c4d8ce6f635ffb0e34a12)Toggle commit list -
Xuan Trung Le @trunglx
added 1 commit
- 48aecf01 - download csv file
added 1 commit * 48aecf01 - download csv file [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3853&start_sha=5297dcb429431339a608a8db8065d67cdb6eb8a4)Toggle commit list -
Xuan Trung Le @trunglx
added 1 commit
- 319449c8 - fix bugs: admin can apply or favorite job
added 1 commit * 319449c8 - fix bugs: admin can apply or favorite job [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3855&start_sha=48aecf01f7a4ebec0769dda2603794bac0323de4)Toggle commit list -
Xuan Trung Le @trunglx
added 1 commit
- 255c61c4 - fix bugs: jobs can apply when out of date
added 1 commit * 255c61c4 - fix bugs: jobs can apply when out of date [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3856&start_sha=319449c8638e664e84293bbe2eb1b4f68573e15e)Toggle commit list -
12 12 // 13 13 //= require rails-ujs 14 14 //= require_tree . 15 //= require javascripts/jquery-3.2.1.min.js 16 //= require javascripts/bootstrap.min.js 15 //= require jquery-3.2.1.min.js -
Ba Toi Dang @toidb commentedMasterEdited by Ba Toi Dang
@trunglx u can use
jquery-3.2.1.mininstead ofjquery-3.2.1.min.js.Please check others.
@trunglx u can use `jquery-3.2.1.min` instead of `jquery-3.2.1.min.js`. Please check others. -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3859&start_sha=255c61c481bdc5396a53e64bdfc31354e4b0b514#431311cbb9902e2a56811443372061424f388e2c_15_14)Toggle commit list
-
-
12 12 // 13 13 //= require rails-ujs 14 14 //= require_tree . -
Ba Toi Dang @toidb commentedMaster
@trunglx please use specific path instead of auto-import with
require_tree .@trunglx please use specific path instead of auto-import with `require_tree .` -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3859&start_sha=255c61c481bdc5396a53e64bdfc31354e4b0b514#431311cbb9902e2a56811443372061424f388e2c_14_14)Toggle commit list
-
-
1 @import "stylesheets/bootstrap-theme.min.css"; 2 @import "stylesheets/bootstrap.min.css"; 1 @import "bootstrap-theme.min.css"; -
Ba Toi Dang @toidb commentedMaster
@trunglx u can use
"bootstrap-theme.mininstead of"bootstrap-theme.min.css.Please check others.
@trunglx u can use `"bootstrap-theme.min` instead of `"bootstrap-theme.min.css`. Please check others. -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed
-
-
1 require 'rsolr' 2 require "csv" 3 1 4 class Admins::AppliesController < ApplicationController 2 5 def index 6 @cities = City.pluck(:id, :name) -
Ba Toi Dang @toidb commentedMaster
@trunglx please move
@cities = City.pluck(:id, :name)to helper.@trunglx please move ` @cities = City.pluck(:id, :name)` to helper. -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3859&start_sha=255c61c481bdc5396a53e64bdfc31354e4b0b514#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_6_7)Toggle commit list
-
-
2 require "csv" 3 1 4 class Admins::AppliesController < ApplicationController 2 5 def index 6 @cities = City.pluck(:id, :name) 7 if params[:commit] 8 # get condition here 9 condition = get_condition 10 # get applications from query 11 response = query(condition) 12 job_id = response["response"]["docs"].pluck("id") 13 14 @applications = ApplyJob.where(job_id: job_id).includes(:job, :user) 15 if params[:commit].eql? 'Down csv' 16 flash[:notice] = 'Down csv' 17 down_csv(@applications) -
Ba Toi Dang @toidb commentedMaster
-
Xuan Trung Le @trunglx commentedMaster
fixed
fixed
-
-
26 def down_csv(applications) 27 28 # handle data 29 data_csv = [] 30 applications.each do |application| 31 candidate = {} 32 candidate[:job] = application.job.name 33 candidate[:name] = application.name 34 candidate[:email] = application.email 35 candidate[:cv] = application.cv 36 candidate[:applied_at] = application.created_at 37 data_csv << candidate 38 end 39 40 # create new csv file 41 CSV.open("file.csv", "wb") do |csv| -
Ba Toi Dang @toidb commentedMaster
@trunglx please check duplicate data when there write
file.csvat the same time.@trunglx please check duplicate data when there write `file.csv` at the same time. -
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3859&start_sha=255c61c481bdc5396a53e64bdfc31354e4b0b514#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_41_37)Toggle commit list
-
-
61 # Direct connection 62 connect 63 # use get method to query 64 response = @solr.get 'select', :params => condition 65 response 66 end 67 68 def get_condition 69 condition = {} 70 filter_query = [] 71 date_from = '*' 72 date_to = 'NOW' 73 74 # get condition 75 condition[:q] = "email:[* TO *]" 76 filter_query << "email:\"#{params[:email]}\"" if params[:email] -
Ba Toi Dang @toidb commentedMasterEdited by Ba Toi Dang@trunglx please escape data before searching. EX: `params[:email] = :abc ` Please check others.
-
Xuan Trung Le @trunglx commentedMaster
this doesn't necessary.
this doesn't necessary.
-
-
53 54 private 55 def connect 56 url = 'http://localhost:8983/solr/my_solr_collection' 57 @solr = RSolr.connect url: url 58 end 59 60 def query(condition) 61 # Direct connection 62 connect 63 # use get method to query 64 response = @solr.get 'select', :params => condition 65 response 66 end 67 68 def get_condition -
Ba Toi Dang @toidb commentedMaster
@trunglx I think you should move that code into service.
@trunglx I think you should move that code into service.
-
-
49 50 # down file.csv into local 51 send_file "#{Rails.root}/file.csv", type: 'application/csv' 52 end 53 54 private 55 def connect 56 url = 'http://localhost:8983/solr/my_solr_collection' 57 @solr = RSolr.connect url: url 58 end 59 60 def query(condition) 61 # Direct connection 62 connect 63 # use get method to query 64 response = @solr.get 'select', :params => condition -
Ba Toi Dang @toidb commentedMaster
-
Xuan Trung Le @trunglx
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3859&start_sha=255c61c481bdc5396a53e64bdfc31354e4b0b514#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_64_51)Toggle commit list
-
-
41 CSV.open("file.csv", "wb") do |csv| 42 # write header 43 csv << data_csv.first.keys 44 # write values 45 data_csv.each_with_index do |data, i| 46 csv << data.values 47 end 48 end 49 50 # down file.csv into local 51 send_file "#{Rails.root}/file.csv", type: 'application/csv' 52 end 53 54 private 55 def connect 56 url = 'http://localhost:8983/solr/my_solr_collection' -
Ba Toi Dang @toidb commentedMaster
-
Xuan Trung Le @trunglx
changed this line in version 16 of the diff
changed this line in version 16 of the diff
changed this line in [version 16 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3870&start_sha=9d7fa59dc4ce62abec5390aa31e34ace0569f4d7#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_43_44)Toggle commit list
-
-
8 # get condition here 9 condition = get_condition 10 # get applications from query 11 response = query(condition) 12 job_id = response["response"]["docs"].pluck("id") 13 14 @applications = ApplyJob.where(job_id: job_id).includes(:job, :user) 15 if params[:commit].eql? 'Down csv' 16 flash[:notice] = 'Down csv' 17 down_csv(@applications) 18 end 19 else 20 # get applications 21 @applications = ApplyJob.includes(:job, :user) 22 end 23 puts params[:commit] -
Ba Toi Dang @toidb commentedMaster
-
Xuan Trung Le @trunglx commentedMaster
fixed.
fixed. -
Xuan Trung Le @trunglx
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3859&start_sha=255c61c481bdc5396a53e64bdfc31354e4b0b514#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_23_23)Toggle commit list
-
-
1 1 class ApplicationController < ActionController::Base 2 2 protect_from_forgery with: :exception 3 helper_method :clear_session_candidate 3 helper_method :clear_session_candidate, :admin_can_not_do_this -
Ba Toi Dang @toidb commentedMaster@trunglx https://apidock.com/rails/ActionController/Helpers/ClassMethods/helper_method
-
Xuan Trung Le @trunglx commentedMaster
fixed
fixed -
Xuan Trung Le @trunglx
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3859&start_sha=255c61c481bdc5396a53e64bdfc31354e4b0b514#7dc0dd94f601e507e2a20bad6adcf12a51caa380_3_3)Toggle commit list
-
-
42 44 def application_params 43 45 params.require(:apply_job).permit(:name, :email, :cv) 44 46 end 47 48 def check_deadline -
Ba Toi Dang @toidb commentedMasterEdited by Ba Toi Dang
@trunglx please move checking expire date into job model.
expired?@trunglx please move checking expire date into job model. `expired?` -
Xuan Trung Le @trunglx
changed this line in version 16 of the diff
changed this line in version 16 of the diff
changed this line in [version 16 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3870&start_sha=9d7fa59dc4ce62abec5390aa31e34ace0569f4d7#d9c45092651a193b7c63a6a3b87ae6db5b912ec9_50_48)Toggle commit list
-
-
1 <% @applications.each do |application| %> -
Ba Toi Dang @toidb commentedMaster
-
Xuan Trung Le @trunglx commentedMaster
fixed.
fixed. -
Xuan Trung Le @trunglx
changed this line in version 12 of the diff
changed this line in version 12 of the diff
changed this line in [version 12 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3859&start_sha=255c61c481bdc5396a53e64bdfc31354e4b0b514#2e9f68ae74724cf70939e231ffec1672bf32a632_1_1)Toggle commit list
-
-
Xuan Trung Le @trunglx
added 1 commit
- 42cf21bf - fix bugs
added 1 commit * 42cf21bf - fix bugs [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3859&start_sha=255c61c481bdc5396a53e64bdfc31354e4b0b514)Toggle commit list -
Xuan Trung Le @trunglx
added 27 commits
added 27 commits
added 27 commits * 42cf21bf...b94adaf7 - 19 commits from branch `master` * 132d97c2 - fix bugs * a6a6bfc9 - fig bugs * cec1df1b - fix bugs * 065a5630 - fix bugs * 0520750e - download csv file * 4f6a51d3 - fix bugs: admin can apply or favorite job * fe7cebed - fix bugs: jobs can apply when out of date * fda07d77 - fix bugs [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3867&start_sha=42cf21bfe14bc0712e0115216fb130bc3b044d37)Toggle commit list -
Xuan Trung Le @trunglx
added 1 commit
- fdf3bc79 - fix datetime picker
added 1 commit * fdf3bc79 - fix datetime picker [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3868&start_sha=fda07d77f0cfa93c51728883da3990385f560481)Toggle commit list -
Xuan Trung Le @trunglx
added 17 commits
-
fdf3bc79...df28a349 - 8 commits from branch
master - 56235b4b - fix bugs
- ed04862b - fig bugs
- 52e1df0f - fix bugs
- 476e4257 - fix bugs
- f180cbe4 - download csv file
- 8aedb1db - fix bugs: admin can apply or favorite job
- f08ceac1 - fix bugs: jobs can apply when out of date
- 79e309a7 - fix bugs
- 9d7fa59d - fix datetime picker
added 17 commits
-
fdf3bc79...df28a349 - 8 commits from branch
master - 56235b4b - fix bugs
- ed04862b - fig bugs
- 52e1df0f - fix bugs
- 476e4257 - fix bugs
- f180cbe4 - download csv file
- 8aedb1db - fix bugs: admin can apply or favorite job
- f08ceac1 - fix bugs: jobs can apply when out of date
- 79e309a7 - fix bugs
- 9d7fa59d - fix datetime picker
added 17 commits * fdf3bc79...df28a349 - 8 commits from branch `master` * 56235b4b - fix bugs * ed04862b - fig bugs * 52e1df0f - fix bugs * 476e4257 - fix bugs * f180cbe4 - download csv file * 8aedb1db - fix bugs: admin can apply or favorite job * f08ceac1 - fix bugs: jobs can apply when out of date * 79e309a7 - fix bugs * 9d7fa59d - fix datetime picker [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3869&start_sha=fdf3bc794dcd7adf551ff405b9759b785df819a0)Toggle commit list -
fdf3bc79...df28a349 - 8 commits from branch
-
Xuan Trung Le @trunglx
added 1 commit
- 616cd333 - fix bugs
added 1 commit * 616cd333 - fix bugs [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3870&start_sha=9d7fa59dc4ce62abec5390aa31e34ace0569f4d7)Toggle commit list -
1 require 'rsolr' 2 require "csv" 3 require 'uri' 4 require './app/models/settings.rb' -
Ba Toi Dang @toidb commentedMaster
@trunglx does not need to require this because it was automatically loaded by rails.
@trunglx does not need to require this because it was automatically loaded by rails. -
Xuan Trung Le @trunglx
changed this line in version 17 of the diff
changed this line in version 17 of the diff
changed this line in [version 17 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3871&start_sha=616cd333a4cc7ec7e52db5c129e8ff4ef807a0a4#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_4_3)Toggle commit list
-
-
1 require 'rsolr' 2 require "csv" 3 require 'uri' -
Ba Toi Dang @toidb commentedMaster
-
Xuan Trung Le @trunglx
changed this line in version 17 of the diff
changed this line in version 17 of the diff
changed this line in [version 17 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3871&start_sha=616cd333a4cc7ec7e52db5c129e8ff4ef807a0a4#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_3_3)Toggle commit list
-
-
18 if params[:commit].eql? 'Down csv' 19 down_csv(@applications) 20 return 21 end 22 else 23 # get applications 24 @applications = ApplyJob.includes(:job, :user) 25 end 26 end 27 28 def down_csv(applications) 29 send_data ApplyJob.to_csv(applications), filename: "applications-#{Date.today}.csv" 30 end 31 32 def down_cv_candidate 33 user = User.find(params[:user_id]) -
Ba Toi Dang @toidb commentedMasterEdited by Ba Toi Dang
@trunglx please use indent 2 spaces for each block code.
@trunglx please use indent 2 spaces for each block code. -
Xuan Trung Le @trunglx
changed this line in version 17 of the diff
changed this line in version 17 of the diff
changed this line in [version 17 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3871&start_sha=616cd333a4cc7ec7e52db5c129e8ff4ef807a0a4#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_33_32)Toggle commit list
-
-
29 send_data ApplyJob.to_csv(applications), filename: "applications-#{Date.today}.csv" 30 end 31 32 def down_cv_candidate 33 user = User.find(params[:user_id]) 34 if user.cv.file.exists? 35 send_file user.cv.path 36 else 37 flash[:notice] = 'File not exist!' 38 redirect_back(fallback_location: root_path) 39 end 40 end 41 42 private 43 def connect 44 RSolr.connect url: Settings.rsolr.url -
Ba Toi Dang @toidb commentedMaster
@trunglx should be cache instance variable in here instead of:
@solr ||= connect=>@solr ||= RSolr.connect url: Settings.rsolr.url@trunglx should be cache instance variable in here instead of: `@solr ||= connect` => `@solr ||= RSolr.connect url: Settings.rsolr.url` -
Xuan Trung Le @trunglx
changed this line in version 17 of the diff
changed this line in version 17 of the diff
changed this line in [version 17 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3871&start_sha=616cd333a4cc7ec7e52db5c129e8ff4ef807a0a4#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_44_42)Toggle commit list
-
-
1 require 'rsolr' 2 require "csv" 3 require 'uri' 4 require './app/models/settings.rb' 5 1 6 class Admins::AppliesController < ApplicationController 7 before_action :authenticate_admin! 8 2 9 def index 10 if params[:commit] 11 # get condition here 12 condition = get_condition 13 # get applications from query 14 response = query(condition) 15 job_id = response["response"]["docs"].pluck("id") -
Ba Toi Dang @toidb commentedMaster
-
Xuan Trung Le @trunglx
changed this line in version 17 of the diff
changed this line in version 17 of the diff
changed this line in [version 17 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3871&start_sha=616cd333a4cc7ec7e52db5c129e8ff4ef807a0a4#cb0c14074a9cd3778fbd4d495c5e2fed71a19611_15_11)Toggle commit list
-
-
41 42 private 43 def connect 44 RSolr.connect url: Settings.rsolr.url 45 end 46 47 def query(condition) 48 # Direct connection 49 @solr ||= connect 50 # use get method to query 51 response = @solr.get 'select', params: condition 52 response 53 end 54 55 def get_condition 56 condition = {} -
Ba Toi Dang @toidb commentedMaster
-
-
11 11 has_many :view_jobs 12 12 has_many :users_has_viewed, through: :view_jobs, class_name: 'User', source: :user 13 13 14 scope :top_list, -> { order(updated_date: :desc).limit(Settings.top.job_per_page) } 14 scope :top_list, -> { order(updated_date: :desc).check_expiration_date.limit(Settings.top.job_per_page) } 15 scope :check_expiration_date, -> { where('NOW() >= expiry_date') } -
Ba Toi Dang @toidb commentedMaster
@trunglx please use
where("expiry_date <= ?", Time.current)@trunglx please use `where("expiry_date <= ?", Time.current)` -
Xuan Trung Le @trunglx
changed this line in version 17 of the diff
changed this line in version 17 of the diff
changed this line in [version 17 of the diff](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3871&start_sha=616cd333a4cc7ec7e52db5c129e8ff4ef807a0a4#742abd5cbc2b12d2da315862ace6297c7d6dcb87_15_15)Toggle commit list
-
-
Xuan Trung Le @trunglx
resolved all discussions
resolved all discussions
resolved all discussionsToggle commit list -
Xuan Trung Le @trunglx
added 1 commit
- 14fbc146 - paging with solr
added 1 commit * 14fbc146 - paging with solr [Compare with previous version](https://gitlab.zigexn.vn/trunglx/venjob/merge_requests/8/diffs?diff_id=3871&start_sha=616cd333a4cc7ec7e52db5c129e8ff4ef807a0a4)Toggle commit list -
Ba Toi Dang @toidb
mentioned in commit 15f96a1e
mentioned in commit 15f96a1e
mentioned in commit 15f96a1ec2a8528c0ef6b86f17b28368fced0851Toggle commit list -
Ba Toi Dang @toidb
merged
merged
mergedToggle commit list