Coherence v0.1.3 Coherence.ViewHelpers

Helper functions for Coherence Views.

Summary

Functions

coherence_links(conn, which, opts \\ [])

Create coherence template links.

Generates links if the appropriate option is installed.

Examples

coherence_links(conn, :new_session)
Generates: Forgot your password?  Send an unlock email Need An Account?

coherence_links(conn, :new_session, recover: "Password reset", register: false
Generates: Password reset  Send an unlock email

coherence_links(conn, :layout)             # when logged in
Generates: User's Name  Sign Out

coherence_links(conn, :layout)             # when not logged in
Generates: Need An Account?  Sign In
coherence_path(module, route_name, conn, action)

Helper to avoid compile warnings when options are disabled.

coherence_path(module, route_name, conn, action, opts)
invitation_link(conn, text \\ "Invite Someone")
recover_link(conn, text \\ "Forgot your password?")
recover_link(conn, user_schema, text)
register_link(conn, text \\ "Need An Account?")
register_link(conn, user_schema, text)
required_label(f, name, opts \\ [])
unlock_link(conn, text \\ "Send an unlock email")
unlock_link(conn, user_schema, text)