bootswatch_rails 3.2.0.20 → 3.2.0.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bootswatch_rails/version.rb +1 -1
- data/lib/generators/bootswatch_rails/sorcery/templates/index.html.erb +3 -1
- data/lib/generators/bootswatch_rails/sorcery/templates/show.html.erb +3 -1
- data/lib/generators/bootswatch_rails/sorcery/templates/sorcery.de.yml +1 -0
- data/lib/generators/bootswatch_rails/sorcery/templates/users_controller.rb +4 -0
- metadata +1 -2
- data/lib/generators/bootswatch_rails/bootsy/bootsy_generator.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4be289e6c8a440064e497ac99541d16b600a3faf
|
4
|
+
data.tar.gz: 2c54b2608bc912dd4a8e083049acc2dbe21e3d46
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 304c7fbbd77765515879c7432189fd5831e3bab198638a9d5b18169e7163a0de59e37b67975faf95019c6ae6576739337d90f698dc3623efbf2efee180e28a75
|
7
|
+
data.tar.gz: 46d2b2d129e22ba7227fa60961220254996b6cbedde3e070865cbba5caa5f92b77344e0b4dcaa4507364e73a9927d46f2236a53af6c0ced74a6f064ef88d5972
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module BootswatchRails
|
2
2
|
BOOTSTRAP = "3.2.0"
|
3
|
-
VERSION = "3.2.0.
|
3
|
+
VERSION = "3.2.0.21"
|
4
4
|
THEMES = [:amelia, :cerulean, :cosmo, :custom, :cyborg, :darkly, :flatly, :journal, :lumen, :paper, :readable, :sandstone, :simplex, :slate, :spacelab, :superhero, :united, :yeti]
|
5
5
|
DEFAULT = 1
|
6
6
|
end
|
@@ -29,7 +29,9 @@
|
|
29
29
|
<br>
|
30
30
|
<%%= link_to t('actions.edit'), [:edit, <%= name %>], class: 'btn btn-default btn-xs' %>
|
31
31
|
<br>
|
32
|
-
|
32
|
+
<%%- if current_<%= name %>.status == :sysadm and <%= name %> != current_<%= name %> -%>
|
33
|
+
<%%= link_to t('actions.destroy'), <%= name %>, method: :delete, data: { confirm: t('actions.confirm') }, class: 'btn btn-danger btn-xs' %>
|
34
|
+
<%%- end -%>
|
33
35
|
</td>
|
34
36
|
</tr>
|
35
37
|
<%% end %>
|
@@ -83,4 +83,6 @@
|
|
83
83
|
|
84
84
|
<%%= link_to t('actions.edit'), [:edit, @<%= name %>], class: 'btn btn-primary' %>
|
85
85
|
<%%= link_to t('actions.back.index'), <%= table_name %>_path, class: 'btn btn-default' %>
|
86
|
-
|
86
|
+
<%%- if current_<%= name %>.status == :sysadm and @<%= name %> != current_<%= name %> -%>
|
87
|
+
<%%= link_to t('actions.destroy'), @<%= name %>, method: :delete, data: { confirm: t('actions.confirm') }, class: 'btn btn-danger' %>
|
88
|
+
<%%- end -%>
|
@@ -127,6 +127,10 @@ class <%= controller_name.camelize %> < ApplicationController
|
|
127
127
|
# DELETE /<%= table_name %>/1
|
128
128
|
# DELETE /<%= table_name %>/1.json
|
129
129
|
def destroy
|
130
|
+
if @<%= name %> == current_<%= name %> or current_<%= name %>.status != :sysadm
|
131
|
+
redirect_to root_path, alert: t('sorcery.forbidden')
|
132
|
+
return
|
133
|
+
end
|
130
134
|
@<%= name %>.destroy
|
131
135
|
respond_to do |format|
|
132
136
|
format.html { redirect_to <%= table_name %>_url, notice: t('results.deleted', name: t('activerecord.models.<%= name %>.one')) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootswatch_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.0.
|
4
|
+
version: 3.2.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Volker Wiegand
|
@@ -90,7 +90,6 @@ files:
|
|
90
90
|
- lib/bootswatch_rails.rb
|
91
91
|
- lib/bootswatch_rails/engine.rb
|
92
92
|
- lib/bootswatch_rails/version.rb
|
93
|
-
- lib/generators/bootswatch_rails/bootsy/bootsy_generator.rb
|
94
93
|
- lib/generators/bootswatch_rails/carrierwave/carrierwave_generator.rb
|
95
94
|
- lib/generators/bootswatch_rails/carrierwave/templates/carrierwave_migration.rb
|
96
95
|
- lib/generators/bootswatch_rails/carrierwave/templates/document_uploader.rb
|
@@ -1,46 +0,0 @@
|
|
1
|
-
require 'rails/generators/active_record'
|
2
|
-
|
3
|
-
module BootswatchRails
|
4
|
-
module Generators
|
5
|
-
class BootsyGenerator < ActiveRecord::Generators::Base
|
6
|
-
desc "Turn text_area(s) into bootsy_area(s)"
|
7
|
-
argument :name, type: :string,
|
8
|
-
desc: "The resource that will have bootsy_areas"
|
9
|
-
argument :columns, type: :array, banner: "COLUMN [...]",
|
10
|
-
desc: "The names of the text attributes to be converted"
|
11
|
-
class_option :before, type: :boolean, default: false,
|
12
|
-
desc: 'Add a line before generated text in model'
|
13
|
-
class_option :after, type: :boolean, default: false,
|
14
|
-
desc: 'Add a line after generated text in model'
|
15
|
-
class_option :permit, type: :boolean, default: true,
|
16
|
-
desc: 'Allow mass assignment for bootsy_image_gallery_id'
|
17
|
-
|
18
|
-
def add_to_model
|
19
|
-
inject_into_class "app/models/#{name}.rb", class_name do
|
20
|
-
text = options.before? ? "\n" : ""
|
21
|
-
text << " include Bootsy::Container\n"
|
22
|
-
text << "\n" if options.after?
|
23
|
-
text
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def add_to_permit
|
28
|
-
return unless options.permit?
|
29
|
-
text = ":bootsy_image_gallery_id"
|
30
|
-
file = "app/controllers/#{table_name}_controller.rb"
|
31
|
-
gsub_file file, /(permit\(.*)\)/, "\\1, #{text})"
|
32
|
-
# Special case: no previous permit
|
33
|
-
gsub_file file, /^(\s*params)\[:#{name}\]$/, "\\1.require(:#{name}).permit(#{text})"
|
34
|
-
end
|
35
|
-
|
36
|
-
def add_to_view
|
37
|
-
file = "app/views/#{table_name}/_form.html.erb"
|
38
|
-
columns.each do |column|
|
39
|
-
gsub_file file, /(input :#{column}) /, "\\1, as: :bootsy, input_html: { rows: 10 } "
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|