Skip to content

Commit

Permalink
complete notification list view
Browse files Browse the repository at this point in the history
  • Loading branch information
jinhucheung committed Dec 20, 2016
1 parent f8767d2 commit 742da40
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 25 deletions.
2 changes: 1 addition & 1 deletion app/helpers/users/avatar_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def avatar_tag(user, size = :md, opts = {})
content_tag :div, letter, class: img_class, style: "background: #{user.avatar_color};"
end
if opts[:link]
link_to raw(img), main_app.user_path(user.username)
link_to raw(img), main_app.user_path(user.username), title: user.username
else
raw img
end
Expand Down
2 changes: 2 additions & 0 deletions app/views/accounts/edit.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<% provide :pre_title, t("account_profile") %>
<% provide :hidden_nav_center_items, true %>

<div class="mainer" style="margin-top: 0; padding-top: 20px;">
<div class="container-fluid">
<div class="col-md-10 col-lg-10 col-center-block content-wrap">
Expand Down
4 changes: 2 additions & 2 deletions app/views/notifications/_article.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<% article = notification.target %>
<%= article.title %>
<%= article.content %>
<%= t "article.post" %>&nbsp;
<%= link_to article.title, main_app.article_path(article.id), class: 'under-line' %>
15 changes: 6 additions & 9 deletions app/views/notifications/_comment.html.erb
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
<% comment = notification.target %>
<%= content_tag :div, class: 'comment' do -%>
<%= link_to comment.article.title, main_app.article_path(comment.article.id), class: 'post-title' %>
<span class="comment-meta pull-right">
<%= timeago_tag comment.created_at, class: 'comment-time' %>
</span>
<div class="comment-content">
<div class="standard markdown-body">
<%= markdown_comment_tag comment %>
</div>
<%= content_tag :div do -%>
<%= t "notifications.in_article" %>&nbsp;
<%= link_to comment.article.title, main_app.article_path(comment.article.id), class: 'under-line' %>&nbsp;
<%= t "notifications.post_comment" %>
<div class="standard markdown-body">
<%= markdown_comment_tag comment %>
</div>
<% end -%>
16 changes: 6 additions & 10 deletions app/views/notifications/_mention.html.erb
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<% comment = notification.target %>
"我是艾特"
<%= content_tag :div, class: 'comment' do -%>
<%= link_to comment.article.title, main_app.article_path(comment.article.id), class: 'post-title' %>
<span class="comment-meta pull-right">
<%= timeago_tag comment.created_at, class: 'comment-time' %>
</span>
<div class="comment-content">
<div class="standard markdown-body">
<%= markdown_comment_tag comment %>
</div>
<%= content_tag :div do -%>
<%= t "notifications.in_article" %>&nbsp;
<%= link_to comment.article.title, main_app.article_path(comment.article.id), class: 'under-line' %>&nbsp;
<%= t "notifications.mention_me" %>
<div class="standard markdown-body">
<%= markdown_comment_tag comment %>
</div>
<% end -%>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="media-body">
<%= render partial: "/notifications/#{notification.notify_type}", locals: { notification: notification } %>
</div>
<div class="media-right">
<div class="media-right" style="min-width: 30px;">
<div class="pull-right">
<%= mtime_tag notification.created_at, strf: "%H:%M" %>
</div>
Expand Down
7 changes: 6 additions & 1 deletion config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,9 @@ en:
tab:
articles: Article
comments: Comment
bio: Bio
bio: Bio

notifications:
in_article: In the Article
post_comment: 'Post comment:'
mention_me: 'Mention me:'
7 changes: 6 additions & 1 deletion config/locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -442,4 +442,9 @@ zh-CN:
tab:
articles: 文章
comments: 评论
bio: 个人简介
bio: 个人简介

notifications:
in_article: 在文章
post_comment: 评论了:
mention_me: 提及我:

0 comments on commit 742da40

Please sign in to comment.