Class: Cyclid::UI::Views::Layout

Inherits:
Mustache
  • Object
show all
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

Job, Organization, User

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_urlObject (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_urlObject (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

#organizationObject (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

Return an array of elements to be inserted into the breadcrumb



39
40
41
# File 'app/cyclid_ui/views/layout.rb', line 39

def breadcrumbs
  @crumbs.to_json
end

#gravatar_urlObject

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

#organizationsObject



30
31
32
# File 'app/cyclid_ui/views/layout.rb', line 30

def organizations
  @current_user.organizations
end

#titleObject



34
35
36
# File 'app/cyclid_ui/views/layout.rb', line 34

def title
  @title || 'Cyclid'
end

#usernameObject



26
27
28
# File 'app/cyclid_ui/views/layout.rb', line 26

def username
  @current_user.username || 'Nobody'
end