Class: Cyclid::UI::Views::Layout
- Inherits:
-
Mustache
- Object
- Mustache
- Cyclid::UI::Views::Layout
- Defined in:
- app/cyclid_ui/views/layout.rb
Overview
Main Layout view; everything common to the Views which use Layouts can be found here
Direct Known Subclasses
Instance Attribute Summary collapse
-
#api_url ⇒ Object
readonly
Returns the value of attribute api_url.
-
#linkback_url ⇒ Object
readonly
Returns the value of attribute linkback_url.
-
#organization ⇒ Object
readonly
Returns the value of attribute organization.
Instance Method Summary collapse
-
#breadcrumbs ⇒ Object
Return an array of elements to be inserted into the breadcrumb.
-
#gravatar_url ⇒ Object
Calculate the base Gravatar URL for the user.
- #organizations ⇒ Object
- #title ⇒ Object
- #username ⇒ Object
Instance Attribute Details
#api_url ⇒ Object (readonly)
Returns the value of attribute api_url.
24 25 26 |
# File 'app/cyclid_ui/views/layout.rb', line 24 def api_url @api_url end |
#linkback_url ⇒ Object (readonly)
Returns the value of attribute linkback_url.
24 25 26 |
# File 'app/cyclid_ui/views/layout.rb', line 24 def linkback_url @linkback_url end |
#organization ⇒ Object (readonly)
Returns the value of attribute organization.
24 25 26 |
# File 'app/cyclid_ui/views/layout.rb', line 24 def organization @organization end |
Instance Method Details
#breadcrumbs ⇒ Object
Return an array of elements to be inserted into the breadcrumb
39 40 41 |
# File 'app/cyclid_ui/views/layout.rb', line 39 def @crumbs.to_json end |
#gravatar_url ⇒ Object
Calculate the base Gravatar URL for the user
44 45 46 47 48 |
# File 'app/cyclid_ui/views/layout.rb', line 44 def gravatar_url email = @current_user.email.downcase.strip hash = Digest::MD5.hexdigest(email) "https://www.gravatar.com/avatar/#{hash}?d=identicon&r=g" end |
#organizations ⇒ Object
30 31 32 |
# File 'app/cyclid_ui/views/layout.rb', line 30 def organizations @current_user.organizations end |
#title ⇒ Object
34 35 36 |
# File 'app/cyclid_ui/views/layout.rb', line 34 def title @title || 'Cyclid' end |
#username ⇒ Object
26 27 28 |
# File 'app/cyclid_ui/views/layout.rb', line 26 def username @current_user.username || 'Nobody' end |