docbrown/app/views/notifications/_article.html.erb
ludwiczakpawel a77dfefc2a
Homepage UI Improvements (#5890) [deploy]
* de-emphasizing right sidebar: mostly colors & spacing

* adding a bit more love to typography in sidebar

* changing language on LISTINGS widget header

* hiding profile widget from left sidebar

* cards shadow now looks like a bit less random and annoying

* actually doing the same with all shadows! YOLO

* some spacing cleanups around sidebars

* this time some typography love

* im committing but not really sure what exactly

* adding a bit more love to feed card

* looks like i broke some other views.. time to fix em all

* cleaning up typography a bit more

* .

* separating empty search results styling

* created a card styling mixing to reduce some code.. also moved cheese around a bit

* several more cleanups

* improving responsiveness

* i fixed what i broke

* more cleanups

* org badge

* .

* ...

* responsiveness

* .

* some adjustments

* bring back profile card

* tiny logo adjustment

* bunch of further refainments

* typography

* a bit more refainments

* whoops

* bringing back CTAs styling to loggedout sidebar

* fixes to left tags in left sidebar after merge

* buttons fix

* fixing border-color

* Update app/assets/stylesheets/articles.scss

Typo!

Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>

* .

* css cleanup + double border on article page

* removing unnecessary comments

* get rid of loading glitch

* static vs fixed header

* Update system specs

* Update client test snapshots

* Further modify homepage specs

Co-authored-by: Nick Taylor <nick@iamdeveloper.com>
Co-authored-by: Ben Halpern <bendhalpern@gmail.com>
2020-02-19 11:24:44 -05:00

59 lines
3 KiB
Text

<% if notification.action == "Reaction" %>
<%= render "reaction", notification: notification %>
<% elsif notification.action.include? "Milestone" %>
<%= render "milestone", notification: notification %>
<% else %>
<% json_data = notification.json_data %>
<% if json_data["organization"] %>
<div class="article-organization-headline">
<a class="org-headline-filler" href="<%= json_data["organization"]["path"] %>">
<img alt="<%= json_data["organization"]["name"] %> logo" src="<%= json_data["organization"]["profile_image_90"] %>">
<%= json_data["organization"]["name"] %>
</a>
</div>
<% end %>
<a href="<%= json_data["user"]["path"] %>" class="small-pic-link-wrapper">
<div class="small-pic">
<img src="<%= json_data["user"]["profile_image_90"] %>" alt="link to <%= json_data["user"]["username"] %>'s profile">
</div>
</a>
<div class="content notification-content article-content">
<a href="<%= json_data["user"]["path"] %>">
<%= json_data["user"]["name"] %>
</a>
made a new post<%= ":" unless json_data["organization"] %>
<% if json_data["organization"] %>
under <a href="<%= json_data["organization"]["path"] %>"><%= json_data["organization"]["name"] %></a>:
<% end %>
<div>
<small><%= time_ago_in_words json_data["article"]["published_at"] %> ago</small>
</div>
<a href="<%= json_data["article"]["path"] %>">
<div class="notification-new-post">
<div class="notification-new-post-title">
<%= h(json_data["article"]["title"]) %>
</div>
<div class="notification-new-post-tags">
<% json_data["article"]["cached_tag_list_array"].each do |tag| %>
#<%= tag %>
<% end %>
</div>
</div>
</a>
<% cache "activity-published-article-reactions-#{@last_user_reaction}-#{json_data['article']['updated_at']}-#{json_data['article']['id']}" do %>
<div class="comment-actions">
<button class="reaction-button <%= Reaction.cached_any_reactions_for?(notification.mocked_object("article"), current_user, "like") ? "reacted" : "" %>" data-reactable-id="<%= json_data["article"]["id"] %>" data-category="like" data-reactable-type="Article">
<%= image_tag("favorite-heart-outline-button.svg", alt: "Favorite heart outline button") %>
<img class="reacted-emoji" src="<%= asset_path("emoji/emoji-one-heart.png") %>" alt="Favorite heart button" />
</button>
<button class="reaction-button readinglist-button <%= Reaction.cached_any_reactions_for?(notification.mocked_object("article"), current_user, "readinglist") ? "reacted" : "" %>" data-reactable-id="<%= json_data["article"]["id"] %>" data-category="readinglist" data-reactable-type="Article">
<span class="reaction-button-text">SAVE</span>
<img class="reacted-emoji reaction-button-reacted-emoji" src="<%= asset_path("readinglist-button.png") %>" alt="Reading list button" />
</button>
</div>
<% end %>
</div>
<% end %>