tb_core 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/admin/user_sessions_controller.rb +1 -1
- data/app/helpers/twice_baked/application_helper.rb +7 -2
- data/app/views/admin/users/index.html.erb +1 -1
- data/lib/generators/spud/templates/views/admin/_form.html.erb +1 -1
- data/lib/spud_core/configuration.rb +15 -0
- data/lib/spud_core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a641b08c309d6355240a0cb59dec84b96552572
|
4
|
+
data.tar.gz: 96c0a3a67b8df216c83c695bddc5111f0239ece1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7eacaae333704ced506a7d920ac533c818460237cbf60f06698bf993e142c5d59e0d85d7478da2e470e2ceee7ca7b20a3ac3a2039865530cbcfca72a32dfdd9d
|
7
|
+
data.tar.gz: c5de32f69349861b4672df836ecbe24179f33c1c1cf55d968fac1171c3c6ff4728899c23b7ee372d73e4b2738038299e1a3412c081ac61831b713ee7575847cf
|
@@ -24,7 +24,7 @@ class Admin::UserSessionsController < Admin::ApplicationController
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def destroy
|
27
|
-
current_user_session.destroy
|
27
|
+
current_user_session.destroy unless current_user_session.blank?
|
28
28
|
flash[:notice] = "Logout successful!"
|
29
29
|
redirect_to admin_login_path
|
30
30
|
end
|
@@ -1,11 +1,16 @@
|
|
1
1
|
module TwiceBaked::ApplicationHelper
|
2
2
|
|
3
|
-
def tb_form_errors(record)
|
3
|
+
def tb_form_errors(record, *fields_to_display)
|
4
4
|
if record.errors.any?
|
5
5
|
content_tag :div, :class => 'form-errors' do
|
6
6
|
concat(tb_form_error_header(record))
|
7
7
|
concat(raw "<ul>")
|
8
|
-
|
8
|
+
if fields_to_display.any?
|
9
|
+
messages = fields_to_display.collect{ |field| record.errors.full_messages_for(field) }.flatten()
|
10
|
+
else
|
11
|
+
messages = record.errors.full_messages
|
12
|
+
end
|
13
|
+
concat(raw messages.collect{ |msg| "<li>#{msg}</li>" }.join())
|
9
14
|
concat(raw "</ul>")
|
10
15
|
end
|
11
16
|
end
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<td class="table-actions">
|
24
24
|
<%= link_to 'Details', admin_user_path(spud_user), :class => 'btn btn-default btn-sm' %>
|
25
25
|
<%= link_to 'Edit', edit_admin_user_path(spud_user), :class => 'btn btn-default btn-sm' %>
|
26
|
-
<%= link_to 'Delete', admin_user_path(spud_user), :method => :delete, :data => {:confirm => 'Are you sure you want to delete this
|
26
|
+
<%= link_to 'Delete', admin_user_path(spud_user), :method => :delete, :data => {:confirm => 'Are you sure you want to delete this user?'}, :class => 'btn btn-danger btn-sm' %>
|
27
27
|
</td>
|
28
28
|
</tr>
|
29
29
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<%%= form_for [:admin, @<%=module_name_formatted.singularize%>], :builder => TbCore::FormBuilder, :html => {:class => 'form-horizontal'} do |f| %>
|
2
2
|
|
3
|
-
<%%=
|
3
|
+
<%%= tb_form_errors(f.object, :base) %>
|
4
4
|
<%- attributes.collect{ |att| att.split(':') }.each do |arg_0, arg_1| %>
|
5
5
|
<%= field_for_attribute(arg_1, arg_0) %>
|
6
6
|
<%- end %>
|
@@ -17,6 +17,21 @@ module Spud
|
|
17
17
|
self.production_alert_domain = nil
|
18
18
|
self.use_email_as_login = false
|
19
19
|
|
20
|
+
def self.site_config_for_host(host)
|
21
|
+
ActiveSupport::Deprecation.warn 'Spud::Core.site_config_for_host is deprecated and will be removed in the future'
|
22
|
+
return default_site_config
|
23
|
+
end
|
24
|
+
|
25
|
+
def self.site_config_for_id(id)
|
26
|
+
ActiveSupport::Deprecation.warn 'Spud::Core.site_config_for_id is deprecated and will be removed in the future'
|
27
|
+
return default_site_config
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.default_site_config
|
31
|
+
ActiveSupport::Deprecation.warn 'Spud::Core.default_site_config is deprecated and will be removed in the future'
|
32
|
+
return {:site_id => Spud::Core.config.site_id, :site_name => Spud::Core.config.site_name, :short_name => Spud::Core.config.short_name}
|
33
|
+
end
|
34
|
+
|
20
35
|
def self.append_admin_javascripts(*args)
|
21
36
|
if args[0].class == Array
|
22
37
|
Spud::Core.config.admin_javascripts += args[0]
|
data/lib/spud_core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tb_core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Woods
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|