This repository has been archived by the owner on Aug 15, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Josh Adams
committed
Sep 13, 2008
1 parent
9be6d38
commit 9581525
Showing
51 changed files
with
1,412 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
class Admin::SiteSettingsController < Admin::BaseController | ||
include ThemesManagementHelper | ||
before_filter :get_settings | ||
before_filter :get_themes, :only => [:edit] | ||
|
||
protected | ||
def get_settings | ||
@settings = settings # This is defined in site_settings_helper | ||
end | ||
|
||
def get_themes | ||
@themes = list_themes | ||
end | ||
|
||
public | ||
def show | ||
end | ||
|
||
def edit | ||
end | ||
|
||
def update | ||
if @settings.update_attributes(params[:site_setting]) | ||
flash[:notice] = "Site Settings were updated successfully." | ||
redirect_to :action => 'show' | ||
else | ||
flash.now[:error] = "There was a problem updating the site settings." | ||
render :action => 'edit' | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class SiteSetting < ActiveRecord::Base | ||
def get_theme_setting | ||
theme_setting = self.send(:user_theme_name) | ||
theme_setting.blank? ? 'default' : theme_setting | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<h1>Edit Site Settings</h1> | ||
<% form_tag 'update' do -%> | ||
<% fields_for @settings do |f| -%> | ||
<%= f.select(:user_theme_name, @themes) -%> | ||
<%= submit_tag 'Update' -%> | ||
<% end -%> | ||
<% end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<h1>Site Settings</h1> | ||
<% content_for :sidebar do -%> | ||
<%= link_to 'Edit Settings', edit_admin_site_settings_path -%> | ||
<% end -%> | ||
User Theme: <%= @settings.get_theme_setting -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class CreateSiteSettings < ActiveRecord::Migration | ||
def self.up | ||
create_table :site_settings do |t| | ||
t.string :name | ||
t.string :user_theme_name | ||
|
||
t.timestamps | ||
end | ||
end | ||
|
||
def self.down | ||
drop_table :site_settings | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module SiteSettingsHelper | ||
def get_setting(name) | ||
settings.send(name) | ||
end | ||
|
||
def get_theme_setting | ||
settings.get_theme_setting | ||
end | ||
|
||
def settings | ||
SiteSetting.find_or_create_by_name(:default) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ namespace :utils do | |
puts "Initial user already exists, exiting" | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module ThemesManagementHelper | ||
def list_themes | ||
themes_dir.entries.sort.delete_if{|e| e =~ /^\.$|^\.\.$/ } | ||
end | ||
|
||
def themes_dir | ||
Dir.new("#{RAILS_ROOT}/themes") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
html { | ||
background:#000; | ||
color: #ddd; | ||
/* background-image: url(/images/background-blue-squares.png); */ | ||
/* background-image: url(/images/background-blue-squares-2.png); */ | ||
/* background-image: url(/images/background-blue-squares-3.png); */ | ||
/* background-image: url(/images/background-blue-squares-4.png); */ | ||
/* background-image: url(/images/background-blue-squares-5.png); */ | ||
/* background-image: url(/images/background-blue-squares-6.png); */ | ||
/* background-image: url(/images/background-blue-squares-7.png); */ | ||
background-image: url(/themes/default/images/background-red-squares-7.png); | ||
background-repeat: repeat-x; | ||
} | ||
body{ | ||
font-family: "Gill Sans","Franklin Gothic Medium","Lucida Grande",Arial,Helvetica; | ||
} | ||
#main{ | ||
width: 800px; | ||
margin: 0 auto; | ||
position: relative; | ||
} | ||
#header{ | ||
margin-bottom: 10px; | ||
} | ||
#header h1{ | ||
font-size: 260%; | ||
color: #fff; | ||
background-color: #000; | ||
padding: 10px 0; | ||
width: 260px; | ||
} | ||
#header .credits{ | ||
display: block; | ||
background-color: #c2c655; | ||
color: #111; | ||
position: absolute; | ||
top: 0; | ||
left: 500px; | ||
padding: 4px 10px 10px 10px; | ||
line-height: 1.4em; | ||
} | ||
#header .credits a{ | ||
background-color: #868a1f; | ||
padding: 2px; | ||
color: white; | ||
} | ||
#header h1 span.logo{ | ||
padding-left: 20px; | ||
background-image: url(/images/ansuz_logo.png); | ||
background-repeat: no-repeat; | ||
background-position: center; | ||
background-color: #111; | ||
margin-right: 10px; | ||
} | ||
#navigation{ | ||
width: 200px; | ||
float: left; | ||
margin: 0 10px 0 0; | ||
} | ||
#navigation h3{ | ||
display: none; | ||
} | ||
#navigation li a{ | ||
padding: 5px 10px; | ||
background-color: #111; | ||
color: #ccc; | ||
display: block; | ||
text-decoration: none; | ||
} | ||
#navigation li.active a, | ||
#navigation li.active a:hover { | ||
background-color: #c8379a; | ||
color: white; | ||
cursor: default; | ||
} | ||
#navigation li a:hover { | ||
color: white; | ||
border-left: 4px solid #0084ff; | ||
padding-left: 6px; | ||
background-color: #222; | ||
} | ||
div#breadcrumb{ | ||
background-color: #222; | ||
margin: -10px -10px 5px -10px; | ||
padding: 10px; | ||
} | ||
#content{ | ||
width: 570px; | ||
background-color: #333; | ||
float: left; | ||
padding: 10px; | ||
} | ||
#footer{ | ||
margin-top: 10px; | ||
background-color: #111; | ||
color: #aaa; | ||
padding: 10px; | ||
} | ||
div.clear{ | ||
clear: both; | ||
} | ||
h2{ | ||
font-size: 175%; | ||
color: #0084ff; | ||
} | ||
h3{ | ||
font-size: 120%; | ||
color: #0084ff; | ||
background-color: #111; | ||
padding: 6px 10px; | ||
margin: 20px 0 6px; | ||
} | ||
p{ | ||
margin-bottom: 10px; | ||
} | ||
ol{ | ||
margin-left: 20px; | ||
} | ||
ol li{ | ||
list-style-type: decimal; | ||
} | ||
.module{ | ||
background-color: #333; | ||
color: #ccc; | ||
padding: 10px; | ||
} | ||
a{ | ||
color: #0084FF; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | ||
|
||
one: | ||
user_theme_name: MyString | ||
|
||
two: | ||
user_theme_name: MyString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
require 'test_helper' | ||
|
||
class SiteSettingTest < ActiveSupport::TestCase | ||
# Replace this with your real tests. | ||
def test_truth | ||
assert true | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Default Ansuz Theme |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<!-- Generated Using Ansuz CMS --> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | ||
<head> | ||
<title>Ansuz with Themes!</title> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
<meta http-equiv="Content-Script-Type" content="text/javascript" /> | ||
<meta name="description" content="Ansuz Content Management System" /> | ||
<meta name="keywords" content="Ansuz Content Management System" /> | ||
<link rel="shortcut icon" href="favicon.ico" type="image/vnd.microsoft.icon" /> | ||
<link rel="icon" href="favicon.ico" type="image/vnd.microsoft.icon" /> | ||
<%= stylesheet_link_tag 'yui-reset-fonts' -%> | ||
<%= stylesheet_link_tag 'base' -%> | ||
<%= stylesheet_link_tag 'sprite' -%> | ||
<%= stylesheet_link_tag 'lightbox' -%> | ||
<%= javascript_include_tag :defaults, 'effects', 'builder', 'lightbox', 'niftycube', 'handle_rounded_corners', 'jquery', 'jqModal', 'jquery.growl.js' -%> | ||
<!--[if lt IE 7.]><%= javascript_include_tag 'pngfix.js' %><![endif]--> | ||
</head> | ||
<body> | ||
<div id='wrapper'> | ||
<div id="main"> | ||
<div id='header'> | ||
<h1> | ||
<span class='logo'></span> | ||
<span>Ansuz CMS!</span> | ||
</h1> | ||
<span class='credits'> | ||
An open source CMS co-developed by: | ||
<a href="http://www.isotope11.com">Isotope Eleven</a>, | ||
<a href="http://www.isshen.com">Isshen</a>, and | ||
<a href="http://github.com/knewter/ansuz/tree/master">you</a>. | ||
</span> | ||
</div> | ||
<div id='content'> | ||
<%= @content_for_layout -%> | ||
</div> | ||
<div class='clear'></div> | ||
<%= render :partial => "page/footer" -%> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<!-- Generated Using Ansuz CMS --> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> | ||
<head> | ||
<title>Ansuz - <%= @page.title if @page -%> - with themes!</title> | ||
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> | ||
<meta http-equiv="Content-Script-Type" content="text/javascript" /> | ||
<meta name="description" content="Ansuz Content Management System" /> | ||
<meta name="keywords" content="Ansuz Content Management System" /> | ||
<link rel="shortcut icon" href="favicon.ico" type="image/vnd.microsoft.icon" /> | ||
<link rel="icon" href="favicon.ico" type="image/vnd.microsoft.icon" /> | ||
<%= stylesheet_link_tag 'yui-reset-fonts' -%> | ||
<%= theme_stylesheet_link_tag 'base' -%> | ||
<%= stylesheet_link_tag 'sprite' -%> | ||
<%= stylesheet_link_tag 'lightbox' -%> | ||
<%= javascript_include_tag :defaults, 'effects', 'builder', 'lightbox', 'niftycube', 'handle_rounded_corners', 'jquery', 'jqModal', 'jquery.growl.js', 'ansuz/growls' -%> | ||
<!--[if lt IE 7.]><%= javascript_include_tag 'pngfix.js' %><![endif]--> | ||
</head> | ||
<body> | ||
<div id='wrapper'> | ||
<div id="main"> | ||
<div id='header'> | ||
<h1> | ||
<span class='logo'></span> | ||
<span>Ansuz CMS</span> | ||
</h1> | ||
<span class='credits'> | ||
An open source CMS co-developed by: | ||
<a href="http://www.isotope11.com">Isotope Eleven</a>, | ||
<a href="http://www.isshen.com">Isshen</a>, and | ||
<a href="http://github.com/knewter/ansuz/tree/master">you</a>. | ||
</span> | ||
</div> | ||
<%= render :partial => "page/top_nav" -%> | ||
<div id='content'> | ||
<%= render :partial => "page/breadcrumb" if (@page && (@page != @root)) -%> | ||
<%= @content_for_layout -%> | ||
<%= render :partial => "page/child_nav" if (@page && (!@page.children.empty?)) -%> | ||
</div> | ||
<div class='clear'></div> | ||
<%= render :partial => "page/footer" -%> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.