Better presentation of member expiration.

This commit is contained in:
Adam Niedzielski 2016-08-05 07:28:39 +02:00
parent 671d247eaa
commit 895c3c55dc
2 changed files with 7 additions and 2 deletions

View file

@ -42,4 +42,8 @@ module MembersHelper
"Are you sure you want to leave the " \
"\"#{member_source.human_name}\" #{member_source.class.to_s.humanize(capitalize: false)}?"
end
def member_expires_soon?(member)
member.expires_at < 7.days.from_now
end
end

View file

@ -60,8 +60,9 @@
- else
Joined #{time_ago_with_tooltip(member.created_at)}
- if member.expires?
%span.prepend-left-20
Access expires #{member.expires_at.to_s(:medium)}
·
%span{ class: ("text-warning" if member_expires_soon?(member)) }
Expires in #{distance_of_time_in_words_to_now(member.expires_at)}
- else
= image_tag avatar_icon(member.invite_email, 40), class: "avatar s40", alt: ''