Skip to content
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

Added notifications #161

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

rheaSPK
Copy link
Collaborator

@rheaSPK rheaSPK commented Jan 29, 2021

image

Closes #128

@rheaSPK rheaSPK changed the title Added notifications WIP: Added notifications Jan 29, 2021
@rheaSPK rheaSPK changed the title WIP: Added notifications Added notifications Feb 5, 2021
<% if user_signed_in? %>
<form class="form-inline">
<% if current_user.contact_requests.any? %>
<a href="<%= user_contact_requests_path(current_user) %>"> <i class="fa fa-bell" style="color: red; padding: 3px"></i> </a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would extract all styles into an appropriate css file

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't like to do that, because if someone else uses the bell icon, they don't necessarily want my styling...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but you could use a class like notification-bell or something like that. I just don't like to have HTML, CSS and application logic all in one file 😅 But if you prefer the inline styling that's fine for me because it's not such a big issue 👍

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @felixauringer. If someone doesn't like the styling, the class can be changed even easier

app/views/layouts/_navbar.html.erb Outdated Show resolved Hide resolved
app/views/layouts/_navbar.html.erb Outdated Show resolved Hide resolved
app/views/layouts/_navbar.html.erb Outdated Show resolved Hide resolved
Copy link
Contributor

@felixauringer felixauringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thought was to have descriptive methods in the model. We want to check whether the user has notifications, so I would name the method notifications?. This also makes it easier to change the defintion of a notification without touching the view again

@@ -60,6 +60,14 @@ def init
self.username ||= email.split('@', 2)[0]
end

def has_contact_request?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def has_contact_request?
def notifications?

contact_requests.any?
end

def count_contact_requests
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def count_contact_requests
def notification_count

Co-authored-by: Felix Auringer <[email protected]>
@frcroth frcroth linked an issue Feb 8, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bell button in top-bar doesnt work [Process Part] Notifications for Contacts Invitation
3 participants