Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
V
venjob
  • Overview
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Huỳnh Thiên Phước
  • venjob
  • Merge Requests
  • !13

Merged
Opened Sep 01, 2020 by Huỳnh Thiên Phước@phuocht 
  • Report abuse
Report abuse

Create Favorite, history job

×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b favorite_history origin/favorite_history

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff favorite_history

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 18
  • Commits 16
  • Pipelines 16
  • Changes 41
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Huỳnh Thiên Phước @phuocht

    added 13 commits

    • d91084a9...f95ce8a2 - 12 commits from branch master
    • a41d0f3d - Merge branch 'master' into 'favorite_history'

    Compare with previous version

    Sep 01, 2020

    added 13 commits

    • d91084a9...f95ce8a2 - 12 commits from branch master
    • a41d0f3d - Merge branch 'master' into 'favorite_history'

    Compare with previous version

    added 13 commits * d91084a9...f95ce8a2 - 12 commits from branch `master` * a41d0f3d - Merge branch 'master' into 'favorite_history' [Compare with previous version](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5177&start_sha=d91084a96ef3ba47df4fed058014164dc4ff38d0)
    Toggle commit list
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Sep 03, 2020
    Last updated by Huỳnh Thiên Phước Sep 03, 2020
    app/controllers/favorite_jobs_controller.rb 0 → 100644
    1 class FavoriteJobsController < ApplicationController
    2 before_action :sign_in_favorite_validation, only: %i[create destroy]
    3 before_action :sign_in_validation, only: [:index]
    • Van Hau Le @haulv commented Sep 03, 2020
      Master

      @phuocht sign_in_validation callback a thấy call nhiều chỗ ở nhiều controller, vậy gom nó ra 1 chỗ bên ApplicationController được ko em?

      @phuocht `sign_in_validation` callback a thấy call nhiều chỗ ở nhiều controller, vậy gom nó ra 1 chỗ bên ApplicationController được ko em?
    • Huỳnh Thiên Phước @phuocht

      changed this line in version 3 of the diff

      Sep 03, 2020

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5182&start_sha=a41d0f3d739db70aef0687ecf5f8470ba936fd34#fc6e73ffc64a55ffed3d5d7796eeb43f6827996e_3_2)
      Toggle commit list
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Sep 03, 2020
    Last updated by Huỳnh Thiên Phước Sep 07, 2020
    app/controllers/favorite_jobs_controller.rb 0 → 100644
    1 class FavoriteJobsController < ApplicationController
    2 before_action :sign_in_favorite_validation, only: %i[create destroy]
    3 before_action :sign_in_validation, only: [:index]
    4
    5 def index
    6 @count = current_user.favorite_jobs.count
    7 @favorited_jobs = current_user.favorite_jobs.order_favorite.page(params[:page]).per(Job::LIMIT_PAGE)
    • Van Hau Le @haulv commented Sep 03, 2020
      Master

      @phuocht validate params[:page] trước khi query nhé!

      Edited Sep 03, 2020 by Van Hau Le
      @phuocht validate params[:page] trước khi query nhé!
    • Huỳnh Thiên Phước @phuocht commented Sep 03, 2020
      Master

      dạ ok a

      dạ ok a
    • Huỳnh Thiên Phước @phuocht

      changed this line in version 6 of the diff

      Sep 07, 2020

      changed this line in version 6 of the diff

      changed this line in [version 6 of the diff](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5187&start_sha=188114498d68658d17fa3173c9e7c52117806d4d#fc6e73ffc64a55ffed3d5d7796eeb43f6827996e_9_10)
      Toggle commit list
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on the diff Sep 03, 2020
    Resolved by Van Hau Le Sep 04, 2020
    app/controllers/favorite_jobs_controller.rb 0 → 100644
    1 class FavoriteJobsController < ApplicationController
    2 before_action :sign_in_favorite_validation, only: %i[create destroy]
    3 before_action :sign_in_validation, only: [:index]
    4
    5 def index
    6 @count = current_user.favorite_jobs.count
    7 @favorited_jobs = current_user.favorite_jobs.order_favorite.page(params[:page]).per(Job::LIMIT_PAGE)
    8 end
    9
    10 def create
    11 @job = Job.find_by_id(params[:job_id])
    12 return if current_user.favorite_jobs.exists?(job_id: params[:job_id])
    • Van Hau Le @haulv commented Sep 03, 2020
      Master

      @phuocht đưa dòng này lên trên. Nếu đã favorite rồi thì ko cần phải query lấy @job nữa! Mà em lấy @job làm gì vậy?

      Edited Sep 03, 2020 by Van Hau Le
      @phuocht đưa dòng này lên trên. Nếu đã favorite rồi thì ko cần phải query lấy @job nữa! Mà em lấy @job làm gì vậy?
    • Huỳnh Thiên Phước @phuocht commented Sep 03, 2020
      Master

      oke a

      oke a
    • Van Hau Le @haulv commented Sep 03, 2020
      Master

      @phuocht có cần phải lấy @job ko?

      @phuocht có cần phải lấy @job ko?
    • Huỳnh Thiên Phước @phuocht commented Sep 03, 2020
      Master

      dạ có a ơi, phải lấy @job.id để render ra unfavorite or favorite button

      dạ có a ơi, phải lấy @job.id để render ra unfavorite or favorite button
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Sep 03, 2020
    Last updated by Huỳnh Thiên Phước Sep 03, 2020
    app/controllers/history_jobs_controller.rb 0 → 100644
    1 class HistoryJobsController < ApplicationController
    2 before_action :sign_in_favorite_validation, only: [:destroy]
    3 before_action :sign_in_validation, only: [:index]
    4
    5 def index
    6 @count = current_user.histories.count
    7 @history_jobs = current_user.histories.order_history
    8 end
    9
    10 private
    11
    12 def sign_in_favorite_validation
    • Van Hau Le @haulv commented Sep 03, 2020
      Master

      @phuocht 2 cái này a thấy nó dupl code, em xem gom thành 1 được ko? chỉ khác nhau mỗi giá trị return_to,

      @phuocht 2 cái này a thấy nó dupl code, em xem gom thành 1 được ko? chỉ khác nhau mỗi giá trị return_to,
    • Huỳnh Thiên Phước @phuocht commented Sep 03, 2020
      Master

      dạ a, để e thử gom

      dạ a, để e thử gom
    • Huỳnh Thiên Phước @phuocht

      changed this line in version 3 of the diff

      Sep 03, 2020

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5182&start_sha=a41d0f3d739db70aef0687ecf5f8470ba936fd34#91186b9cf439b81abbb56acbeafa2f9d95907ffd_12_11)
      Toggle commit list
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Sep 03, 2020
    Last updated by Huỳnh Thiên Phước Sep 03, 2020
    app/controllers/jobs_controller.rb
    30 30 session.delete(:apply_job)
    31 31 session.delete(:cv)
    32 32 return redirect_to jobs_path unless @job
    33 @user = JobApplied.where(user_id: current_user.id, job_id: params[:id]) if signed_in?
    33 if signed_in?
    34 @user = JobApplied.where(user_id: current_user.id, job_id: params[:id])
    • Van Hau Le @haulv commented Sep 03, 2020
      Master

      @phuocht sao biến @user lại đi lưu trữ giá trị của JobApplied vậy e?

      @phuocht sao biến @user lại đi lưu trữ giá trị của JobApplied vậy e?
    • Huỳnh Thiên Phước @phuocht commented Sep 03, 2020
      Master

      à cái đó e có nói ở PR apply_job đó a. Là nếu mà user đó apply job đó rồi thì Apply Now => Apllied a ơi

      à cái đó e có nói ở PR apply_job đó a. Là nếu mà user đó apply job đó rồi thì Apply Now => Apllied a ơi
    • Huỳnh Thiên Phước @phuocht

      changed this line in version 3 of the diff

      Sep 03, 2020

      changed this line in version 3 of the diff

      changed this line in [version 3 of the diff](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5182&start_sha=a41d0f3d739db70aef0687ecf5f8470ba936fd34#6fa69a07843a58f190bf4d7e0692b9cc5b0bf52b_34_33)
      Toggle commit list
    Please register or sign in to reply
  • Huỳnh Thiên Phước @phuocht

    added 1 commit

    • 6ccea578 - Change logic code and fix mentor's comments

    Compare with previous version

    Sep 03, 2020

    added 1 commit

    • 6ccea578 - Change logic code and fix mentor's comments

    Compare with previous version

    added 1 commit * 6ccea578 - Change logic code and fix mentor&#x27;s comments [Compare with previous version](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5182&start_sha=a41d0f3d739db70aef0687ecf5f8470ba936fd34)
    Toggle commit list
  • Huỳnh Thiên Phước @phuocht

    added 13 commits

    • 6ccea578...f95ce8a2 - 12 commits from branch master
    • a8e21f8c - Merge branch 'master' into 'favorite_history'

    Compare with previous version

    Sep 03, 2020

    added 13 commits

    • 6ccea578...f95ce8a2 - 12 commits from branch master
    • a8e21f8c - Merge branch 'master' into 'favorite_history'

    Compare with previous version

    added 13 commits * 6ccea578...f95ce8a2 - 12 commits from branch `master` * a8e21f8c - Merge branch &#x27;master&#x27; into &#x27;favorite_history&#x27; [Compare with previous version](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5183&start_sha=6ccea578b9918cbcb62eb23ee1d479f626647b82)
    Toggle commit list
  • Van Hau Le
    @haulv started a discussion on the diff Sep 04, 2020
    Last updated by Huỳnh Thiên Phước Sep 04, 2020
    app/models/user.rb
    20 20 PASSWORD_FORMAT = /\A(?=.{8,})(?=.*\d)(?=.*[a-z])(?=.*[A-Z])/x
    21 21 validates :password, format: { with: PASSWORD_FORMAT, message: "is too short or not strength" }
    22 22
    23 def favoriting?(job_id)
    • Van Hau Le @haulv commented Sep 04, 2020
      Master

      @phuocht này để làm gì vậy em?

      @phuocht này để làm gì vậy em?
    • Huỳnh Thiên Phước @phuocht commented Sep 04, 2020
      Master

      dạ để khi mà login mà user đó favorite rồi thì hiện lên Unfavorite a ơi

      dạ để khi mà login mà user đó favorite rồi thì hiện lên Unfavorite a ơi
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Sep 04, 2020
    Last updated by Huỳnh Thiên Phước Sep 04, 2020
    app/controllers/favorite_jobs_controller.rb 0 → 100644
    23
    24 count_on_page = @count % Job::LIMIT_PAGE
    25 page_number = @count / Job::LIMIT_PAGE
    26 link_url = request.referer.to_s.split("=")
    27
    28 return redirect_to link_url[0] + "=" + page_number.to_s if count_on_page == Job::DIVISIBLE && link_url[1].to_i == page_number + 1
    29
    30 return redirect_to request.referer if count_on_page == Job::DIVISIBLE
    31 end
    32
    33 respond_to { |format| format.js }
    34 end
    35
    36 private
    37
    38 def sign_in_validation
    • Van Hau Le @haulv commented Sep 04, 2020
      Master

      @phuocht này cũng chưa move vào application controller hả em

      @phuocht này cũng chưa move vào application controller hả em
    • Huỳnh Thiên Phước @phuocht commented Sep 04, 2020
      Master

      dạ chưa à còn cái đó hwa e quên mất

      dạ chưa à còn cái đó hwa e quên mất
    • Huỳnh Thiên Phước @phuocht

      changed this line in version 5 of the diff

      Sep 04, 2020

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5184&start_sha=a8e21f8c02a23b872886d9d4ea3f2c9706f012c8#fc6e73ffc64a55ffed3d5d7796eeb43f6827996e_38_35)
      Toggle commit list
    Please register or sign in to reply
  • Van Hau Le
    @haulv started a discussion on an old version of the diff Sep 04, 2020
    Last updated by Huỳnh Thiên Phước Sep 04, 2020
    app/controllers/history_jobs_controller.rb 0 → 100644
    1 class HistoryJobsController < ApplicationController
    2 before_action :sign_in_validation, only: [:index]
    3
    4 def index
    5 @count = current_user.histories.count
    6 @history_jobs = current_user.histories.order_history
    7 end
    8
    9 private
    10
    11 def sign_in_validation
    • Van Hau Le @haulv commented Sep 04, 2020
      Master

      @phuocht này cũng vậy

      @phuocht này cũng vậy
    • Huỳnh Thiên Phước @phuocht

      changed this line in version 5 of the diff

      Sep 04, 2020

      changed this line in version 5 of the diff

      changed this line in [version 5 of the diff](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5184&start_sha=a8e21f8c02a23b872886d9d4ea3f2c9706f012c8#91186b9cf439b81abbb56acbeafa2f9d95907ffd_11_8)
      Toggle commit list
    Please register or sign in to reply
  • Huỳnh Thiên Phước @phuocht

    added 1 commit

    • 18811449 - move sign in validation to application controller

    Compare with previous version

    Sep 04, 2020

    added 1 commit

    • 18811449 - move sign in validation to application controller

    Compare with previous version

    added 1 commit * 18811449 - move sign in validation to application controller [Compare with previous version](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5184&start_sha=a8e21f8c02a23b872886d9d4ea3f2c9706f012c8)
    Toggle commit list
  • Huỳnh Thiên Phước @phuocht

    added 1 commit

    • 44262ce9 - fix mentor's comments

    Compare with previous version

    Sep 07, 2020

    added 1 commit

    • 44262ce9 - fix mentor's comments

    Compare with previous version

    added 1 commit * 44262ce9 - fix mentor&#x27;s comments [Compare with previous version](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5187&start_sha=188114498d68658d17fa3173c9e7c52117806d4d)
    Toggle commit list
  • Huỳnh Thiên Phước @phuocht

    added 1 commit

    • eb40e470 - fix logic favorite job

    Compare with previous version

    Sep 08, 2020

    added 1 commit

    • eb40e470 - fix logic favorite job

    Compare with previous version

    added 1 commit * eb40e470 - fix logic favorite job [Compare with previous version](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5190&start_sha=44262ce914b928d93599c19b1bca55289df09164)
    Toggle commit list
  • Huỳnh Thiên Phước @phuocht

    added 13 commits

    • eb40e470...f95ce8a2 - 12 commits from branch master
    • 81c677f6 - merge master

    Compare with previous version

    Sep 09, 2020

    added 13 commits

    • eb40e470...f95ce8a2 - 12 commits from branch master
    • 81c677f6 - merge master

    Compare with previous version

    added 13 commits * eb40e470...f95ce8a2 - 12 commits from branch `master` * 81c677f6 - merge master [Compare with previous version](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5193&start_sha=eb40e47059830177d2984f0b88feb08e07cb7096)
    Toggle commit list
  • Huỳnh Thiên Phước @phuocht

    added 1 commit

    • 1067ec88 - Fix render error

    Compare with previous version

    Sep 09, 2020

    added 1 commit

    • 1067ec88 - Fix render error

    Compare with previous version

    added 1 commit * 1067ec88 - Fix render error [Compare with previous version](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5194&start_sha=81c677f616d1108262e60276a96d49a42e93a5b3)
    Toggle commit list
  • Van Hau Le
    @haulv started a discussion on the diff Sep 11, 2020
    Last updated by Huỳnh Thiên Phước Sep 11, 2020
    app/views/history_jobs/_history_job.html.erb 0 → 100644
    4 <div class="radio-btn col-1">
    5 <%= radio_button_tag :job_id, history_job.job.id %>
    6 </div>
    7 <div class="job-details col-10">
    8 <div class="title">
    9 <%= link_to job_detail_path(history_job.job.id) do %><strong>
    10 <%= history_job.job.title %></strong>
    11 <% end %>
    12 </div>
    13 <div class="row">
    14 <div class="introduction col-12">
    15 <%= strip_tags(history_job.job.format_desc) %><br>
    16 <%= link_to 'Read more..', job_detail_path(history_job.job.id) %>
    17 </div>
    18 <div class="col-6">▼
    19 <%= history_job.job.cities.map(&:name).join(' | ') %>
    • Van Hau Le @haulv commented Sep 11, 2020
      Master

      @phuocht chỗ này lại dính n+1 rồi, đã fix bên favorite sao ko fix bên này luôn em

      @phuocht chỗ này lại dính n+1 rồi, đã fix bên favorite sao ko fix bên này luôn em
    • Huỳnh Thiên Phước @phuocht commented Sep 11, 2020
      Master

      dạ ok a để e fix lun

      dạ ok a để e fix lun
    Please register or sign in to reply
  • Huỳnh Thiên Phước @phuocht

    added 1 commit

    • 87c62095 - Fix N+1 query

    Compare with previous version

    Sep 11, 2020

    added 1 commit

    • 87c62095 - Fix N+1 query

    Compare with previous version

    added 1 commit * 87c62095 - Fix N+1 query [Compare with previous version](https://gitlab.zigexn.vn/phuocht/venjob/merge_requests/13/diffs?diff_id=5204&start_sha=1067ec88afd3bda31132a056d2400e461b321d8b)
    Toggle commit list
  • Van Hau Le @haulv

    mentioned in commit 3885ed4c

    Sep 11, 2020

    mentioned in commit 3885ed4c

    mentioned in commit 3885ed4c21bbc08ff955ad5414bc7112a7c337e1
    Toggle commit list
  • Van Hau Le @haulv

    merged

    Sep 11, 2020

    merged

    merged
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
2
2 participants
Reference: phuocht/venjob!13
×

Revert this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.
×

Cherry-pick this merge request

Switch branch
Cancel
A new branch will be created in your fork and a new merge request will be started.