diff --git a/README.md b/README.md index 6d4cca5..413dcf4 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,5 @@ Installing ---------- calefaction can be deployed as a standard Rails app. + +- describe db setup here... diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index bcba2cd..36f54af 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,7 +3,7 @@ require 'calefaction/version' module ApplicationHelper def get_title(title = '') - base = '[Site Name]' + base = AdminSetting.get('site_name') title.empty? ? base : "#{title} : #{base}" end @@ -12,4 +12,8 @@ module ApplicationHelper year = Time.now.year year > start ? "#{start}–#{year}" : start end + + def get_copyright_holders + AdminSetting.get('copyright') + end end diff --git a/app/helpers/tools_helper.rb b/app/helpers/tools_helper.rb index 6f87959..55d1fb9 100644 --- a/app/helpers/tools_helper.rb +++ b/app/helpers/tools_helper.rb @@ -1,2 +1,6 @@ module ToolsHelper + + def get_description + AdminSetting.get('description') + end end diff --git a/app/models/admin_setting.rb b/app/models/admin_setting.rb new file mode 100644 index 0000000..9e4ab4b --- /dev/null +++ b/app/models/admin_setting.rb @@ -0,0 +1,6 @@ +class AdminSetting < ActiveRecord::Base + + def self.get(key) + self.find_by(key: key).value + end +end diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 29de0ba..d1a8cd1 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -7,14 +7,11 @@ <%= csrf_meta_tags %>
-