chr 0.5.5 → 0.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/chr/app_builder.rb +0 -5
- data/lib/chr/generators/app_generator.rb +0 -1
- data/lib/chr/version.rb +1 -1
- data/templates/Gemfile.erb +6 -8
- data/templates/_analytics.html.erb +1 -9
- data/templates/_javascript.html.erb +0 -7
- data/templates/application_layout.html.erb.erb +3 -15
- data/templates/carrierwave.rb +13 -16
- data/templates/character_admin.coffee.erb +27 -12
- data/templates/character_admin.scss +11 -1
- data/templates/character_admin_index.html.erb +4 -1
- data/templates/character_admin_layout.html.erb.erb +2 -2
- data/templates/character_base_controller.rb +10 -8
- data/templates/devise_overrides_passwords_controller.rb +7 -5
- data/templates/devise_overrides_sessions_controller.rb +16 -7
- data/templates/routes.rb +21 -25
- metadata +1 -2
- data/templates/newrelic.yml.erb +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df0a116a90e5bfee90db9b7f31bcf6006f947a70
|
4
|
+
data.tar.gz: 27753496f8fa36d4c9b3318eeac2a4b2d43e3dc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 308f5c919330b3f1b1514add77307d5054b2f86cec6828e24c97b9dc01a0de1d8d85598042eef1572c4013e401b3b97dee15f2dadce21ff616effdc8805bab1a
|
7
|
+
data.tar.gz: 40bbd3d5cc4b6a7f8efcd17b907bffe61cf7e3f138a5153555607abe7ffe19391cdb71c12526a671214176a3e918fc50569d0cceb6ae5c83823838e19fccd60b
|
data/lib/chr/app_builder.rb
CHANGED
data/lib/chr/version.rb
CHANGED
data/templates/Gemfile.erb
CHANGED
@@ -9,19 +9,17 @@ gem 'jquery-rails'
|
|
9
9
|
gem 'puma'
|
10
10
|
gem 'recipient_interceptor'
|
11
11
|
gem 'rack-canonical-host'
|
12
|
-
gem 'meta-tags'
|
13
12
|
gem 'awesome_print'
|
14
13
|
gem 'bson_ext'
|
15
14
|
gem 'mongoid', '~> 5.0.0'
|
16
15
|
gem 'fog'
|
17
16
|
gem 'fog-aws'
|
18
|
-
gem '
|
19
|
-
|
20
|
-
gem '
|
21
|
-
gem '
|
22
|
-
gem '
|
23
|
-
gem '
|
24
|
-
gem 'loft'
|
17
|
+
gem 'rack-host-redirect'
|
18
|
+
gem 'mongosteen', '>= 0.2.0'
|
19
|
+
gem 'chr', '>= 0.5.6'
|
20
|
+
gem 'ants', '>= 0.3.12'
|
21
|
+
gem 'loft', '>= 0.3.1'
|
22
|
+
gem 'journal', github: 'alexkravets/journal'
|
25
23
|
|
26
24
|
group :development do
|
27
25
|
gem 'spring'
|
@@ -1,9 +1 @@
|
|
1
|
-
<%
|
2
|
-
<script type="text/javascript">
|
3
|
-
window.analytics=window.analytics||[],window.analytics.methods=["identify","group","track","page","pageview","alias","ready","on","once","off","trackLink","trackForm","trackClick","trackSubmit"],window.analytics.factory=function(t){return function(){var a=Array.prototype.slice.call(arguments);return a.unshift(t),window.analytics.push(a),window.analytics}};for(var i=0;i<window.analytics.methods.length;i++){var key=window.analytics.methods[i];window.analytics[key]=window.analytics.factory(key)}window.analytics.load=function(t){if(!document.getElementById("analytics-js")){var a=document.createElement("script");a.type="text/javascript",a.id="analytics-js",a.async=!0,a.src=("https:"===document.location.protocol?"https://":"http://")+"cdn.segment.io/analytics.js/v1/"+t+"/analytics.min.js";var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(a,n)}},window.analytics.SNIPPET_VERSION="2.0.9",
|
4
|
-
window.analytics.load("<%= ENV["SEGMENT_IO_KEY"] %>");
|
5
|
-
window.analytics.page();
|
6
|
-
</script>
|
7
|
-
<% end %>
|
8
|
-
|
9
|
-
<% # @todo: add google analytics %>
|
1
|
+
<% # @todo: add analytics scripts %>
|
@@ -2,22 +2,10 @@
|
|
2
2
|
<html>
|
3
3
|
<head>
|
4
4
|
<meta charset="utf-8" />
|
5
|
-
|
5
|
+
<!-- META TAGS ============================================================ -->
|
6
|
+
<%%= display_meta_tags %>
|
7
|
+
<!-- ====================================================================== -->
|
6
8
|
<meta name="viewport" content="initial-scale=1" />
|
7
|
-
|
8
|
-
<%%#
|
9
|
-
Configure default meta tags values, for more details see:
|
10
|
-
https://github.com/kpumuk/meta-tags
|
11
|
-
%>
|
12
|
-
<%%= display_meta_tags site: '<%= app_name %>',
|
13
|
-
description: '',
|
14
|
-
og: { site_name: '<%= app_name %>',
|
15
|
-
url: '',
|
16
|
-
title: '',
|
17
|
-
description: '',
|
18
|
-
type: 'website',
|
19
|
-
image: '' } %>
|
20
|
-
|
21
9
|
<%%= stylesheet_link_tag :application, media: "all" %>
|
22
10
|
<%%= csrf_meta_tags %>
|
23
11
|
</head>
|
data/templates/carrierwave.rb
CHANGED
@@ -1,24 +1,21 @@
|
|
1
1
|
CarrierWave.configure do |config|
|
2
|
+
config.storage = :file
|
2
3
|
config.cache_dir = "#{Rails.root}/public/uploads/tmp"
|
3
4
|
|
4
|
-
# DEVELOPMENT
|
5
|
-
if Rails.env.development?
|
6
|
-
config.storage = :file
|
7
|
-
end
|
8
|
-
|
9
|
-
# TEST
|
10
5
|
if Rails.env.test?
|
11
6
|
config.cache_dir = "#{Rails.root}/public/uploads/tmp/test"
|
12
7
|
config.enable_processing = false
|
8
|
+
end
|
13
9
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
23
20
|
end
|
24
|
-
end
|
21
|
+
end
|
@@ -4,20 +4,35 @@
|
|
4
4
|
#= require chr
|
5
5
|
#= require loft
|
6
6
|
#= require ants
|
7
|
+
#= require journal
|
7
8
|
|
8
|
-
@
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
redirects: new AntsRedirects()
|
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
15
|
|
16
|
-
|
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
|
17
21
|
|
18
22
|
$ ->
|
19
|
-
$.get
|
20
|
-
|
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()
|
23
35
|
new AntsProfile()
|
36
|
+
).fail (response) ->
|
37
|
+
if response.status == 401
|
38
|
+
redirectToSignIn(response)
|
@@ -1,4 +1,14 @@
|
|
1
1
|
@import "chr";
|
2
2
|
@import "loft";
|
3
3
|
@import "ants";
|
4
|
-
@import "
|
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
|
+
}
|
@@ -10,12 +10,12 @@
|
|
10
10
|
|
11
11
|
<%%= display_meta_tags site: "<%= app_name %>", title: "CMS" %>
|
12
12
|
|
13
|
-
<%%= csrf_meta_tags %>
|
14
13
|
<%%= stylesheet_link_tag :admin, media: "all" %>
|
14
|
+
<%%= csrf_meta_tags %>
|
15
15
|
</head>
|
16
16
|
|
17
17
|
<body class="<%%= body_class %>">
|
18
18
|
<%%= yield %>
|
19
19
|
</body>
|
20
20
|
|
21
|
-
</html>
|
21
|
+
</html>
|
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
1
|
+
module Admin
|
2
|
+
class BaseController < ActionController::Base
|
3
|
+
protect_from_forgery
|
4
|
+
before_action :authenticate_admin_user!, except: %w(index)
|
4
5
|
|
5
|
-
|
6
|
-
|
7
|
-
|
6
|
+
def index
|
7
|
+
render '/admin/index', layout: 'admin'
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
10
|
+
def bootstrap_data
|
11
|
+
render json: {}
|
12
|
+
end
|
11
13
|
end
|
12
14
|
end
|
@@ -1,9 +1,11 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module Admin
|
2
|
+
class DeviseOverrides::PasswordsController < Devise::PasswordsController
|
3
|
+
layout 'admin'
|
3
4
|
|
4
|
-
|
5
|
+
protected
|
5
6
|
|
6
|
-
|
7
|
-
|
7
|
+
def after_resetting_password_path_for(resource)
|
8
|
+
admin_path
|
9
|
+
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,11 +1,20 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
module Admin
|
2
|
+
class DeviseOverrides::SessionsController < Devise::SessionsController
|
3
|
+
layout 'admin'
|
4
|
+
before_filter :update_return_to, only: %w(new)
|
3
5
|
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
7
15
|
|
8
|
-
|
9
|
-
|
16
|
+
def update_return_to
|
17
|
+
session["admin_user_return_to"] = params[:return_to]
|
18
|
+
end
|
10
19
|
end
|
11
20
|
end
|
data/templates/routes.rb
CHANGED
@@ -1,37 +1,33 @@
|
|
1
1
|
Rails.application.routes.draw do
|
2
|
-
|
3
|
-
# App Routes
|
4
|
-
#-------------------------------------------#
|
5
|
-
|
6
|
-
|
7
|
-
#-------------------------------------------#
|
2
|
+
#----------------------------------------------------------------------------
|
8
3
|
# Admin
|
9
|
-
|
4
|
+
#----------------------------------------------------------------------------
|
10
5
|
devise_for :admin_users,
|
11
|
-
path:
|
6
|
+
path: "admin",
|
12
7
|
controllers: {
|
13
|
-
passwords:
|
14
|
-
sessions:
|
8
|
+
passwords: "admin/devise_overrides/passwords",
|
9
|
+
sessions: "admin/devise_overrides/sessions"
|
15
10
|
}
|
16
11
|
|
17
12
|
namespace :admin do
|
18
|
-
get
|
19
|
-
get
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
resources :redirects, controller: 'redirects' # Ants::Redirect
|
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
|
27
21
|
end
|
28
22
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
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
|
35
31
|
|
36
32
|
# The priority is based upon order of creation: first created -> highest priority.
|
37
33
|
# See how all your routes lay out with "rake routes".
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kravets
|
@@ -387,7 +387,6 @@ files:
|
|
387
387
|
- templates/devise_overrides_sessions_new.html.erb
|
388
388
|
- templates/errors.rb
|
389
389
|
- templates/json_encoding.rb
|
390
|
-
- templates/newrelic.yml.erb
|
391
390
|
- templates/puma.rb
|
392
391
|
- templates/routes.rb
|
393
392
|
- templates/sample.env
|
data/templates/newrelic.yml.erb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
common: &default_settings
|
2
|
-
app_name: "<%= app_name %>"
|
3
|
-
audit_log:
|
4
|
-
enabled: false
|
5
|
-
browser_monitoring:
|
6
|
-
auto_instrument: true
|
7
|
-
capture_params: false
|
8
|
-
developer_mode: false
|
9
|
-
error_collector:
|
10
|
-
capture_source: true
|
11
|
-
enabled: true
|
12
|
-
ignore_errors: "ActionController::RoutingError,Sinatra::NotFound"
|
13
|
-
license_key: "<%%= ENV["NEW_RELIC_LICENSE_KEY"] %>"
|
14
|
-
log_level: info
|
15
|
-
monitor_mode: true
|
16
|
-
transaction_tracer:
|
17
|
-
enabled: true
|
18
|
-
record_sql: obfuscated
|
19
|
-
stack_trace_threshold: 0.500
|
20
|
-
transaction_threshold: apdex_f
|
21
|
-
development:
|
22
|
-
<<: *default_settings
|
23
|
-
monitor_mode: false
|
24
|
-
developer_mode: true
|
25
|
-
test:
|
26
|
-
<<: *default_settings
|
27
|
-
monitor_mode: false
|
28
|
-
production:
|
29
|
-
<<: *default_settings
|
30
|
-
monitor_mode: true
|
31
|
-
staging:
|
32
|
-
<<: *default_settings
|
33
|
-
app_name: "<%= app_name %> (Staging)"
|
34
|
-
monitor_mode: true
|