/
_list.html.haml
54 lines (48 loc) · 2.47 KB
/
_list.html.haml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
- unless defined?(id)
- id = (request.path_info.gsub("/", "_")[1..-1])
#messages
%ul.updates{:class => "#{list_class}#{(controller.controller_name == "updates" ? " has-update-form" : "")}", :id => id}
- updates.each do |update|
- unless defined?(no_highlight) and no_highlight
- mine = current_user.nil? ? false : (update.author.user == current_user)
- mentioned = current_user.nil? ? false : update.mentioned?(current_user.username)
%li.update.hentry.message{:class => (mentioned ? "mention " : "") + (mine ? "mine " : ""), :id => "update-#{update.id}", "data-id" => update.id, "data-name" => update.author ? update.author.fully_qualified_name : ""}
- if update.author
.author.vcard
%a.url{:href => update.author.url, :rel => "user"}
= AuthorDecorator.decorate(update.author).avatar
%span.fn
%a.url{:href => update.author.url}
= update.author.display_name
(<span class="nickname user-text">#{update.author.username}</span>)
.entry-content
%span.message-text
!= update.to_html
.info
= TimeDecorator.decorate(update).permalink
- if !update.referral.nil?
%span.in-reply
%a{:href => "/updates/#{update.referral.id}"}
in reply to
- if update.referral.author
%span.name= update.referral.author.username
- else
an update
- elsif !update.referral_url.nil?
%span.in-reply
%a{:href => update.referral_url}
in reply to
.actions
-# when @timeline is true, this is a list on the user's page
-unless current_user.nil? or (current_user.author.id == update.author.id)
%a.share{:href => (controller.controller_name == "updates" ? "" : "/") + "?share=#{update.id}"} share
|
%a.reply{:href => (controller.controller_name == "updates" ? "" : "/") + "?reply=#{update.id}"} reply
- if current_user and update.author.id == current_user.author.id
= form_tag "/updates/#{update.id}" do
%input{:type => "hidden", :name => "_method", :value => "delete"}
= submit_tag "I Regret This", :class => "remove-update", :confirm => t(:remove_update, :scope => :confirms)
!= render :partial => "shared/pagination"
- if updates.empty?
.empty
#{defined?(tagline) ? tagline : "There are no updates here yet" }