-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
notification #607
Merged
Merged
notification #607
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# frozen_string_literal: true | ||
|
||
class Career::MemberMutator | ||
def self.create(career, params) | ||
career_member = career.members.build(params) | ||
user = career_member.user | ||
if career_member.save | ||
user.notifications.create!(kind: :new_career_member, resource: career_member) | ||
end | ||
|
||
career_member | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# frozen_string_literal: true | ||
|
||
class NotificationPolicy < ApplicationPolicy | ||
def update? | ||
author? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
- content_for :header do | ||
= t('.header') | ||
|
||
- @notifications.each do |notification| | ||
.d-flex | ||
i.mt-1.me-2.far class=class_for_notification(notification) | ||
p.me-3 == message_for_notification(notification) | ||
.text-muted.text-nowrap.ms-auto = l notification.created_at, format: :short | ||
table.table | ||
thead | ||
tr | ||
th = t('.content') | ||
th = han('notification', 'state') | ||
th = sort_link(@q, 'created_at') | ||
th = t('actions') | ||
tbody | ||
- @notifications.each do |notification| | ||
tr | ||
td == message_for_notification(notification) | ||
td = notification.aasm(:state).human_state | ||
td = l notification.created_at, format: :short | ||
td | ||
- if notification.may_mark_as_read? | ||
= link_to account_notification_path(notification), method: :patch, class: 'btn btn-outline-primary btn-sm me-1', title: t('.mark_as_read') do | ||
span.bi.bi-bookmark-check | ||
- else | ||
span.h4.bi.bi-check-circle-fill.text-success[aria-label="#{t('.notification_read')}"] | ||
|
||
= paginate @notifications | ||
|
||
- if @notifications.empty? | ||
= render partial: 'web/shared/empty_list' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
en: | ||
notifications: | ||
new_answer_html: User <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> left <a href="%{answer_path}" class="fw-bolder">new recommendation</a> to your resume | ||
new_comment_html: User <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> left <a href="%{comment_path}" class="fw-bolder">new comment</a> to your resume | ||
new_answer_comment_html: User <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> left <a href="%{answer_comment_path}" class="fw-bolder">new comment</a> to your recommendation | ||
new_answer_like_html: User <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> likes your <a href="%{answer_path}" class="fw-bolder"> recommendation</a> | ||
answer_applied_html: User <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> improved his resume using your <a href="%{answer_path}" class="fw-bolder ">recommendation</a> | ||
new_career_member_html: Hooray! You have been assigned a career track <a href="%{career_path}" class="fw-bolder">%{career}</a>. Get started and get ready for a job. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
ru: | ||
notifications: | ||
new_answer_html: Пользователь <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> оставил <a href="%{answer_path}">новую рекомендацию</a> к вашему резюме | ||
new_comment_html: Пользователь <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> оставил <a href="%{comment_path}">новый комментарий</a> к вашему резюме | ||
new_answer_comment_html: Пользователь <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> оставил <a href="%{answer_comment_path}">новый комментарий</a> к вашей рекомендации | ||
new_answer_like_html: Пользователю <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> нравится ваша <a href="%{answer_path}">рекомендация</a> | ||
answer_applied_html: Пользователь <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> улучшил резюме используя вашу <a href="%{answer_path}">рекомендацию</a> | ||
new_answer_html: Пользователь <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> оставил <a href="%{answer_path}" class="fw-bolder">новую рекомендацию</a> к вашему резюме | ||
new_comment_html: Пользователь <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> оставил <a href="%{comment_path}" class="fw-bolder">новый комментарий</a> к вашему резюме | ||
new_answer_comment_html: Пользователь <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> оставил <a href="%{answer_comment_path}" class="fw-bolder">новый комментарий</a> к вашей рекомендации | ||
new_answer_like_html: Пользователю <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> нравится ваша <a href="%{answer_path}" class="fw-bolder">рекомендация</a> | ||
answer_applied_html: Пользователь <a href="%{user_path}" class="text-secondary fw-bolder">%{user}</a> улучшил резюме используя вашу <a href="%{answer_path}" class="fw-bolder">рекомендацию</a> | ||
new_career_member_html: Ура! Вам назначен карьерный трек <a href="%{career_path}" class="fw-bolder">%{career}</a>. Приступайте к прохождению и готовьтесь к трудоустройству. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
ru: | ||
actions: Действия | ||
career: Карьерный трек | ||
steps: Шаг карьерного трека | ||
months_nominative_case: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а это как связано с уведомлениями?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Уведомление с kind: new_career_member создается когда создается новый career_member то есть назначается карерный трек