[openstreetmap/openstreetmap-website] Add support for rotating banners, add banners for SOTM, SOTMUS (#1240)

Tom Hughes notifications at github.com
Tue Jun 21 18:21:11 UTC 2016


> +  end
> +
> +  if val.to_i <= queuePos
> +    bannerSym = k
> +    cookieStr = c
> +    queuePos = val.to_i
> +  end
> +end
> +
> +unless bannerSym.nil?
> +  banner = active_banners[bannerSym]
> +  cookies[cookieStr.to_sym] = active_banners.length   # bump to end of queue
> +%>
> +<%= link_to (image_tag banner[:img], :alt => banner[:alt], :title => banner[:alt]), banner[:link] %>
> +<div class="close-wrap" id="<%= cookieStr %>"><span class="icon close"></span></div>
> +<% end %>

I really don't like having templates that are 95% ruby code like this... Can we move most of it into a helper or something? Maybe the actual list of banners should be a yml file in config or something?

---
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/1240/files/933335a0ea28f274bc7301c18611bcd90709fd99#r67923531
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20160621/49c6f14c/attachment.html>


More information about the rails-dev mailing list