[openstreetmap/openstreetmap-website] add icon for OSMF membership to user page (#1914)
Andy Allan
notifications at github.com
Sat Feb 23 10:33:43 UTC 2019
gravitystorm commented on this pull request.
> +module UserMembershipHelper
+ def membership_icons(user)
+ UserMembership::ALL_MEMBERSHIPS.reduce("".html_safe) do |acc, elem|
+ acc + " " + membership_icon(user, elem)
+ end
+ end
+
+ def membership_icon(user, membership)
+ if user.show_membership?(membership)
+ image = "membership/#{membership}"
+ alt = t("user.view.membership.#{membership}")
+ title = t("user.view.membership.#{membership}")
+ id = "badge-membership-#{membership}"
+ end
+
+ if image
Oh, I see now this is done this way to match the user_roles_helper logic, which is quite similar.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/1914#discussion_r259574679
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20190223/90a23534/attachment.html>
More information about the rails-dev
mailing list