-
Notifications
You must be signed in to change notification settings - Fork 211
Expand file tree
/
Copy pathshow.html.haml
More file actions
151 lines (137 loc) · 5.97 KB
/
show.html.haml
File metadata and controls
151 lines (137 loc) · 5.97 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
- content_for :title, @member.login_name
- content_for :opengraph do
= tag("meta", property: "og:image", content: avatar_uri(@member, 200))
= tag("meta", property: "og:image:user_generated", content: "true")
= tag("meta", property: "og:title", content: @member.login_name)
= tag("meta", property: "og:type", content: "profile")
= tag("meta", property: "og:url", content: request.original_url)
= tag("meta", property: "og:site_name", content: ENV['GROWSTUFF_SITE_NAME'])
- content_for :member_rss_login_name, @member.login_name
- content_for :member_rss_slug, @member.slug
- content_for :breadcrumbs do
%li.breadcrumb-item= link_to 'Members', members_path
%li.breadcrumb-item.active= link_to @member.login_name, member_path(@member)
.row
.col-md-2
.card
.card-body
.row
.col= render "bio", member: @member
.col= render "avatar", member: @member
.row
.col
%p
%small
%a{href: "#content"}
Skip to main content
- if @member.bio.blank?
- if member_signed_in? && current_member == @member
= link_to "Add a bio to complete your profile.", edit_member_registration_path
- else
#{@member.login_name} hasn't written a bio yet.
- else
:markdown
#{ strip_tags markdownify(@member.bio) }
- if @member.roles.any?
%p
- @member.roles.each do |role|
%span.badge.badge-info= role.name.titleize
- if @member.location.present?
%p.badge.badge-location{ title: @member.location }
= icon 'fas', 'map-marker'
= truncate(@member.location, length: 15, separator: ' ', omission: '... ')
%p
%small
%strong Member since
%br
= @member.created_at.to_fs(:date)
- if @member.last_sign_in_at
%p
%small
%strong Last Login
%br
= @member.last_sign_in_at&.to_fs(:default)
- if can? :update, @member
= link_to edit_member_registration_path, class: 'btn btn-block' do
= member_icon
= t('members.edit_profile')
- if can?(:create, Notification) && current_member != @member
= link_to new_message_path(recipient_id: @member.id), class: 'btn btn-block' do
= icon('fas', 'envelope')
Send message
= render 'members/follow_buttons', member: @member
= render "notifications", member: @member if can?(:update, @member)
- if can?(:destroy, @member)
%hr/
= link_to admin_member_path(slug: @member.slug), method: :delete, data: { confirm: 'Are you sure?' }, class: 'btn btn-block btn-light text-danger' do
= icon 'fas', 'ban'
Ban member
%hr/
= render "stats", member: @member
.card-footer
= render "contact", member: @member, flickr_auth: @flickr_auth
.col-md-10#content
.row
%section.order-3.order-md-1.col-12= render "map", member: @member
- if @harvesting.size.positive?
%section.harvests.order-2.order-md-1.col-12
%h2 Ready to harvest
.index-cards
- @harvesting.each do |planting|
= render 'plantings/thumbnail', planting: planting
- if @others.size.positive?
%section.planting-progress.order-2.order-md-1.col-12
%h2 Progress report
%p Still growing and not ready for harvesting.
.list-group
- @others.each do |planting|
.list-group-item
%span= render 'plantings/tiny', planting: planting
%span= render 'plantings/progress', planting: planting
- if @late.size.positive?
%section.late.order-2.order-md-1.col-12
%h2 Late
%p
These plantings are at the end of their lifecycle.
- if member_signed_in? && @member == current_member
%strong When you have removed the planting from your garden, mark the planting as finished in Growstuff.
.index-cards
- @late.each do |planting|
= render 'plantings/thumbnail', planting: planting
- if @super_late.any?
%section.superlate.order-2.order-md-1.col-12
%h2 Super late
%p
We suspect the following plantings finished long ago and no longer need tracking.
- if member_signed_in? && current_member == @member
%strong You can mark these plantings as finished to stop tracking.
%ul
- @super_late.each do |planting|
%li
= link_to planting.crop_name, planting_url(slug: planting.slug)
planted on #{planting.planted_at.to_date}
- if @harvests.any?
%section.havests.order-2.order-md-1.col-12
%h2 Recent Harvests
.index-cards
- @harvests.each do |harvest|
= render 'harvests/thumbnail', harvest: harvest
- if @activity.any?
%section.activity.order-2.order-md-1.col-12
%h2 Activity
.list-group
- @activity.each do |event|
.list-group-item.list-group-item-action.flex-column.align-items-start{:href => "#!"}
.d-flex.w-100.justify-content-between
%h5.col-md-11.col-xs-10.text-truncate
= icon_for_model(event.event_type)
= event_description(event)
= render 'timeline/photos', photo: resolve_model(event) if event.event_type == 'photo'
%small.col-md-1.col-xs-2.text-right
- if event.event_at.present?
- if event.event_at.kind_of?(Date)
#{distance_of_time_in_words(event.event_at, Time.zone.now.to_date)} ago
- else
#{time_ago_in_words(event.event_at)} ago
- else
unknown date