character 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -1
- data/.rspec +1 -0
- data/README.md +185 -14
- data/Rakefile +8 -1
- data/app/assets/images/character/logo.jpg +0 -0
- data/app/assets/javascripts/character.coffee +134 -0
- data/app/assets/javascripts/character/dashboard/_visitors.coffee +27 -0
- data/app/assets/javascripts/character/dashboard/layout.coffee +156 -0
- data/app/assets/javascripts/character/dashboard/module.coffee +51 -0
- data/app/assets/javascripts/character/generic/details.coffee +233 -0
- data/app/assets/javascripts/character/generic/helpers/compact_object.coffee +7 -0
- data/app/assets/javascripts/character/generic/helpers/data_inputs.coffee +21 -0
- data/app/assets/javascripts/character/generic/helpers/date_select.coffee +45 -0
- data/app/assets/javascripts/character/generic/helpers/editor.coffee +11 -0
- data/app/assets/javascripts/character/generic/helpers/redactor.coffee +38 -0
- data/app/assets/javascripts/character/generic/helpers/reorder.coffee +36 -0
- data/app/assets/javascripts/character/generic/layout.coffee +40 -0
- data/app/assets/javascripts/character/generic/list.coffee +214 -0
- data/app/assets/javascripts/character/generic/model.coffee +135 -0
- data/app/assets/javascripts/character/generic/module.coffee +157 -0
- data/app/assets/javascripts/character/images/module.coffee +148 -0
- data/app/assets/javascripts/character/pages/module.coffee +43 -0
- data/app/assets/javascripts/character/posts/module.coffee +113 -0
- data/app/assets/javascripts/character/settings/_admins.coffee +61 -0
- data/app/assets/javascripts/character/settings/_authors.coffee +56 -0
- data/app/assets/javascripts/character/settings/_categories.coffee +61 -0
- data/app/assets/javascripts/character/settings/_layout.coffee +7 -0
- data/app/assets/javascripts/character/settings/_redirects.coffee +56 -0
- data/app/assets/javascripts/character/settings/_website.coffee +7 -0
- data/app/assets/javascripts/character/settings/details.coffee +16 -0
- data/app/assets/javascripts/character/settings/layout.coffee +46 -0
- data/app/assets/javascripts/character/settings/module.coffee +78 -0
- data/app/assets/stylesheets/character.scss +37 -0
- data/app/assets/stylesheets/character/_admins.scss +30 -0
- data/app/assets/stylesheets/character/_authors.scss +30 -0
- data/app/assets/stylesheets/character/_categories.scss +32 -0
- data/app/assets/stylesheets/character/_dashboard.scss +143 -0
- data/app/assets/stylesheets/character/_posts.scss +93 -0
- data/app/assets/stylesheets/character/_redirects.scss +35 -0
- data/app/assets/stylesheets/character/base.scss +967 -0
- data/app/assets/stylesheets/character/typography.scss +29 -0
- data/app/controllers/character/api_controller.rb +170 -0
- data/app/controllers/character/application_controller.rb +37 -0
- data/app/controllers/character/settings_controller.rb +72 -0
- data/app/controllers/concerns/character/auth_concern.rb +41 -0
- data/app/controllers/concerns/character/instance_concern.rb +31 -0
- data/app/controllers/concerns/character/json_object_concern.rb +32 -0
- data/app/controllers/concerns/character/model_class_concern.rb +28 -0
- data/app/controllers/concerns/character/params_concern.rb +33 -0
- data/app/controllers/concerns/character/templates_concern.rb +32 -0
- data/app/controllers/concerns/not_found.rb +18 -0
- data/app/controllers/concerns/website_settings.rb +18 -0
- data/app/controllers/pages_controller.rb +8 -0
- data/app/controllers/posts_controller.rb +43 -0
- data/app/helpers/character_helper.rb +8 -0
- data/app/helpers/page_helper.rb +67 -0
- data/app/inputs/foundation_string_input.rb +44 -0
- data/app/inputs/foundation_switch_input.rb +35 -0
- data/app/models/character/image.rb +12 -0
- data/app/models/character/page.rb +21 -0
- data/app/models/character/post.rb +32 -12
- data/app/models/character/post_author.rb +22 -0
- data/app/models/character/post_category.rb +21 -0
- data/app/models/character/redirect.rb +15 -0
- data/app/models/character/settings/variable.rb +23 -0
- data/app/models/character/sitemap/sitemap_generator_helper.rb +15 -0
- data/app/models/character/user.rb +29 -0
- data/app/models/concerns/created_ago.rb +12 -0
- data/app/models/concerns/hideable.rb +27 -0
- data/app/models/concerns/orderable.rb +8 -0
- data/app/models/concerns/report.rb +11 -0
- data/app/models/concerns/report_daily.rb +32 -0
- data/app/models/concerns/report_monthly.rb +18 -0
- data/app/models/concerns/report_weekly.rb +19 -0
- data/app/models/concerns/updated_ago.rb +12 -0
- data/app/models/reports/analytics_daily.rb +26 -0
- data/app/models/reports/analytics_monthly.rb +16 -0
- data/app/models/reports/analytics_weekly.rb +16 -0
- data/app/services/google_analytics.rb +43 -0
- data/app/uploaders/character/image_uploader.rb +22 -0
- data/app/uploaders/character/settings/file_uploader.rb +5 -0
- data/app/views/character/character.html.erb +67 -0
- data/app/views/character/generic/form.html.erb +8 -0
- data/app/views/character/pages/form.html.erb +28 -0
- data/app/views/character/posts/form.html.erb +38 -0
- data/app/views/character/settings/admins.html.erb +29 -0
- data/app/views/character/settings/post_authors.html.erb +28 -0
- data/app/views/character/settings/post_categories.html.erb +31 -0
- data/app/views/character/settings/redirects.html.erb +30 -0
- data/app/views/character/settings/settings_group.html.erb +67 -0
- data/app/views/errors/not_found.html.erb +157 -0
- data/app/views/pages/_default.html.erb +3 -0
- data/app/views/pages/_redactor.html.erb +3 -0
- data/app/views/pages/show.html.erb +5 -0
- data/app/views/posts/_post.html.erb +17 -0
- data/app/views/posts/author.html.erb +18 -0
- data/app/views/posts/category.html.erb +18 -0
- data/app/views/posts/index.html.erb +18 -0
- data/app/views/posts/rss.builder +19 -0
- data/app/views/posts/show.html.erb +14 -0
- data/app/views/shared/_google_analytics.html.erb +13 -0
- data/character.gemspec +48 -5
- data/doc/README_old.md +161 -0
- data/doc/generic_app.md +19 -0
- data/doc/img/demo-1.jpg +0 -0
- data/doc/img/demo-2.jpg +0 -0
- data/doc/img/demo-3.jpg +0 -0
- data/doc/img/demo-4.jpg +0 -0
- data/doc/img/demo-5.jpg +0 -0
- data/doc/instances.md +39 -0
- data/doc/settings.md +1 -0
- data/lib/character.rb +29 -1
- data/lib/character/engine.rb +33 -1
- data/lib/character/generators/bootstrap_generator.rb +51 -0
- data/lib/character/instance.rb +59 -0
- data/lib/character/routing.rb +42 -5
- data/lib/character/settings.rb +101 -0
- data/lib/character/templates/admin.coffee +15 -0
- data/lib/character/templates/admin.scss +3 -0
- data/lib/character/templates/application.html.erb +44 -0
- data/lib/character/templates/application.scss +12 -0
- data/lib/character/templates/assets.rb +1 -0
- data/lib/character/templates/initializer.rb +5 -0
- data/lib/character/templates/settings.scss +11 -0
- data/lib/character/templates/settings.yml +67 -0
- data/lib/character/templates/typography.scss +13 -0
- data/lib/character/version.rb +2 -2
- data/lib/mongoid/carrierwave_serialization_patch.rb +9 -0
- data/lib/tasks/analytics.rake +52 -0
- data/test/config/application.rb +65 -0
- data/test/config/mongoid.yml +12 -0
- data/test/config/secrets.yml +22 -0
- data/test/controllers/character/api_controller_test.rb +94 -0
- data/test/factories/product_factory.rb +5 -0
- data/test/lib/character/engine_test.rb +33 -0
- data/test/lib/character/routing_test.rb +31 -0
- data/test/test_helper.rb +48 -0
- data/vendor/assets/javascripts/backbone.js +944 -794
- data/vendor/assets/javascripts/jquery.fileupload.js +1426 -0
- data/vendor/assets/javascripts/jquery.form.js +1278 -0
- data/vendor/assets/javascripts/jquery.iframe-transport.js +214 -0
- data/vendor/assets/javascripts/raphael.js +8117 -0
- data/vendor/assets/javascripts/raphael.morris.js +1885 -0
- data/vendor/assets/javascripts/underscore.inflection.js +177 -0
- data/vendor/assets/javascripts/underscore.string.js +1 -1
- data/vendor/assets/stylesheets/csspinner.css +361 -0
- data/vendor/assets/stylesheets/normalize.css +423 -0
- metadata +499 -49
- data/app/controllers/character/posts_controller.rb +0 -27
- data/lib/generators/character/install_generator.rb +0 -42
- data/lib/generators/character/templates/README +0 -1
- data/lib/generators/character/templates/admin/character.rb +0 -3
- data/vendor/assets/fonts/general_foundicons.eot +0 -0
- data/vendor/assets/fonts/general_foundicons.svg +0 -15
- data/vendor/assets/fonts/general_foundicons.ttf +0 -0
- data/vendor/assets/fonts/general_foundicons.woff +0 -0
- data/vendor/assets/javascripts/character/index.js.coffee +0 -53
- data/vendor/assets/javascripts/character/models/post.js.coffee +0 -39
- data/vendor/assets/javascripts/character/views/app.js.coffee +0 -81
- data/vendor/assets/javascripts/character/views/editor.js.coffee +0 -231
- data/vendor/assets/javascripts/character/views/editor_settings.js.coffee +0 -44
- data/vendor/assets/javascripts/character/views/index.js.coffee +0 -116
- data/vendor/assets/javascripts/character/views/preview.js.coffee +0 -49
- data/vendor/assets/javascripts/jquery.smartresize.js +0 -30
- data/vendor/assets/javascripts/lodash.js +0 -4258
- data/vendor/assets/javascripts/showdown.js +0 -62
- data/vendor/assets/stylesheets/character/_base.css.scss +0 -84
- data/vendor/assets/stylesheets/character/_icons.css.scss.erb +0 -96
- data/vendor/assets/stylesheets/character/_view_editor.css.scss +0 -115
- data/vendor/assets/stylesheets/character/_view_index.css.scss +0 -73
- data/vendor/assets/stylesheets/character/_view_preview.css.scss +0 -49
- data/vendor/assets/stylesheets/character/index.css.scss +0 -32
@@ -0,0 +1,51 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Character
|
4
|
+
module Generators
|
5
|
+
class BootstrapGenerator < ::Rails::Generators::Base
|
6
|
+
desc "Setup posts, pages and admin."
|
7
|
+
source_root File.expand_path("../../templates", __FILE__)
|
8
|
+
|
9
|
+
def override_layout
|
10
|
+
copy_file 'application.html.erb', 'app/views/layouts/application.html.erb'
|
11
|
+
end
|
12
|
+
|
13
|
+
def copy_initializer_file
|
14
|
+
copy_file "initializer.rb", "config/initializers/character.rb"
|
15
|
+
end
|
16
|
+
|
17
|
+
def copy_settings_file
|
18
|
+
copy_file "settings.yml", "config/settings.yml"
|
19
|
+
end
|
20
|
+
|
21
|
+
def setup_assets
|
22
|
+
copy_file "admin.coffee", "app/assets/javascripts/admin.coffee"
|
23
|
+
copy_file "admin.scss", "app/assets/stylesheets/admin.scss"
|
24
|
+
copy_file "assets.rb", "config/initializers/assets.rb"
|
25
|
+
copy_file "application.scss", "app/assets/stylesheets/application.scss"
|
26
|
+
|
27
|
+
# TODO: remove application.css file
|
28
|
+
# TODO: create application folder
|
29
|
+
|
30
|
+
copy_file "typography.scss", "app/assets/stylesheets/application/typography.scss"
|
31
|
+
copy_file "settings.scss", "app/assets/stylesheets/application/settings.scss"
|
32
|
+
end
|
33
|
+
|
34
|
+
def add_routes
|
35
|
+
inject_into_file "config/routes.rb", before: " # The priority is based upon order of creation: first created -> highest priority.\n" do <<-'RUBY'
|
36
|
+
mount_character_instance 'admin'
|
37
|
+
mount_posts_at '/'
|
38
|
+
mount_pages_at '/'
|
39
|
+
RUBY
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def remove_assets_require_tree
|
44
|
+
gsub_file 'app/assets/javascripts/application.js', "//= require_tree .\n", ''
|
45
|
+
|
46
|
+
# TODO: this file should be removed
|
47
|
+
# gsub_file 'app/assets/stylesheets/application.css', " *= require_tree .\n", ''
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
module Character
|
2
|
+
class Instance
|
3
|
+
DEFAULT_NAME = 'admin'
|
4
|
+
|
5
|
+
attr_accessor :name,
|
6
|
+
:title,
|
7
|
+
:user_model,
|
8
|
+
|
9
|
+
:before_index,
|
10
|
+
:before_save,
|
11
|
+
|
12
|
+
:javascript_filename,
|
13
|
+
:stylesheet_filename,
|
14
|
+
|
15
|
+
:development_auto_login,
|
16
|
+
:force_ssl,
|
17
|
+
|
18
|
+
# defined in config/settings.yml
|
19
|
+
:settings,
|
20
|
+
:logo,
|
21
|
+
:login_background
|
22
|
+
|
23
|
+
def initialize(name = Instance::DEFAULT_NAME)
|
24
|
+
@name = name.gsub(' ', '-').downcase
|
25
|
+
@title = 'Character'
|
26
|
+
@user_model = 'Character::User'
|
27
|
+
@development_auto_login = false
|
28
|
+
@force_ssl = true
|
29
|
+
end
|
30
|
+
|
31
|
+
def title
|
32
|
+
@title || @name.humanize
|
33
|
+
end
|
34
|
+
|
35
|
+
def javascript_filename
|
36
|
+
@javascript_filename || @name
|
37
|
+
end
|
38
|
+
|
39
|
+
def stylesheet_filename
|
40
|
+
@stylesheet_filename || @name
|
41
|
+
end
|
42
|
+
|
43
|
+
def user_class
|
44
|
+
@user_class ||= @user_model.constantize
|
45
|
+
end
|
46
|
+
|
47
|
+
def settings
|
48
|
+
@settings ||= ::Settings.group(@name.capitalize)
|
49
|
+
end
|
50
|
+
|
51
|
+
def logo
|
52
|
+
@logo ||= settings['Logo'].value
|
53
|
+
end
|
54
|
+
|
55
|
+
def login_background
|
56
|
+
@login_background ||= settings['Login Background'].value
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/character/routing.rb
CHANGED
@@ -1,10 +1,47 @@
|
|
1
1
|
module ActionDispatch::Routing
|
2
2
|
class Mapper
|
3
|
-
def
|
4
|
-
scope
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
def mount_character_instance(name='admin')
|
4
|
+
scope "/#{ name }", :module => "character" do
|
5
|
+
get '/', to: 'application#index'
|
6
|
+
match '/login', to: 'application#login', via: [ :post, :get ]
|
7
|
+
match '/logout', to: 'application#logout', via: [ :post, :get ]
|
8
|
+
|
9
|
+
# settings api
|
10
|
+
get '/settings/:template_name(.:format)', to: 'settings#show'
|
11
|
+
post '/settings/:template_name(.:format)', to: 'settings#update'
|
12
|
+
|
13
|
+
# generic api
|
14
|
+
get '/:model_slug(.:format)', to: 'api#index'
|
15
|
+
get '/:model_slug/new(.:format)', to: 'api#new'
|
16
|
+
get '/:model_slug/:id(.:format)', to: 'api#show'
|
17
|
+
get '/:model_slug/:id/edit(.:format)', to: 'api#edit'
|
18
|
+
match '/:model_slug(.:format)', to: 'api#create', via: [ :post, :put, :patch ]
|
19
|
+
post '/:model_slug/:id(.:format)', to: 'api#update'
|
20
|
+
|
21
|
+
# workaround for test environment, "patch" not working
|
22
|
+
# Maxim
|
23
|
+
patch '/:model_slug/:id(.:format)', to: 'api#patch'
|
24
|
+
# Alex: I guess we need patch here
|
25
|
+
#put '/:model_slug/:id(.:format)', to: 'api#patch'
|
26
|
+
|
27
|
+
|
28
|
+
delete '/:model_slug/:id(.:format)', to: 'api#destroy'
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def mount_posts_at(mount_location)
|
33
|
+
scope mount_location do
|
34
|
+
get '/' => 'posts#index', as: :posts_index
|
35
|
+
get '/a/:slug' => 'posts#author', as: :posts_author
|
36
|
+
get '/c/:slug' => 'posts#category', as: :posts_category
|
37
|
+
get '/p/:slug' => 'posts#show', as: :posts_show
|
38
|
+
get '/rss(.:format)' => 'posts#rss', as: :posts_rss
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def mount_pages_at(mount_location)
|
43
|
+
scope mount_location do
|
44
|
+
get '/:path' => 'pages#show', as: :pages_show, :constraints => {:path => /.*/}
|
8
45
|
end
|
9
46
|
end
|
10
47
|
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
module Settings
|
2
|
+
# TODO: this module should be refactored
|
3
|
+
# - now we ping db to get every single value
|
4
|
+
# - need to cache all values in one request, so ping db once per request
|
5
|
+
|
6
|
+
mattr_accessor :settings_file
|
7
|
+
@@settings_file = "config/settings.yml"
|
8
|
+
|
9
|
+
def self.value(key)
|
10
|
+
group_name, value_name = key.split('::')
|
11
|
+
if groups.has_key? group_name and groups[group_name].has_key? value_name
|
12
|
+
groups[group_name][value_name].value
|
13
|
+
else
|
14
|
+
''
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.group(group_name)
|
19
|
+
groups[group_name]
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.groups
|
23
|
+
unless @groups
|
24
|
+
@groups = {}
|
25
|
+
settings_from_yml.keys.each do |group_name|
|
26
|
+
@groups[group_name] = settings_from_yml[group_name].map do |name, attrs|
|
27
|
+
[ name, Variable.new(group_name, name, attrs) ]
|
28
|
+
end.to_h
|
29
|
+
end
|
30
|
+
end
|
31
|
+
@groups
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.settings_from_yml
|
35
|
+
unless @settings_from_yml
|
36
|
+
settings_file = ::Rails.root.join(@@settings_file)
|
37
|
+
@settings_from_yml = {}
|
38
|
+
|
39
|
+
if File.exists?(settings_file)
|
40
|
+
data = YAML::load(ERB.new(IO.read(settings_file)).result)
|
41
|
+
@settings_from_yml = data if data
|
42
|
+
end
|
43
|
+
end
|
44
|
+
@settings_from_yml
|
45
|
+
end
|
46
|
+
|
47
|
+
def self.stored_variables
|
48
|
+
@stored_variables ||= Character::Settings::Variable.all
|
49
|
+
Character::Settings::Variable.all
|
50
|
+
end
|
51
|
+
|
52
|
+
class Variable
|
53
|
+
attr_accessor :group,
|
54
|
+
:name,
|
55
|
+
:type,
|
56
|
+
:description,
|
57
|
+
:default_value
|
58
|
+
|
59
|
+
def initialize(group, name, attrs)
|
60
|
+
@group = group
|
61
|
+
@name = name
|
62
|
+
@type = attrs['type'] || 'string'
|
63
|
+
@description = attrs['description'] || ''
|
64
|
+
@default_value = attrs['default_value'] || ''
|
65
|
+
end
|
66
|
+
|
67
|
+
def stored_object
|
68
|
+
Character::Settings::Variable.find_or_create_by(name: @name, group: @group)
|
69
|
+
end
|
70
|
+
|
71
|
+
def value
|
72
|
+
object = stored_object
|
73
|
+
value = object.value || @default_value
|
74
|
+
|
75
|
+
if @type == 'file'
|
76
|
+
if object.has_file_uploaded?
|
77
|
+
# return uploaded file
|
78
|
+
return object.file.to_s
|
79
|
+
elsif value.include? '//'
|
80
|
+
# return direct link to file
|
81
|
+
return value
|
82
|
+
elsif value.empty?
|
83
|
+
# return empty string
|
84
|
+
return value
|
85
|
+
else
|
86
|
+
# return rails asset
|
87
|
+
return ActionController::Base.helpers.asset_path(value)
|
88
|
+
end
|
89
|
+
|
90
|
+
elsif @type == 'integer'
|
91
|
+
return value.to_i
|
92
|
+
|
93
|
+
elsif @type == 'float'
|
94
|
+
return value.to_f
|
95
|
+
|
96
|
+
else # string
|
97
|
+
return value
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
#= require character
|
2
|
+
|
3
|
+
# Modules =================================================
|
4
|
+
|
5
|
+
chr.dashboardModule()
|
6
|
+
chr.postsModule()
|
7
|
+
chr.pagesModule()
|
8
|
+
|
9
|
+
# Settings Modules ========================================
|
10
|
+
|
11
|
+
chr.settingsWebsite()
|
12
|
+
chr.settingsLayout()
|
13
|
+
chr.settingsRedirects()
|
14
|
+
chr.settingsPostCategories()
|
15
|
+
chr.settingsAdmins()
|
@@ -0,0 +1,44 @@
|
|
1
|
+
<!doctype html>
|
2
|
+
<html class="no-js">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
+
|
7
|
+
<%= display_meta_tags title: @title,
|
8
|
+
description: @description,
|
9
|
+
canonical: "http://#{ @domain }",
|
10
|
+
open_graph: { type: 'website',
|
11
|
+
title: @title,
|
12
|
+
description: @description,
|
13
|
+
url: "http://#{ @domain }" } %>
|
14
|
+
|
15
|
+
<link rel="alternate" type="application/rss+xml" title="RSS" href="http://<%= @domain %><%= posts_rss_path %>" />
|
16
|
+
|
17
|
+
<%= stylesheet_link_tag "application" %>
|
18
|
+
<%= javascript_include_tag :modernizr %>
|
19
|
+
<%= csrf_meta_tags %>
|
20
|
+
</head>
|
21
|
+
|
22
|
+
<body>
|
23
|
+
<!--[if lt IE 8]>
|
24
|
+
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
|
25
|
+
<![endif]-->
|
26
|
+
|
27
|
+
<header class='header'>
|
28
|
+
<div class='container'>
|
29
|
+
<%= @header_html.html_safe %>
|
30
|
+
</div>
|
31
|
+
</header>
|
32
|
+
|
33
|
+
<%= yield %>
|
34
|
+
|
35
|
+
<footer class='footer'>
|
36
|
+
<div class='container'>
|
37
|
+
<%= @footer_html.html_safe %>
|
38
|
+
</div>
|
39
|
+
</footer>
|
40
|
+
|
41
|
+
<%= javascript_include_tag "application" %>
|
42
|
+
<%= render partial: 'shared/google_analytics' %>
|
43
|
+
</body>
|
44
|
+
</html>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
//= require normalize
|
2
|
+
|
3
|
+
// http://www.paulirish.com/2012/box-sizing-border-box-ftw/
|
4
|
+
// apply a natural box layout model to all elements
|
5
|
+
*, *:before, *:after { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
|
6
|
+
|
7
|
+
@import "application/settings";
|
8
|
+
|
9
|
+
html { // Make everything look a little nicer in webkit
|
10
|
+
-webkit-font-smoothing: antialiased;
|
11
|
+
@import "application/typography";
|
12
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
Rails.application.config.assets.precompile += %w( admin.css admin.js )
|
@@ -0,0 +1,11 @@
|
|
1
|
+
|
2
|
+
$baseColor: rgba(0,0,0,0.8);
|
3
|
+
$linkColor: #222;
|
4
|
+
$baseFontFamily: 'Georgia', serif;
|
5
|
+
$headerFontFamily: 'Myriad Pro', sans-serif;
|
6
|
+
$codeFontFamily: 'Monaco', monospace;
|
7
|
+
$baseFontSize: 20;
|
8
|
+
$baseLineHeight: 1.5;
|
9
|
+
$h1: 0.33 * 7.3;
|
10
|
+
$h2: 0.33 * 4.3;
|
11
|
+
$h3: 0.33 * 3.3;
|
@@ -0,0 +1,67 @@
|
|
1
|
+
# ================================================================================
|
2
|
+
# character_settings.yml ---configuration file v1.0---
|
3
|
+
# ================================================================================
|
4
|
+
# This file is used to store a list of character settings. Settings are split into
|
5
|
+
# groups like this:
|
6
|
+
#
|
7
|
+
# Group Name:
|
8
|
+
# Variable Title:
|
9
|
+
# type: string (default) / text / file / link
|
10
|
+
# description: setting one sentence description
|
11
|
+
# default_value: default value is used when setting value is blank
|
12
|
+
#
|
13
|
+
# PS: Link value format: (link title) http://link.url
|
14
|
+
# --------------------------------------------------------------------------------
|
15
|
+
|
16
|
+
# Default Settings
|
17
|
+
|
18
|
+
Admin:
|
19
|
+
Logo:
|
20
|
+
type: file
|
21
|
+
description: 'Company logo'
|
22
|
+
default_value: 'character/logo.jpg'
|
23
|
+
|
24
|
+
Login Background:
|
25
|
+
type: file
|
26
|
+
description: 'Background for login page'
|
27
|
+
default_value: ''
|
28
|
+
|
29
|
+
# END
|
30
|
+
|
31
|
+
# Website Settings
|
32
|
+
|
33
|
+
Website:
|
34
|
+
Domain:
|
35
|
+
type: string
|
36
|
+
description: 'Website domain is used in links.'
|
37
|
+
default_value: 'www.website.com'
|
38
|
+
|
39
|
+
Title:
|
40
|
+
type: string
|
41
|
+
description: 'Title for the website is used by search engines.'
|
42
|
+
default_value: 'Website'
|
43
|
+
|
44
|
+
Description:
|
45
|
+
type: text
|
46
|
+
description: 'What this website is about? This is used by search engines.'
|
47
|
+
default_value: 'This website is built with character.'
|
48
|
+
|
49
|
+
Google Analytics ID:
|
50
|
+
type: string
|
51
|
+
description: 'Something that looks like like: UA-38088276-3'
|
52
|
+
default_value: ''
|
53
|
+
|
54
|
+
# END
|
55
|
+
|
56
|
+
# Layout
|
57
|
+
|
58
|
+
Layout:
|
59
|
+
Header:
|
60
|
+
type: code
|
61
|
+
description: ''
|
62
|
+
default_value: "<h1>Project Title</h1><p><a href='/' title='Home'>Home</a></p>"
|
63
|
+
|
64
|
+
Footer:
|
65
|
+
type: code
|
66
|
+
description: ''
|
67
|
+
default_value: '<p>© Project™ 2014. All rights reserved.</p>'
|