caboose-cms 0.6.22 → 0.6.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/app/assets/javascripts/caboose/product.js +4 -1
- data/app/controllers/caboose/login_logs_controller.rb +36 -8
- data/app/views/caboose/login_logs/admin_index.html.erb +35 -35
- data/app/views/caboose/users/_admin_footer.html.erb +2 -0
- data/app/views/caboose/users/_admin_header.html.erb +25 -0
- data/app/views/caboose/users/edit.html.erb +4 -3
- data/config/routes.rb +7 -0
- data/lib/caboose.rb +4 -1
- data/lib/caboose/version.rb +1 -1
- data/lib/tasks/caboose.rake +11 -5
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
N2M5ZDYwMzJmZWIwMmE0NTllOGQ1Yjk5MTI4ODhhNTU0YjZhN2NkZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmI3YjAyMDk2NThjNGFkNzliYjQ2YWRhZGZlMzM5ODBhODBkMmU5Mg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZjIxYzg3MmIyNmEyZGQxYmRhNGQ1NzFjZjA0Yzg3NzkxZDgwNjk3YmNmNGYx
|
10
|
+
YzM0MjM3MjliZjIzNGMxYzU0NDc4NTcwODc3MzE0MDVlYjIxZDY5NDU1ZmU0
|
11
|
+
NzQ5OWM2MGExZmNkZGNiMzY3ZDRhNmQ2ZDRjZjEzYjkzYmUyZDA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzUxMzMxZWQ0YzcxNTFmOTllZmE2MzI4NzE3OTc1NjA0MGYwMjM0YTEwNGVl
|
14
|
+
MmM0NzFkMzI3NGJkNzE4MjhmZGMwMDgxOTQ1ZGVlODZmMmNmYzllZTgyM2Uy
|
15
|
+
Y2Q3ZjI1ZTQ4ZTI4NThlZjQ4YTA1M2UxZWQ3MTg2MTg0NWFjYTA=
|
@@ -54,9 +54,12 @@ Caboose.Store.Modules.Product = (function() {
|
|
54
54
|
self.initalize_zoom = function(image_url) {
|
55
55
|
var big_image = $("#product-images").children("figure").first();
|
56
56
|
big_image.data("zoom-image",image_url);
|
57
|
-
|
57
|
+
try {
|
58
58
|
big_image.elevateZoom();
|
59
59
|
}
|
60
|
+
catch(err) {
|
61
|
+
console.log("Missing image zoom script.");
|
62
|
+
}
|
60
63
|
}
|
61
64
|
|
62
65
|
self.render_images = function(callback) {
|
@@ -6,12 +6,26 @@ module Caboose
|
|
6
6
|
def before_action
|
7
7
|
@page = Page.page_with_uri(request.host_with_port, '/admin')
|
8
8
|
end
|
9
|
-
|
9
|
+
|
10
10
|
# GET /admin/login-logs
|
11
|
-
def
|
12
|
-
return if !
|
13
|
-
|
14
|
-
|
11
|
+
def admin_index
|
12
|
+
return if !user_is_allowed_to 'view', 'loginlogs'
|
13
|
+
@pager = self.login_logs_pager
|
14
|
+
render :layout => 'caboose/admin'
|
15
|
+
end
|
16
|
+
|
17
|
+
# GET /admin/login-logs/json
|
18
|
+
def admin_json
|
19
|
+
return if !user_is_allowed_to 'view', 'loginlogs'
|
20
|
+
pager = self.login_logs_pager
|
21
|
+
render :json => {
|
22
|
+
:pager => pager,
|
23
|
+
:models => pager.items
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
def login_logs_pager
|
28
|
+
return Caboose::Pager.new(params, {
|
15
29
|
'site_id' => @site.id,
|
16
30
|
'username_like' => '',
|
17
31
|
'user_id' => '',
|
@@ -23,11 +37,25 @@ module Caboose
|
|
23
37
|
'model' => 'Caboose::LoginLog',
|
24
38
|
'sort' => 'date_attempted',
|
25
39
|
'desc' => false,
|
40
|
+
'items_per_page' => 100,
|
26
41
|
'base_url' => '/admin/login-logs',
|
27
42
|
'use_url_params' => false
|
28
|
-
})
|
29
|
-
|
30
|
-
|
43
|
+
})
|
44
|
+
end
|
45
|
+
|
46
|
+
# GET /admin/login-logs/:id/json
|
47
|
+
def admin_json_single
|
48
|
+
return if !user_is_allowed_to 'view', 'loginlogs'
|
49
|
+
login_log = LoginLog.find(params[:id])
|
50
|
+
render :json => login_log
|
51
|
+
end
|
52
|
+
|
53
|
+
# GET /admin/login-logs/:id
|
54
|
+
def admin_edit
|
55
|
+
return if !user_is_allowed_to 'edit', 'loginlogs'
|
56
|
+
@login_log = LoginLog.find(params[:id])
|
57
|
+
render :layout => 'caboose/admin'
|
58
|
+
end
|
31
59
|
|
32
60
|
end
|
33
61
|
end
|
@@ -1,41 +1,41 @@
|
|
1
|
-
<h1>Login Logs</h1>
|
2
|
-
|
3
|
-
<form action='/admin/users' method='get' class='search_form'>
|
4
|
-
<input type='text' name='first_name_like' value="<%= @gen.params['first_name_like'] %>" placeholder='First name' />
|
5
|
-
<input type='text' name='last_name_like' value="<%= @gen.params['last_name_like'] %>" placeholder='Last name' />
|
6
|
-
<input type='text' name='email_like' value="<%= @gen.params['email_like'] %>" placeholder='Email' />
|
7
|
-
<input type='submit' value='Search' />
|
8
|
-
</form>
|
9
|
-
|
10
|
-
<p>
|
11
|
-
<a href='/admin/users/new'>New User</a> |
|
12
|
-
<a href='/admin/users/import'>Import CSV</a>
|
13
|
-
</p>
|
14
|
-
|
15
|
-
<table class='data' id='users_table'>
|
16
|
-
<tr>
|
17
|
-
<%= raw @gen.sortable_table_headings({
|
18
|
-
'first_name' => 'First Name',
|
19
|
-
'last_name, first_name' => 'Last Name',
|
20
|
-
'username' => 'Username',
|
21
|
-
'email' => 'Email'
|
22
|
-
})
|
23
|
-
%>
|
24
|
-
</tr>
|
25
|
-
<% @users.each do |user| %>
|
26
|
-
<tr onclick="window.location='/admin/users/<%= user.id %>';">
|
27
|
-
<td><%= user.first_name %></td>
|
28
|
-
<td><%= user.last_name %></td>
|
29
|
-
<td><%= user.username %></td>
|
30
|
-
<td><%= user.email %></td>
|
31
|
-
</tr>
|
32
|
-
<% end %>
|
33
|
-
</table>
|
34
1
|
|
35
|
-
<
|
2
|
+
<h1>Login Logs</h1>
|
3
|
+
<div id='login_logs'></div>
|
36
4
|
|
37
5
|
<% content_for :caboose_js do %>
|
6
|
+
<%= javascript_include_tag 'caboose/model/all' %>
|
38
7
|
<script type='text/javascript'>
|
39
8
|
|
9
|
+
$(document).ready(function() {
|
10
|
+
var that = this;
|
11
|
+
var table = new IndexTable({
|
12
|
+
form_authenticity_token: '<%= form_authenticity_token %>',
|
13
|
+
container: 'login_logs',
|
14
|
+
base_url: '/admin/login-logs',
|
15
|
+
allow_add: false,
|
16
|
+
allow_bulk_import: false,
|
17
|
+
allow_bulk_edit: false,
|
18
|
+
allow_bulk_delete: false,
|
19
|
+
allow_duplicate: false,
|
20
|
+
allow_advanced_edit: false,
|
21
|
+
fields: [
|
22
|
+
{ show: true, name: 'username' , nice_name: 'Username' , sort: 'username' , type: 'text' , value: function(ll) { return ll.username }, width: 150, align: 'left', bulk_edit: false, editable: false },
|
23
|
+
{ show: true, name: 'user_id' , nice_name: 'User ID' , sort: 'user_id' , type: 'text' , value: function(ll) { return ll.user_id }, width: 150, align: 'left', bulk_edit: false, editable: false },
|
24
|
+
{ show: true, name: 'date_attempted' , nice_name: 'Date' , sort: 'date_attempted' , type: 'text' , value: function(ll) { return ll.date_attempted }, width: 150, align: 'left', bulk_edit: false, editable: false },
|
25
|
+
{ show: true, name: 'ip' , nice_name: 'IP Address' , sort: 'ip' , type: 'text' , value: function(ll) { return ll.ip }, width: 150, align: 'left', bulk_edit: false, editable: false },
|
26
|
+
{ show: true, name: 'success' , nice_name: 'Success' , sort: 'success' , type: 'checkbox' , value: function(ll) { return ll.success }, width: 150, align: 'left', bulk_edit: false, editable: false }
|
27
|
+
],
|
28
|
+
search_fields: [
|
29
|
+
{ name: 'username_like' , nice_name: 'Username' , type: 'text' , width: 150, align: 'left' },
|
30
|
+
{ name: 'user_id' , nice_name: 'User ID' , type: 'text' , width: 150, align: 'left' },
|
31
|
+
{ name: 'date_attempted_gte' , nice_name: 'Date Min' , type: 'text' , width: 150, align: 'left' },
|
32
|
+
{ name: 'date_attempted_lte' , nice_name: 'Date Max' , type: 'text' , width: 150, align: 'left' },
|
33
|
+
{ name: 'ip_like' , nice_name: 'IP Address' , type: 'text' , width: 150, align: 'left' },
|
34
|
+
{ name: 'success' , nice_name: 'Success' , type: 'checkbox' , width: 150, align: 'left' }
|
35
|
+
],
|
36
|
+
no_models_text: "There are no login logs right now."
|
37
|
+
});
|
38
|
+
});
|
39
|
+
|
40
40
|
</script>
|
41
|
-
<% end %>
|
41
|
+
<% end %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<% content_for :caboose_css do %>
|
2
|
+
<% end %>
|
3
|
+
<% content_for :caboose_js do %>
|
4
|
+
<%= javascript_include_tag "caboose/model/all" %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<h1>Edit Advertiser</h1>
|
8
|
+
<ul id='tabs'>
|
9
|
+
<%
|
10
|
+
tabs = {
|
11
|
+
'General' => "/admin/advertisers/#{@advertiser.id}",
|
12
|
+
'Authorize.net Info' => "/admin/advertisers/#{@advertiser.id}/authnet",
|
13
|
+
'Users' => "/admin/advertisers/#{@advertiser.id}/users",
|
14
|
+
'Campaigns' => "/admin/advertisers/#{@advertiser.id}/campaigns",
|
15
|
+
'Invoices' => "/admin/advertisers/#{@advertiser.id}/invoices",
|
16
|
+
'Delete' => "/admin/advertisers/#{@advertiser.id}/delete"
|
17
|
+
}
|
18
|
+
%>
|
19
|
+
<% tabs.each do |text, href| %>
|
20
|
+
<% selected = true if request.fullpath == href || (text != 'General' && request.fullpath.starts_with?(href)) %>
|
21
|
+
<li<% if selected %> class='selected'<% end %>><a href='<%= href %>'><%= raw text %></a></li>
|
22
|
+
<% end %>
|
23
|
+
<li class='back'><input type='button' value='< Back' onclick="window.location='/admin/advertisers';" /></li>
|
24
|
+
</ul>
|
25
|
+
<div id='content2'>
|
@@ -19,9 +19,10 @@ pic = "http://gravatar.com/avatar/#{gravatar_id}.png?s=150" #&d=/assets/caboose/
|
|
19
19
|
</div>
|
20
20
|
<div id='message'></div>
|
21
21
|
<div id='controls'>
|
22
|
-
<input type='button' value='Back'
|
23
|
-
<input type='button' value='
|
24
|
-
<input type='button' value='
|
22
|
+
<input type='button' value='Back' onclick="window.location='/admin/users';" />
|
23
|
+
<input type='button' value='Login Logs for this User' onclick="window.location='/admin/login-logs?user_id=<%= @edituser.id %>';" />
|
24
|
+
<input type='button' value='Reset Password' onclick="window.location='/admin/users/<%= @edituser.id %>/edit-password';" />
|
25
|
+
<input type='button' value='Delete User' onclick="delete_user(<%= @edituser.id %>);" />
|
25
26
|
</div>
|
26
27
|
|
27
28
|
<% content_for :caboose_css do %>
|
data/config/routes.rb
CHANGED
@@ -79,6 +79,13 @@ Caboose::Engine.routes.draw do
|
|
79
79
|
delete "/admin/sites/:site_id/domains/:id" => "domains#admin_delete"
|
80
80
|
put "/admin/sites/:site_id/domains/:id/set-primary" => "domains#admin_set_primary"
|
81
81
|
|
82
|
+
#=============================================================================
|
83
|
+
# Login Logs
|
84
|
+
#=============================================================================
|
85
|
+
|
86
|
+
get "/admin/login-logs/json" => "login_logs#admin_json"
|
87
|
+
get "/admin/login-logs" => "login_logs#admin_index"
|
88
|
+
|
82
89
|
#=============================================================================
|
83
90
|
# Store
|
84
91
|
#=============================================================================
|
data/lib/caboose.rb
CHANGED
@@ -14,7 +14,10 @@ module Caboose
|
|
14
14
|
|
15
15
|
mattr_accessor :plugins
|
16
16
|
@@plugins = ['Caboose::CorePlugin']
|
17
|
-
|
17
|
+
|
18
|
+
mattr_accessor :schemas
|
19
|
+
@@schemas = ['Caboose::Schema', 'Schema']
|
20
|
+
|
18
21
|
# Any paths to modeljs javascript files
|
19
22
|
mattr_accessor :modeljs_js_files
|
20
23
|
@@modeljs_js_files = []
|
data/lib/caboose/version.rb
CHANGED
data/lib/tasks/caboose.rake
CHANGED
@@ -151,12 +151,18 @@ namespace :caboose do
|
|
151
151
|
|
152
152
|
desc "Creates/verifies that all database tables and fields are correctly added."
|
153
153
|
task :db => :environment do
|
154
|
-
Caboose::
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
Schema.load_data
|
154
|
+
Caboose::schemas.each do |schema_class|
|
155
|
+
S = schema_class.constantize
|
156
|
+
S.create_schema
|
157
|
+
S.load_data
|
159
158
|
end
|
159
|
+
|
160
|
+
#Caboose::Schema.create_schema
|
161
|
+
#Caboose::Schema.load_data
|
162
|
+
#if class_exists?('Schema')
|
163
|
+
# Schema.create_schema
|
164
|
+
# Schema.load_data
|
165
|
+
#end
|
160
166
|
caboose_correct_sequences
|
161
167
|
end
|
162
168
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caboose-cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- William Barry
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-08-
|
11
|
+
date: 2015-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pg
|
@@ -1012,6 +1012,8 @@ files:
|
|
1012
1012
|
- app/views/caboose/store/admin_edit_payment.html.erb
|
1013
1013
|
- app/views/caboose/store/admin_edit_shipping.html.erb
|
1014
1014
|
- app/views/caboose/store/admin_edit_tax.html.erb
|
1015
|
+
- app/views/caboose/users/_admin_footer.html.erb
|
1016
|
+
- app/views/caboose/users/_admin_header.html.erb
|
1015
1017
|
- app/views/caboose/users/edit.html.erb
|
1016
1018
|
- app/views/caboose/users/edit_password.html.erb
|
1017
1019
|
- app/views/caboose/users/import_form.html.erb
|