Module: Contour
- Defined in:
- lib/contour.rb,
lib/contour/fixes.rb,
lib/contour/engine.rb,
lib/contour/version.rb
Defined Under Namespace
Modules: Fixes, VERSION
Classes: AuthenticationsController, ConfirmationsController, Engine, InstallGenerator, PasswordsController, RegistrationsController, SamplesController, ScaffoldGenerator, SessionsController, UnlocksController
Constant Summary
collapse
- @@application_name =
'Application Name'
- @@application_name_html =
nil
- @@application_version =
nil
'rails.png'
nil
[
{
name: 'Login', display: 'not_signed_in', path: 'new_user_session_path', position: 'right', condition: 'true',
links: [{ name: 'Sign Up', path: 'new_user_registration_path' },
{ divider: true },
{ authentications: true }]
},
{
name: 'current_user.email', eval: true, display: 'signed_in', position: 'right', condition: 'true',
links: [{ name: 'Authentications', path: 'authentications_path', condition: 'not PROVIDERS.blank?' },
{ divider: true },
{ name: 'Logout', path: 'destroy_user_session_path' }]
},
{
name: 'Home', display: 'always', path: 'root_path', position: 'left', condition: 'true', image: '', image_options: {},
links: []
}
]
- @@news_feed =
nil
- @@news_feed_items =
5
- @@link_color =
nil
- @@body_background_color =
nil
- @@body_background_image =
nil
- @@month_day =
{}
- @@sign_up_fields =
[]
Class Method Summary
collapse
Class Method Details
.body_background_color_select ⇒ Object
90
91
92
|
# File 'lib/contour.rb', line 90
def self.body_background_color_select
retrieve_option(:body_background_color) || mod_year(body_background_color)
end
|
.body_background_image_select ⇒ Object
94
95
96
|
# File 'lib/contour.rb', line 94
def self.body_background_image_select()
retrieve_option(:body_background_image) || mod_year(body_background_image)
end
|
.link_color_select ⇒ Object
86
87
88
|
# File 'lib/contour.rb', line 86
def self.link_color_select
retrieve_option(:link_color) || mod_year(link_color)
end
|
.mod_year(element) ⇒ Object
Takes a string or array as input and returns element from location (YearDay % ArraySize)
108
109
110
111
|
# File 'lib/contour.rb', line 108
def self.mod_year(element)
array = [element].flatten
array.size > 0 ? array[Date.today.yday % array.size] : nil
end
|
.retrieve_option(option_name) ⇒ Object
98
99
100
101
102
103
104
105
|
# File 'lib/contour.rb', line 98
def self.retrieve_option(option_name)
key = Date.today.month.to_s + "-" + Date.today.day.to_s
if month_day.kind_of?(Hash) and month_day[key] and not month_day[key][option_name.to_sym].blank?
month_day[key][option_name.to_sym]
else
nil
end
end
|
.setup {|_self| ... } ⇒ Object
82
83
84
|
# File 'lib/contour.rb', line 82
def self.setup
yield self
end
|