Skip to content

Instantly share code, notes, and snippets.

@shankardevy
Last active August 16, 2017 18:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shankardevy/cf37318b2c20af906333dbd708c63757 to your computer and use it in GitHub Desktop.
Save shankardevy/cf37318b2c20af906333dbd708c63757 to your computer and use it in GitHub Desktop.
defmodule MangoWeb.LayoutView do
use MangoWeb, :view
import Mango.Web.CartView, only: [cart_count: 1]
def cart_link_text(conn) do
raw """
<i class="fa fa-shopping-cart"></i> <span class="cart-count">#{cart_count(conn)}</span>
"""
end
def get_active_locale_class(locale) do
if Gettext.get_locale(Mango.Web.Gettext) == locale, do: "active"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment