fullstack-cms 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +17 -0
- data/Gemfile.lock +289 -0
- data/README.md +28 -0
- data/Rakefile +53 -0
- data/VERSION +1 -0
- data/app/controllers/links_controller.rb +59 -0
- data/app/controllers/menus_controller.rb +40 -0
- data/app/controllers/page_parts_controller.rb +16 -0
- data/app/controllers/pages_controller.rb +21 -0
- data/app/controllers/posts_controller.rb +39 -0
- data/app/controllers/settings_controller.rb +39 -0
- data/app/controllers/tags_controller.rb +22 -0
- data/app/controllers/users_controller.rb +39 -0
- data/app/helpers/menus_helper.rb +42 -0
- data/app/helpers/pages_helper.rb +14 -0
- data/app/helpers/settings_helper.rb +7 -0
- data/app/models/.gitkeep +0 -0
- data/app/models/link.rb +17 -0
- data/app/models/menu.rb +19 -0
- data/app/models/page.rb +16 -0
- data/app/models/page_part.rb +6 -0
- data/app/models/redirect.rb +4 -0
- data/app/models/setting.rb +64 -0
- data/app/views/admin/links/_filter.html.erb +14 -0
- data/app/views/admin/links/_form.html.erb +24 -0
- data/app/views/admin/links/_index.html.erb +9 -0
- data/app/views/admin/links/_links.html.erb +128 -0
- data/app/views/admin/links/_table_row.html.erb +9 -0
- data/app/views/admin/links/create.js.erb +12 -0
- data/app/views/admin/links/sort.js.coffee +6 -0
- data/app/views/admin/links/update.js.coffee +6 -0
- data/app/views/admin/menus/_filter.html.erb +12 -0
- data/app/views/admin/menus/_form.html.erb +34 -0
- data/app/views/admin/menus/_index.html.erb +9 -0
- data/app/views/admin/page_parts/_tabs.html.erb +21 -0
- data/app/views/admin/page_parts/destroy.js.coffee +12 -0
- data/app/views/admin/pages/_collection.html.erb +7 -0
- data/app/views/admin/pages/_form.html.erb +54 -0
- data/app/views/admin/settings/_filter.html.erb +10 -0
- data/app/views/admin/settings/_form.html.erb +25 -0
- data/app/views/admin/settings/_index.html.erb +8 -0
- data/fullstack-cms.gemspec +189 -0
- data/lib/fullstack-cms.rb +1 -0
- data/lib/fullstack/cms.rb +41 -0
- data/lib/fullstack/cms/engine.rb +9 -0
- data/lib/generators/fullstack/cms/install_generator.rb +88 -0
- data/lib/generators/fullstack/cms/locale_generator.rb +11 -0
- data/lib/generators/fullstack/cms/templates/rails/README.md +40 -0
- data/lib/generators/fullstack/cms/templates/rails/app/controllers/site/site_controller.rb +10 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/attachments/_attachments.html.erb +49 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/attachments/create.js.coffee +14 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/destroy.js.coffee +7 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/edit.html.erb +8 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/index.html.erb +54 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/new.html.erb +8 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/base/update.js.coffee +5 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/dashboard/show.html.erb +0 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_filter.html.erb +14 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_form.html.erb +24 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_index.html.erb +9 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_links.html.erb +128 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/_table_row.html.erb +9 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/create.js.erb +12 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/sort.js.coffee +6 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/links/update.js.coffee +6 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/menus/_filter.html.erb +12 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/menus/_form.html.erb +34 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/menus/_index.html.erb +9 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/page_parts/_tabs.html.erb +21 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/page_parts/destroy.js.coffee +12 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/pages/_filter.html.erb +12 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/pages/_form.html.erb +50 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/pages/_index.html.erb +14 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/photogalleries/_filter.html.erb +14 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/photogalleries/_form.html.erb +26 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/photogalleries/_index.html.erb +9 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/settings/_filter.html.erb +10 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/settings/_form.html.erb +25 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/settings/_index.html.erb +8 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/shared/_nav.html.erb +38 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/users/_filter.html.erb +12 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/users/_form.html.erb +53 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/admin/users/_index.html.erb +18 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/layouts/admin.html.erb +80 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/layouts/application.html.erb +28 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/layouts/email.html.erb +167 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_footer.html.erb +3 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_google_analytics.html.erb +6 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_head.html.erb +33 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_header.html.erb +15 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_javascripts.html.erb +22 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_map.html.erb +14 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_nav.html.erb +15 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/_share_buttons_big.html.erb +15 -0
- data/lib/generators/fullstack/cms/templates/rails/app/views/site/site/home.html.erb +12 -0
- data/lib/generators/fullstack/cms/templates/rails/config/initializers/devise_controller.rb +29 -0
- data/lib/generators/fullstack/cms/templates/rails/config/schedule.rb +5 -0
- data/lib/generators/fullstack/cms/templates/rails/config/sitemap.rb.tt +28 -0
- data/lib/generators/fullstack/cms/templates/rails/config/styles.yml +47 -0
- data/lib/generators/fullstack/cms/templates/rails/db/migrate/20120416071459_acts_as_taggable_on_migration.rb +31 -0
- data/lib/generators/fullstack/cms/templates/rails/db/migrate/20120730184641_create_friendly_id_slugs.rb +18 -0
- data/lib/generators/fullstack/cms/templates/rails/db/migrate/20120730204729_create_ckeditor_assets.rb +26 -0
- data/lib/generators/fullstack/cms/templates/rails/db/seeds.rb.tt +11 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/support/ckeditor/asset.rb +4 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/support/ckeditor/attachment_file.rb +12 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/support/ckeditor/picture.rb +13 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/support/content.rb +16 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/support/pageable.rb +37 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/support/timestamped_content.rb +12 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/support/user_subject.rb +40 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/tasks/.gitkeep +0 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/tasks/assets.rake +53 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/tasks/cms.rake +23 -0
- data/lib/generators/fullstack/cms/templates/rails/lib/tasks/remote.rake +255 -0
- data/lib/generators/fullstack/cms/templates/rails/public/404.html +43 -0
- data/lib/generators/fullstack/cms/templates/rails/public/422.html +26 -0
- data/lib/generators/fullstack/cms/templates/rails/public/500.html +25 -0
- data/lib/generators/fullstack/cms/templates/rails/public/apple-touch-icon.png +0 -0
- data/lib/generators/fullstack/cms/templates/rails/public/crossdomain.xml +25 -0
- data/lib/generators/fullstack/cms/templates/rails/public/favicon.ico +0 -0
- data/lib/generators/fullstack/cms/templates/rails/public/img/.gitignore +0 -0
- data/lib/generators/fullstack/cms/templates/rails/public/img/glyphicons-halflings.png +0 -0
- data/lib/generators/fullstack/cms/templates/rails/public/js/modernizr-2.5.3.min.js +4 -0
- data/lib/generators/fullstack/cms/templates/rails/public/robots.txt +4 -0
- metadata +333 -0
@@ -0,0 +1,40 @@
|
|
1
|
+
class Admin::MenusController < Admin::BaseController
|
2
|
+
respond_to :html, :js
|
3
|
+
|
4
|
+
def index
|
5
|
+
@search = Menu.search(params[:search])
|
6
|
+
@menus = @search.page(params[:page] || 1)
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@menu = Menu.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def edit
|
14
|
+
end
|
15
|
+
|
16
|
+
def create
|
17
|
+
@menu = Menu.new(params[:menu])
|
18
|
+
|
19
|
+
if @menu.respond_to?(:author)
|
20
|
+
@menu.author ||= current_user
|
21
|
+
end
|
22
|
+
|
23
|
+
@menu.save
|
24
|
+
respond_with(@menu)
|
25
|
+
end
|
26
|
+
|
27
|
+
def update
|
28
|
+
@menu.attributes = params[:menu]
|
29
|
+
@menu.save
|
30
|
+
respond_with(@menu)
|
31
|
+
end
|
32
|
+
|
33
|
+
def destroy
|
34
|
+
@menu.destroy
|
35
|
+
respond_with(@menu)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
40
|
+
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Admin::PagePartsController < Admin::BaseController
|
2
|
+
respond_to :html, :js
|
3
|
+
|
4
|
+
def update
|
5
|
+
@page_part = Page.find(params[:page_id]).page_parts.find(params[:id])
|
6
|
+
@page_part.attributes = params[:page_part]
|
7
|
+
@page_part.save
|
8
|
+
respond_with(@page_part)
|
9
|
+
end
|
10
|
+
|
11
|
+
def destroy
|
12
|
+
@page_part = Page.find(params[:page_id]).page_parts.find(params[:id])
|
13
|
+
@page_part.destroy
|
14
|
+
respond_with(@page_part)
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class Admin::PagesController < Admin::BaseController
|
2
|
+
respond_to :html, :js
|
3
|
+
|
4
|
+
def index
|
5
|
+
@pages = Page.root.self_and_descendants
|
6
|
+
end
|
7
|
+
|
8
|
+
def edit
|
9
|
+
end
|
10
|
+
|
11
|
+
def update
|
12
|
+
@page.attributes = params[:page]
|
13
|
+
@page.save
|
14
|
+
respond_with(@page)
|
15
|
+
end
|
16
|
+
|
17
|
+
def destroy
|
18
|
+
@page.destroy
|
19
|
+
respond_with(@page)
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class Admin::PostsController < Admin::BaseController
|
2
|
+
respond_to :html, :js
|
3
|
+
|
4
|
+
def index
|
5
|
+
@search = Post.search(params[:search])
|
6
|
+
@posts = @search.page(params[:page] || 1)
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@post = Post.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def edit
|
14
|
+
end
|
15
|
+
|
16
|
+
def create
|
17
|
+
@post = Post.new(params[:post])
|
18
|
+
|
19
|
+
if @post.respond_to?(:author)
|
20
|
+
@post.author ||= current_user
|
21
|
+
end
|
22
|
+
|
23
|
+
@post.save
|
24
|
+
respond_with(@post)
|
25
|
+
end
|
26
|
+
|
27
|
+
def update
|
28
|
+
@post.attributes = params[:post]
|
29
|
+
@post.save
|
30
|
+
respond_with(@post)
|
31
|
+
end
|
32
|
+
|
33
|
+
def destroy
|
34
|
+
@post.destroy
|
35
|
+
respond_with(@post)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class Admin::SettingsController < Admin::BaseController
|
2
|
+
respond_to :html, :js
|
3
|
+
|
4
|
+
def index
|
5
|
+
@search = Setting.search(params[:search])
|
6
|
+
@settings = @search.page(params[:page] || 1)
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@setting = Setting.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def edit
|
14
|
+
end
|
15
|
+
|
16
|
+
def create
|
17
|
+
@setting = Setting.new(params[:setting])
|
18
|
+
|
19
|
+
if @setting.respond_to?(:author)
|
20
|
+
@setting.author ||= current_user
|
21
|
+
end
|
22
|
+
|
23
|
+
@setting.save
|
24
|
+
respond_with(@setting)
|
25
|
+
end
|
26
|
+
|
27
|
+
def update
|
28
|
+
@setting.attributes = params[:setting]
|
29
|
+
@setting.save
|
30
|
+
respond_with(@setting)
|
31
|
+
end
|
32
|
+
|
33
|
+
def destroy
|
34
|
+
@setting.destroy
|
35
|
+
respond_with(@setting)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class Admin::TagsController < Admin::BaseController
|
2
|
+
respond_to :json
|
3
|
+
|
4
|
+
def index
|
5
|
+
term = params[:term]
|
6
|
+
context = params[:context] || "tags"
|
7
|
+
|
8
|
+
@tag_names = if(term && term.size >= 3)
|
9
|
+
condition = ActsAsTaggableOn::Tag.arel_table[:name].matches("%#{term}%")
|
10
|
+
tags = ActsAsTaggableOn::Tag.joins("JOIN taggings on taggings.tag_id = tags.id").where(condition)
|
11
|
+
|
12
|
+
if context
|
13
|
+
tags = tags.where("taggings.context" => context)
|
14
|
+
end
|
15
|
+
|
16
|
+
tags.pluck(:name)
|
17
|
+
end || []
|
18
|
+
|
19
|
+
render :json => @tag_names
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
class Admin::UsersController < Admin::BaseController
|
2
|
+
respond_to :html, :js
|
3
|
+
|
4
|
+
def index
|
5
|
+
@search = User.search(params[:search])
|
6
|
+
@users = @search.page(params[:page] || 1)
|
7
|
+
end
|
8
|
+
|
9
|
+
def new
|
10
|
+
@user = User.new
|
11
|
+
end
|
12
|
+
|
13
|
+
def edit
|
14
|
+
end
|
15
|
+
|
16
|
+
def create
|
17
|
+
@user = User.new(params[:user])
|
18
|
+
|
19
|
+
if @user.respond_to?(:author)
|
20
|
+
@user.author ||= current_user
|
21
|
+
end
|
22
|
+
|
23
|
+
@user.save
|
24
|
+
respond_with(@user)
|
25
|
+
end
|
26
|
+
|
27
|
+
def update
|
28
|
+
@user.attributes = params[:user]
|
29
|
+
@user.save
|
30
|
+
respond_with(@user)
|
31
|
+
end
|
32
|
+
|
33
|
+
def destroy
|
34
|
+
@user.destroy
|
35
|
+
respond_with(@user)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module MenusHelper
|
2
|
+
|
3
|
+
def nav_items_for(uid)
|
4
|
+
menu = Menu.find_or_create_by_uid(uid, :name => "#{uid}".humanize)
|
5
|
+
html = ""
|
6
|
+
|
7
|
+
menu.links.each do |link|
|
8
|
+
unless block_given?
|
9
|
+
html << nav_item(link.label, link_url(link))
|
10
|
+
else
|
11
|
+
html << yield(link)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
html.html_safe
|
16
|
+
end
|
17
|
+
|
18
|
+
def menu(uid, options = nil, &block)
|
19
|
+
content_tag(name, content_or_options_with_block = nil, options = nil, escape = true, &block)
|
20
|
+
content_tag :ul, nav_items_for(uid, &block), options, false
|
21
|
+
end
|
22
|
+
|
23
|
+
def link_url(link)
|
24
|
+
url = link.url
|
25
|
+
if url.blank?
|
26
|
+
"#"
|
27
|
+
|
28
|
+
elsif url.starts_with?("content://")
|
29
|
+
klass_name, id = url.gsub("content://", "").split("#")
|
30
|
+
klass = klass_name.constantize
|
31
|
+
resource = klass.find(id)
|
32
|
+
|
33
|
+
|
34
|
+
else
|
35
|
+
url
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module PagesHelper
|
2
|
+
|
3
|
+
def current_page
|
4
|
+
@current_page
|
5
|
+
end
|
6
|
+
|
7
|
+
def page_part(name)
|
8
|
+
if @current_page
|
9
|
+
part = @current_page.page_parts.find_or_create_by_name_and_page_id("#{name}", @current_page)
|
10
|
+
part.try(:content).try(:html_safe)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
data/app/models/.gitkeep
ADDED
File without changes
|
data/app/models/link.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
class Link < ActiveRecord::Base
|
2
|
+
field :label, :string
|
3
|
+
field :description, :text
|
4
|
+
field :position, :integer
|
5
|
+
|
6
|
+
has_attached :image
|
7
|
+
has_attached :icon
|
8
|
+
|
9
|
+
belongs_to :link_owner, :polymorphic => true
|
10
|
+
|
11
|
+
timestamps
|
12
|
+
field :external, :boolean
|
13
|
+
field :nofollow, :boolean
|
14
|
+
field :url, :string
|
15
|
+
field :alignment_right, :boolean, :default => :false
|
16
|
+
alias_attribute :right_alignment, :alignment_right
|
17
|
+
end
|
data/app/models/menu.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
class Menu < ActiveRecord::Base
|
2
|
+
|
3
|
+
field :uid, :string
|
4
|
+
field :name, :string
|
5
|
+
|
6
|
+
attr_accessible :uid, :name
|
7
|
+
has_many :links, :as => :link_owner, :dependent => :delete_all, :order=>'position ASC'
|
8
|
+
|
9
|
+
validates_presence_of :name
|
10
|
+
validates_presence_of :uid
|
11
|
+
|
12
|
+
timestamps
|
13
|
+
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
|
18
|
+
|
19
|
+
|
data/app/models/page.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
class Page < ActiveRecord::Base
|
2
|
+
include Content
|
3
|
+
|
4
|
+
validates_presence_of :uid
|
5
|
+
field :uid
|
6
|
+
index :uid, :unique => true
|
7
|
+
|
8
|
+
field :path
|
9
|
+
|
10
|
+
belongs_to :parent, :class_name => "Page", :inverse_of => :children
|
11
|
+
has_many :children, :class_name => "Page", :inverse_of => :parent
|
12
|
+
|
13
|
+
has_many :attachments, :as => :attachable
|
14
|
+
has_many :page_parts
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
class Setting < ActiveRecord::Base
|
2
|
+
belongs_to :settable, :polymorphic => true
|
3
|
+
|
4
|
+
validates_presence_of :key, :kind
|
5
|
+
validates :key, :uniqueness => {:scope => [:settable_id, :settable_type]}
|
6
|
+
|
7
|
+
field :key
|
8
|
+
index :key
|
9
|
+
|
10
|
+
field :kind
|
11
|
+
|
12
|
+
field :integer_value, :integer
|
13
|
+
field :float_value, :float
|
14
|
+
field :text_value, :text
|
15
|
+
field :string_value, :string
|
16
|
+
field :datetime_value, :datetime
|
17
|
+
field :date_value, :date
|
18
|
+
has_attached :file_value
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
def self.kinds
|
23
|
+
[ :string,
|
24
|
+
:integer,
|
25
|
+
:float,
|
26
|
+
:boolean,
|
27
|
+
:text,
|
28
|
+
:datetime,
|
29
|
+
:date,
|
30
|
+
:file
|
31
|
+
]
|
32
|
+
end
|
33
|
+
|
34
|
+
def value
|
35
|
+
setting_kind = self.kind
|
36
|
+
|
37
|
+
# this will break paperclip 'missing.png' feature, but at least
|
38
|
+
# provides a way to check if an attachment is missing
|
39
|
+
if setting_kind == "file"
|
40
|
+
return nil if !file_value?
|
41
|
+
end
|
42
|
+
self.send("#{setting_kind}_value")
|
43
|
+
end
|
44
|
+
|
45
|
+
# eg. Setting.global("site-name")
|
46
|
+
|
47
|
+
def self.global(key)
|
48
|
+
s = self.find_by_key_and_settable_id(key.to_s, nil)
|
49
|
+
if s
|
50
|
+
s.value
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def self.update_global(key, value)
|
55
|
+
s = self.find_by_key_and_settable_id(key.to_s, nil)
|
56
|
+
|
57
|
+
if s
|
58
|
+
s.update_attributes(:value => value)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
|
63
|
+
end
|
64
|
+
|