chr 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.scss-style.yml +3 -3
- data/{LICENSE → LICENSE.md} +0 -0
- data/README.md +24 -10
- data/app/assets/javascripts/chr/list_tabs.coffee +1 -2
- data/app/assets/javascripts/chr/view_tabs.coffee +7 -6
- data/app/assets/stylesheets/chr/layout.scss +15 -2
- data/app/assets/stylesheets/chr/themes/basic.scss +8 -16
- data/chr.gemspec +33 -34
- data/lib/chr.rb +9 -12
- data/lib/chr/version.rb +1 -1
- metadata +8 -51
- data/app/assets/javascripts/vendor/slip.js +0 -804
- data/bin/chr +0 -13
- data/docs/bootstrap.md +0 -23
- data/docs/demo.png +0 -0
- data/docs/notes.md +0 -3
- data/docs/rails.md +0 -233
- data/lib/chr/app_builder.rb +0 -378
- data/lib/chr/generators/app_generator.rb +0 -211
- data/lib/generators/chr/controller_generator.rb +0 -18
- data/templates/Gemfile.erb +0 -41
- data/templates/Procfile +0 -1
- data/templates/README.md.erb +0 -45
- data/templates/_analytics.html.erb +0 -1
- data/templates/_flashes.html.erb +0 -7
- data/templates/_javascript.html.erb +0 -5
- data/templates/application.coffee +0 -2
- data/templates/application.scss +0 -1
- data/templates/application.yml +0 -6
- data/templates/application_gitignore +0 -15
- data/templates/application_layout.html.erb.erb +0 -17
- data/templates/bin_setup.erb +0 -35
- data/templates/body_class_helper.rb +0 -15
- data/templates/bundler_audit.rake +0 -12
- data/templates/carrierwave.rb +0 -21
- data/templates/character_admin.coffee.erb +0 -38
- data/templates/character_admin.scss +0 -14
- data/templates/character_admin_index.html.erb +0 -5
- data/templates/character_admin_layout.html.erb.erb +0 -21
- data/templates/character_base_controller.rb +0 -14
- data/templates/dev.rake +0 -12
- data/templates/devise_overrides_passwords_controller.rb +0 -11
- data/templates/devise_overrides_passwords_edit.html.erb +0 -31
- data/templates/devise_overrides_passwords_new.html.erb +0 -19
- data/templates/devise_overrides_sessions_controller.rb +0 -20
- data/templates/devise_overrides_sessions_new.html.erb +0 -29
- data/templates/errors.rb +0 -34
- data/templates/json_encoding.rb +0 -1
- data/templates/puma.rb +0 -18
- data/templates/routes.rb +0 -86
- data/templates/sample.env +0 -6
- data/templates/secrets.yml +0 -14
- data/templates/smtp.rb +0 -9
- data/templates/staging.rb +0 -5
data/templates/carrierwave.rb
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
CarrierWave.configure do |config|
|
2
|
-
config.storage = :file
|
3
|
-
config.cache_dir = "#{Rails.root}/public/uploads/tmp"
|
4
|
-
|
5
|
-
if Rails.env.test?
|
6
|
-
config.cache_dir = "#{Rails.root}/public/uploads/tmp/test"
|
7
|
-
config.enable_processing = false
|
8
|
-
end
|
9
|
-
|
10
|
-
if Rails.env.production? || Rails.env.staging?
|
11
|
-
if ENV.has_key? "FOG_DIRECTORY"
|
12
|
-
config.storage = :fog
|
13
|
-
config.fog_directory = ENV.fetch("FOG_DIRECTORY")
|
14
|
-
config.fog_credentials = {
|
15
|
-
provider: "AWS",
|
16
|
-
aws_access_key_id: ENV.fetch("AWS_ACCESS_KEY_ID"),
|
17
|
-
aws_secret_access_key: ENV.fetch("AWS_SECRET_ACCESS_KEY"),
|
18
|
-
}
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
#= require jquery
|
2
|
-
#= require jquery_ujs
|
3
|
-
|
4
|
-
#= require chr
|
5
|
-
#= require loft
|
6
|
-
#= require ants
|
7
|
-
#= require journal
|
8
|
-
|
9
|
-
@redirectToSignIn = ->
|
10
|
-
signinPath = "/admin/sign_in"
|
11
|
-
if window.location.hash
|
12
|
-
returnTo = window.location.hash.substring(1)
|
13
|
-
signinPath = "#{signinPath}?return_to=#{returnTo}"
|
14
|
-
window.location = signinPath
|
15
|
-
|
16
|
-
@addWebsiteLink = ->
|
17
|
-
$link =$ """<a href='/' target='_blank'>
|
18
|
-
<i class='fa fa-home fa-fw'></i> View Site
|
19
|
-
</a>"""
|
20
|
-
chr.$mainMenu.prepend $link
|
21
|
-
|
22
|
-
$ ->
|
23
|
-
$.get("/admin/bootstrap.json", (response) ->
|
24
|
-
chr.start "<%= app_name %>",
|
25
|
-
modules:
|
26
|
-
posts: new JournalPosts()
|
27
|
-
pages: new JournalPages()
|
28
|
-
loft: new Loft()
|
29
|
-
settings:
|
30
|
-
menuIcon: "cog"
|
31
|
-
items:
|
32
|
-
categories: new JournalCategories()
|
33
|
-
admins: new AntsAdminUsers()
|
34
|
-
redirects: new AntsRedirects()
|
35
|
-
new AntsProfile()
|
36
|
-
).fail (response) ->
|
37
|
-
if response.status == 401
|
38
|
-
redirectToSignIn(response)
|
@@ -1,14 +0,0 @@
|
|
1
|
-
@import "chr";
|
2
|
-
@import "loft";
|
3
|
-
@import "ants";
|
4
|
-
@import "journal";
|
5
|
-
@import "font-awesome";
|
6
|
-
|
7
|
-
/* Tablet ------------------------------------------------------------------ */
|
8
|
-
@media #{$tablet} {
|
9
|
-
.menu,
|
10
|
-
.menu-posts,
|
11
|
-
.menu-settings {
|
12
|
-
margin-top: 1em;
|
13
|
-
}
|
14
|
-
}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<meta charset="utf-8">
|
5
|
-
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
|
6
|
-
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
|
8
|
-
<meta name="apple-mobile-web-app-capable" content="yes">
|
9
|
-
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
|
10
|
-
|
11
|
-
<%%= display_meta_tags site: "<%= app_name %>", title: "CMS" %>
|
12
|
-
|
13
|
-
<%%= stylesheet_link_tag :admin, media: "all" %>
|
14
|
-
<%%= csrf_meta_tags %>
|
15
|
-
</head>
|
16
|
-
|
17
|
-
<body class="<%%= body_class %>">
|
18
|
-
<%%= yield %>
|
19
|
-
</body>
|
20
|
-
|
21
|
-
</html>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module Admin
|
2
|
-
class BaseController < ActionController::Base
|
3
|
-
protect_from_forgery
|
4
|
-
before_action :authenticate_admin_user!, except: %w(index)
|
5
|
-
|
6
|
-
def index
|
7
|
-
render '/admin/index', layout: 'admin'
|
8
|
-
end
|
9
|
-
|
10
|
-
def bootstrap_data
|
11
|
-
render json: {}
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
data/templates/dev.rake
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
if Rails.env.development? || Rails.env.test?
|
2
|
-
require "factory_girl"
|
3
|
-
|
4
|
-
namespace :dev do
|
5
|
-
desc "Seed data for development environment"
|
6
|
-
task prime: "db:setup" do
|
7
|
-
include FactoryGirl::Syntax::Methods
|
8
|
-
Mongoid.purge!
|
9
|
-
AdminUser.create!(name: 'Admin', email: 'user@example.com', password: 'password')
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
@@ -1,31 +0,0 @@
|
|
1
|
-
<% set_meta_tags title: "Change Password" %>
|
2
|
-
|
3
|
-
<div class='signin-modal'>
|
4
|
-
<h2>Change password</h2>
|
5
|
-
<p class='notice'><%= notice %></p>
|
6
|
-
<p class='alert'><%= alert %></p>
|
7
|
-
|
8
|
-
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
9
|
-
<%= f.hidden_field :reset_password_token %>
|
10
|
-
|
11
|
-
<label for='admin_user_password' class='form-input input-required input-string'>
|
12
|
-
<div class='label'>
|
13
|
-
New password
|
14
|
-
<% if @minimum_password_length %>
|
15
|
-
<em>(<%= @minimum_password_length %> characters minimum)</em>
|
16
|
-
<% end %>
|
17
|
-
</div>
|
18
|
-
<%= f.password_field :password, autocomplete: "off", tabindex: 1 %>
|
19
|
-
</label>
|
20
|
-
|
21
|
-
<label for='admin_user_password_confirmation' class='form-input input-required input-string'>
|
22
|
-
<div class='label'>Confirm new password</div>
|
23
|
-
<%= f.password_field :password_confirmation, autocomplete: "off", tabindex: 2 %>
|
24
|
-
</label>
|
25
|
-
|
26
|
-
<%= devise_error_messages! %>
|
27
|
-
|
28
|
-
<%= f.submit "Change password", tabindex: 3 %>
|
29
|
-
<%= link_to "Sign In", new_session_path(resource_name) %>
|
30
|
-
<% end %>
|
31
|
-
</div>
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<% set_meta_tags title: "Reset Password" %>
|
2
|
-
|
3
|
-
<div class='signin-modal'>
|
4
|
-
<h2>Forgot your password?</h2>
|
5
|
-
<p class='notice'><%= notice %></p>
|
6
|
-
<p class='alert'><%= alert %></p>
|
7
|
-
|
8
|
-
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
9
|
-
<label for='admin_user_email' class='form-input input-required input-string'>
|
10
|
-
<div class='label'>Email</div>
|
11
|
-
<%= f.email_field :email, autofocus: true, tabindex: 1 %>
|
12
|
-
</label>
|
13
|
-
|
14
|
-
<%= devise_error_messages! %>
|
15
|
-
|
16
|
-
<%= f.submit "Reset password", tabindex: 2 %>
|
17
|
-
<%= link_to "Sign In", new_session_path(resource_name) %>
|
18
|
-
<% end %>
|
19
|
-
</div>
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Admin
|
2
|
-
class DeviseOverrides::SessionsController < Devise::SessionsController
|
3
|
-
layout 'admin'
|
4
|
-
before_filter :update_return_to, only: %w(new)
|
5
|
-
|
6
|
-
def after_sign_in_path_for(resource)
|
7
|
-
"#{admin_path}##{stored_location_for(resource)}"
|
8
|
-
end
|
9
|
-
|
10
|
-
def after_sign_out_path_for(resource)
|
11
|
-
new_admin_user_session_path
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def update_return_to
|
17
|
-
session["admin_user_return_to"] = params[:return_to]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
<% set_meta_tags title: "Sing in" %>
|
2
|
-
|
3
|
-
<div class='signin-modal'>
|
4
|
-
<h2>Sign in</h2>
|
5
|
-
<p class='notice'><%= notice %></p>
|
6
|
-
<p class='alert'><%= alert %></p>
|
7
|
-
|
8
|
-
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
9
|
-
<label for='admin_user_email' class='form-input input-required input-string'>
|
10
|
-
<div class='label'>Email</div>
|
11
|
-
<%= f.email_field :email, autofocus: true, tabindex: 1 %>
|
12
|
-
</label>
|
13
|
-
|
14
|
-
<label for='admin_user_password' class='form-input input-required input-string'>
|
15
|
-
<div class='label'>Password <%= link_to 'Forgot?', new_password_path(resource_name) %></div>
|
16
|
-
<%= f.password_field :password, autocomplete: "off", tabindex: 2 %>
|
17
|
-
</label>
|
18
|
-
|
19
|
-
<label for='admin_user_remember_me' class='form-input input-switch'>
|
20
|
-
<div class='switch'>
|
21
|
-
<%= f.check_box :remember_me, tabindex: 3 %>
|
22
|
-
<div class='checkbox'></div>
|
23
|
-
</div>
|
24
|
-
<span class='label'>Remember me</span>
|
25
|
-
</label>
|
26
|
-
|
27
|
-
<%= f.submit "Sign in", tabindex: 4 %>
|
28
|
-
<% end %>
|
29
|
-
</div>
|
data/templates/errors.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
require "net/http"
|
2
|
-
require "net/smtp"
|
3
|
-
|
4
|
-
# Example:
|
5
|
-
# begin
|
6
|
-
# some http call
|
7
|
-
# rescue *HTTP_ERRORS => error
|
8
|
-
# notify_hoptoad error
|
9
|
-
# end
|
10
|
-
|
11
|
-
HTTP_ERRORS = [
|
12
|
-
EOFError,
|
13
|
-
Errno::ECONNRESET,
|
14
|
-
Errno::EINVAL,
|
15
|
-
Net::HTTPBadResponse,
|
16
|
-
Net::HTTPHeaderSyntaxError,
|
17
|
-
Net::ProtocolError,
|
18
|
-
Timeout::Error
|
19
|
-
]
|
20
|
-
|
21
|
-
SMTP_SERVER_ERRORS = [
|
22
|
-
IOError,
|
23
|
-
Net::SMTPAuthenticationError,
|
24
|
-
Net::SMTPServerBusy,
|
25
|
-
Net::SMTPUnknownError,
|
26
|
-
TimeoutError
|
27
|
-
]
|
28
|
-
|
29
|
-
SMTP_CLIENT_ERRORS = [
|
30
|
-
Net::SMTPFatalError,
|
31
|
-
Net::SMTPSyntaxError
|
32
|
-
]
|
33
|
-
|
34
|
-
SMTP_ERRORS = SMTP_SERVER_ERRORS + SMTP_CLIENT_ERRORS
|
data/templates/json_encoding.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
ActiveSupport::JSON::Encoding.time_precision = 0
|
data/templates/puma.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server
|
2
|
-
|
3
|
-
# The environment variable WEB_CONCURRENCY may be set to a default value based
|
4
|
-
# on dyno size. To manually configure this value use heroku config:set
|
5
|
-
# WEB_CONCURRENCY.
|
6
|
-
workers Integer(ENV.fetch("WEB_CONCURRENCY", 2))
|
7
|
-
threads_count = Integer(ENV.fetch("MAX_THREADS", 2))
|
8
|
-
threads(threads_count, threads_count)
|
9
|
-
|
10
|
-
preload_app!
|
11
|
-
|
12
|
-
rackup DefaultRackup
|
13
|
-
environment ENV.fetch("RACK_ENV", "development")
|
14
|
-
|
15
|
-
on_worker_boot do
|
16
|
-
# Worker specific setup for Rails 4.1+
|
17
|
-
# See: https://devcenter.heroku.com/articles/deploying-rails-applications-with-the-puma-web-server#on-worker-boot
|
18
|
-
end
|
data/templates/routes.rb
DELETED
@@ -1,86 +0,0 @@
|
|
1
|
-
Rails.application.routes.draw do
|
2
|
-
#----------------------------------------------------------------------------
|
3
|
-
# Admin
|
4
|
-
#----------------------------------------------------------------------------
|
5
|
-
devise_for :admin_users,
|
6
|
-
path: "admin",
|
7
|
-
controllers: {
|
8
|
-
passwords: "admin/devise_overrides/passwords",
|
9
|
-
sessions: "admin/devise_overrides/sessions"
|
10
|
-
}
|
11
|
-
|
12
|
-
namespace :admin do
|
13
|
-
get "/" => "base#index"
|
14
|
-
get "/bootstrap.json" => "base#bootstrap_data"
|
15
|
-
mount_journal_posts_crud
|
16
|
-
mount_journal_pages_crud
|
17
|
-
mount_journal_categories_crud
|
18
|
-
mount_loft_assets_crud
|
19
|
-
mount_ants_admin_users_crud
|
20
|
-
mount_ants_redirects_crud
|
21
|
-
end
|
22
|
-
|
23
|
-
#----------------------------------------------------------------------------
|
24
|
-
# Application
|
25
|
-
#----------------------------------------------------------------------------
|
26
|
-
root "journal_posts#index"
|
27
|
-
mount_journal_categories
|
28
|
-
mount_journal_pages
|
29
|
-
mount_journal_posts
|
30
|
-
mount_ants_redirects
|
31
|
-
|
32
|
-
# The priority is based upon order of creation: first created -> highest priority.
|
33
|
-
# See how all your routes lay out with "rake routes".
|
34
|
-
|
35
|
-
# You can have the root of your site routed with "root"
|
36
|
-
# root 'welcome#index'
|
37
|
-
|
38
|
-
# Example of regular route:
|
39
|
-
# get 'products/:id' => 'catalog#view'
|
40
|
-
|
41
|
-
# Example of named route that can be invoked with purchase_url(id: product.id)
|
42
|
-
# get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
|
43
|
-
|
44
|
-
# Example resource route (maps HTTP verbs to controller actions automatically):
|
45
|
-
# resources :products
|
46
|
-
|
47
|
-
# Example resource route with options:
|
48
|
-
# resources :products do
|
49
|
-
# member do
|
50
|
-
# get 'short'
|
51
|
-
# post 'toggle'
|
52
|
-
# end
|
53
|
-
#
|
54
|
-
# collection do
|
55
|
-
# get 'sold'
|
56
|
-
# end
|
57
|
-
# end
|
58
|
-
|
59
|
-
# Example resource route with sub-resources:
|
60
|
-
# resources :products do
|
61
|
-
# resources :comments, :sales
|
62
|
-
# resource :seller
|
63
|
-
# end
|
64
|
-
|
65
|
-
# Example resource route with more complex sub-resources:
|
66
|
-
# resources :products do
|
67
|
-
# resources :comments
|
68
|
-
# resources :sales do
|
69
|
-
# get 'recent', on: :collection
|
70
|
-
# end
|
71
|
-
# end
|
72
|
-
|
73
|
-
# Example resource route with concerns:
|
74
|
-
# concern :toggleable do
|
75
|
-
# post 'toggle'
|
76
|
-
# end
|
77
|
-
# resources :posts, concerns: :toggleable
|
78
|
-
# resources :photos, concerns: :toggleable
|
79
|
-
|
80
|
-
# Example resource route within a namespace:
|
81
|
-
# namespace :admin do
|
82
|
-
# # Directs /admin/products/* to Admin::ProductsController
|
83
|
-
# # (app/controllers/admin/products_controller.rb)
|
84
|
-
# resources :products
|
85
|
-
# end
|
86
|
-
end
|
data/templates/sample.env
DELETED
data/templates/secrets.yml
DELETED
data/templates/smtp.rb
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
SMTP_SETTINGS = {
|
2
|
-
address: ENV.fetch("SMTP_ADDRESS"), # example: "smtp.sendgrid.net"
|
3
|
-
authentication: :plain,
|
4
|
-
domain: ENV.fetch("SMTP_DOMAIN"), # example: "heroku.com"
|
5
|
-
enable_starttls_auto: true,
|
6
|
-
password: ENV.fetch("SMTP_PASSWORD"),
|
7
|
-
port: "587",
|
8
|
-
user_name: ENV.fetch("SMTP_USERNAME")
|
9
|
-
}
|