adminsite 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/LICENSE +22 -0
- data/README.markdown +24 -60
- data/USAGE +1 -4
- data/app/assets/javascripts/adminsite/admin/code_editor.js.coffee +3 -3
- data/app/assets/javascripts/adminsite/admin/hide_and_show.js.coffee +21 -0
- data/app/assets/javascripts/adminsite/admin.js.coffee +15 -0
- data/lib/adminsite/version.rb +1 -1
- data/lib/tasks/adminsite.rake +1 -1
- metadata +13 -16
- data/MIT-LICENSE +0 -20
- data/app/assets/javascripts/adminsite/admin/hide_and_show.js +0 -26
- data/app/assets/javascripts/adminsite/admin.js +0 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e20a782c45d664867edcc78529091a1be596827
|
4
|
+
data.tar.gz: 4f13b030aa1c694eda0d51cbb6d33c9923caf943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df3ac3fbf71cd5043b04a2d49c05bb0b1e819de463355e3bd0405dd60494d7da817e5bf8b113cda56ec41f4cecef8b44022658cdc81ea05dab6138924a17de91
|
7
|
+
data.tar.gz: 299db2d537d5cfdb356b6f4540f10bcbe983e4d0cca3d77873cb2daa8f85fe8322dfb58fb52da3b36f359865a2e3d6ca2126e72531254c77a49d330ae35eb335
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
adminsite (2.0.
|
4
|
+
adminsite (2.0.1)
|
5
5
|
actionpack-page_caching
|
6
6
|
codemirror-rails (>= 4.8)
|
7
7
|
devise (~> 3.4)
|
@@ -12,7 +12,7 @@ PATH
|
|
12
12
|
kaminari (>= 0.15.0)
|
13
13
|
liquid
|
14
14
|
paperclip
|
15
|
-
rails (
|
15
|
+
rails (>= 4.1)
|
16
16
|
ransack (>= 1.3)
|
17
17
|
sass-rails
|
18
18
|
|
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 RelationshusetGekko
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.markdown
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Adminsite
|
2
2
|
=========
|
3
|
-
This is a basic
|
3
|
+
This is a basic Admin Backend interface.
|
4
4
|
|
5
5
|
This support a series of namespaced (`yoursite.com/admin/`) backend with these
|
6
6
|
features:
|
@@ -9,8 +9,7 @@ features:
|
|
9
9
|
- Simple cms for pages (handle html xml files)
|
10
10
|
- Simple cms for file assets (handles images and swf files)
|
11
11
|
- Page caching
|
12
|
-
- Protected pages (agnostic, you need to implement your `
|
13
|
-
- Mosso Cloud Files support
|
12
|
+
- Protected pages (agnostic, you need to implement your `authenticate_content_user` methods)
|
14
13
|
- Liquid template language
|
15
14
|
|
16
15
|
3 steps install
|
@@ -21,7 +20,7 @@ features:
|
|
21
20
|
|
22
21
|
2. Run
|
23
22
|
|
24
|
-
rails generate adminsite
|
23
|
+
rails generate adminsite:install
|
25
24
|
|
26
25
|
3. There is no 3
|
27
26
|
You are ready to go!
|
@@ -29,7 +28,7 @@ You are ready to go!
|
|
29
28
|
|
30
29
|
How does it work.
|
31
30
|
================
|
32
|
-
1. Start your web server (ex:
|
31
|
+
1. Start your web server (ex: `rails s`)
|
33
32
|
2. Log in at `http://localhost:3000/admin` with admin / password
|
34
33
|
3. Create a new page with:
|
35
34
|
- name: index page
|
@@ -37,56 +36,9 @@ How does it work.
|
|
37
36
|
- body: "hello world"
|
38
37
|
4. open `http://localhost:3000/`
|
39
38
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
the process including adding a new tab in the menu and needed routes.
|
44
|
-
|
45
|
-
You might want to adjust what the exports should contains,
|
46
|
-
you can define multiple style, look in the generated controllers and classes.
|
47
|
-
|
48
|
-
1. Run
|
49
|
-
|
50
|
-
`./script/generate admisite_exporter Customer`
|
51
|
-
|
52
|
-
2. Add the proper menu item in you view/admin/shared/_menu.html.haml file
|
53
|
-
|
54
|
-
`=menu\_item("Customer Exports", admin\_customer\_exports\_path)`
|
55
|
-
|
56
|
-
3. Based on you app setup you might need to add to environments.rb
|
57
|
-
|
58
|
-
`config.gem 'simple\_xlsx\_writer', :lib => 'simple\_xlsx'`
|
59
|
-
|
60
|
-
Where Customer is only an example.
|
61
|
-
|
62
|
-
Mosso Cloud Files
|
63
|
-
=================
|
64
|
-
If you want to use Mosso Cloud Files support you should add a
|
65
|
-
`config/mosso_cloudfiles.yml` that should look like this:
|
66
|
-
|
67
|
-
development:
|
68
|
-
username: circlerd
|
69
|
-
api_key: SECRET_API
|
70
|
-
test:
|
71
|
-
username: katherine
|
72
|
-
api_key: test
|
73
|
-
production:
|
74
|
-
username: circlerd
|
75
|
-
api_key: SECRET_API
|
76
|
-
|
77
|
-
`SECRET_API` is defined into the Mosso control panel and in all the projects we
|
78
|
-
have with Mosso integration (copy it from one of them).
|
79
|
-
|
80
|
-
Add this into your `config/environments/production.rb`:
|
81
|
-
|
82
|
-
PAPERCLIP_CONTAINER = "my_project_container"
|
83
|
-
|
84
|
-
Be sure that `my_project_container` exists for your account.
|
85
|
-
|
86
|
-
Add this line into your `config/environment.rb`:
|
87
|
-
|
88
|
-
gem.require 'cloudfiles'
|
89
|
-
|
39
|
+
CDN Support
|
40
|
+
============
|
41
|
+
use 'fog' with paperclip (http://fog.io, https://github.com/thoughtbot/paperclip#storage)
|
90
42
|
|
91
43
|
Protected pages
|
92
44
|
===============
|
@@ -96,7 +48,7 @@ If you want protected pages you need to add in `ApplicationController` a
|
|
96
48
|
This method should return `false` if no user is logged in or `true` if there is
|
97
49
|
a user logged in
|
98
50
|
|
99
|
-
ex. using
|
51
|
+
ex. using Devise:
|
100
52
|
|
101
53
|
def authenticate_content_user
|
102
54
|
unless current_user
|
@@ -107,16 +59,28 @@ ex. using Authlogic:
|
|
107
59
|
return true
|
108
60
|
end
|
109
61
|
|
110
|
-
def current_user
|
111
|
-
# Place you authentication code here
|
112
|
-
end
|
113
|
-
|
114
62
|
|
115
63
|
Rake Tasks
|
116
64
|
==========
|
117
65
|
The gem adds these task:
|
118
66
|
|
119
67
|
rake db:migrate
|
68
|
+
|
120
69
|
rake adminsite:create_admin
|
121
70
|
|
71
|
+
rake adminsite:seed:assets:clear
|
72
|
+
rake adminsite:seed:assets:dump
|
73
|
+
rake adminsite:seed:assets:load
|
74
|
+
rake adminsite:seed:assets:reload
|
75
|
+
|
76
|
+
rake adminsite:seed:page_layouts:clear
|
77
|
+
rake adminsite:seed:page_layouts:dump
|
78
|
+
rake adminsite:seed:page_layouts:load
|
79
|
+
rake adminsite:seed:page_layouts:reload
|
80
|
+
|
81
|
+
rake adminsite:seed:pages:clear
|
82
|
+
rake adminsite:seed:pages:dump
|
83
|
+
rake adminsite:seed:pages:load
|
84
|
+
rake adminsite:seed:pages:reload
|
85
|
+
|
122
86
|
These tasks are all executed for you by `rails g | grep adminsite`
|
data/USAGE
CHANGED
@@ -9,10 +9,7 @@ gem 'adminsite'
|
|
9
9
|
Then from your app root type:
|
10
10
|
rails generate adminsite
|
11
11
|
|
12
|
-
For
|
12
|
+
For Cloud Files integration and Protected pages
|
13
13
|
please refer to the README file in this gem root folder
|
14
14
|
|
15
|
-
Export generator is also available:
|
16
|
-
rails generate adminsite_exporter Product
|
17
|
-
|
18
15
|
************************************************************
|
@@ -13,9 +13,9 @@
|
|
13
13
|
//= require codemirror/addons/edit/matchtags
|
14
14
|
//= require codemirror/addons/edit/trailingspace
|
15
15
|
|
16
|
-
class window.
|
16
|
+
class window.Adminsite
|
17
17
|
|
18
|
-
|
18
|
+
Adminsite.initCodeEditor = ->
|
19
19
|
$("body.adminsite textarea.code.html").each ->
|
20
20
|
CodeMirror.fromTextArea $(this)[0],
|
21
21
|
mode: "text/html"
|
@@ -37,4 +37,4 @@ B56Admin.initCodeEditor = ->
|
|
37
37
|
lineNumbers: true
|
38
38
|
return
|
39
39
|
|
40
|
-
$(document).on('page:change',
|
40
|
+
$(document).on('page:change', Adminsite.initCodeEditor)
|
@@ -0,0 +1,21 @@
|
|
1
|
+
selectedRow = (param) ->
|
2
|
+
param_parent = $(param)
|
3
|
+
checkbox = param_parent.find('input.collection_selection')
|
4
|
+
param_parent.toggleClass 'selected'
|
5
|
+
if param_parent.hasClass('selected')
|
6
|
+
checkbox.prop 'checked', 'checked'
|
7
|
+
else
|
8
|
+
checkbox.prop 'checked', null
|
9
|
+
return
|
10
|
+
|
11
|
+
showSearchForm = ->
|
12
|
+
$('.search_form form').show()
|
13
|
+
$('.search_form a#show').hide()
|
14
|
+
$('.search_form a#hide').show()
|
15
|
+
return
|
16
|
+
|
17
|
+
hideSearchForm = ->
|
18
|
+
$('.search_form form').hide()
|
19
|
+
$('.search_form a#show').show()
|
20
|
+
$('.search_form a#hide').hide()
|
21
|
+
return
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
# listed below.
|
3
|
+
#
|
4
|
+
# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
# or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
+
#
|
7
|
+
# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
# compiled file.
|
9
|
+
#
|
10
|
+
# Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
+
# about supported directives.
|
12
|
+
#
|
13
|
+
#= require_tree ./admin
|
14
|
+
|
15
|
+
|
data/lib/adminsite/version.rb
CHANGED
data/lib/tasks/adminsite.rake
CHANGED
@@ -25,7 +25,7 @@ namespace :adminsite do
|
|
25
25
|
puts "e-mail: #{email}"
|
26
26
|
puts "password: #{password}"
|
27
27
|
puts ""
|
28
|
-
puts "For
|
28
|
+
puts "For Cloud Files integration and Protected pages"
|
29
29
|
puts "please refer to the README file in this gem root folder"
|
30
30
|
puts "#{'*'*70}"
|
31
31
|
end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adminsite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robin Wunderlin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '4.
|
19
|
+
version: '4.1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '4.
|
26
|
+
version: '4.1'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: actionpack-page_caching
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -220,7 +220,7 @@ dependencies:
|
|
220
220
|
- - ">="
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
|
-
description:
|
223
|
+
description: Basic Admin Backend interface for Ruby on Rails
|
224
224
|
email: robin@wunderlin.dk
|
225
225
|
executables: []
|
226
226
|
extensions: []
|
@@ -229,7 +229,7 @@ extra_rdoc_files:
|
|
229
229
|
files:
|
230
230
|
- Gemfile
|
231
231
|
- Gemfile.lock
|
232
|
-
-
|
232
|
+
- LICENSE
|
233
233
|
- README.markdown
|
234
234
|
- Rakefile
|
235
235
|
- USAGE
|
@@ -255,9 +255,9 @@ files:
|
|
255
255
|
- app/assets/images/adminsite/admin/rails.png
|
256
256
|
- app/assets/images/adminsite/admin/reorder.gif
|
257
257
|
- app/assets/images/adminsite/admin/spinner.gif
|
258
|
-
- app/assets/javascripts/adminsite/admin.js
|
258
|
+
- app/assets/javascripts/adminsite/admin.js.coffee
|
259
259
|
- app/assets/javascripts/adminsite/admin/code_editor.js.coffee
|
260
|
-
- app/assets/javascripts/adminsite/admin/hide_and_show.js
|
260
|
+
- app/assets/javascripts/adminsite/admin/hide_and_show.js.coffee
|
261
261
|
- app/assets/stylesheets/adminsite/admin.scss
|
262
262
|
- app/assets/stylesheets/adminsite/admin/base.scss
|
263
263
|
- app/assets/stylesheets/adminsite/admin/code_editor.scss
|
@@ -355,12 +355,9 @@ post_install_message: |-
|
|
355
355
|
Then from your app root type:
|
356
356
|
rails generate adminsite
|
357
357
|
|
358
|
-
For
|
358
|
+
For Cloud Files integration and Protected pages
|
359
359
|
please refer to the README file in this gem root folder
|
360
360
|
|
361
|
-
Export generator is also available:
|
362
|
-
rails generate adminsite_exporter Product
|
363
|
-
|
364
361
|
************************************************************
|
365
362
|
rdoc_options: []
|
366
363
|
require_paths:
|
@@ -369,7 +366,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
369
366
|
requirements:
|
370
367
|
- - ">="
|
371
368
|
- !ruby/object:Gem::Version
|
372
|
-
version: 2.
|
369
|
+
version: 2.0.0
|
373
370
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
374
371
|
requirements:
|
375
372
|
- - ">="
|
@@ -380,5 +377,5 @@ rubyforge_project:
|
|
380
377
|
rubygems_version: 2.2.2
|
381
378
|
signing_key:
|
382
379
|
specification_version: 4
|
383
|
-
summary:
|
380
|
+
summary: Basic Admin Backend interface for Ruby on Rails
|
384
381
|
test_files: []
|
data/MIT-LICENSE
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
Copyright (c) 2010 [name of plugin creator]
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -1,26 +0,0 @@
|
|
1
|
-
function selectedRow (param){
|
2
|
-
var param_parent = $(param);
|
3
|
-
var checkbox = param_parent.find('input.collection_selection')
|
4
|
-
param_parent.toggleClass("selected");
|
5
|
-
|
6
|
-
if (param_parent.hasClass("selected") )
|
7
|
-
{ checkbox.prop('checked','checked'); }
|
8
|
-
else
|
9
|
-
{ checkbox.prop('checked',null); }
|
10
|
-
}
|
11
|
-
|
12
|
-
function showSearchForm(){
|
13
|
-
$(".search_form form").show();
|
14
|
-
$(".search_form a#show").hide();
|
15
|
-
$(".search_form a#hide").show();
|
16
|
-
}
|
17
|
-
|
18
|
-
function hideSearchForm(){
|
19
|
-
$(".search_form form").hide();
|
20
|
-
$(".search_form a#show").show();
|
21
|
-
$(".search_form a#hide").hide();
|
22
|
-
}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree ./admin
|