bootswatch_rails 3.2.0.10 → 3.2.0.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Makefile +10 -4
- data/lib/bootswatch_rails/version.rb +1 -1
- data/lib/generators/bootswatch_rails/created_by/created_by_generator.rb +1 -1
- data/lib/generators/bootswatch_rails/created_by/templates/created_by_helper.rb +23 -7
- data/lib/generators/bootswatch_rails/install/templates/lib/templates/erb/scaffold/_form.html.erb +1 -0
- data/lib/generators/bootswatch_rails/install/templates/lib/templates/erb/scaffold/index.html.erb +14 -2
- data/lib/generators/bootswatch_rails/install/templates/lib/templates/erb/scaffold/show.html.erb +8 -0
- 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: d5c6154711bbb92cd3ebe2aab4d6c05ec7429918
|
4
|
+
data.tar.gz: 5be253e8c04f076e177fa0b45c9ff35040cb8100
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27b4412d15686c3d171b7a24ba1fca046cc8db835a969082dc743371afd7cfe170fa3678f922d172b0057f1ef137652496d06bbb95e755f1e7f6402077f802f2
|
7
|
+
data.tar.gz: b547102e9fc4420e8218718f4e145162af116be51d493162b5d1516897b5462fea7878b05f5d2e7eeb5d5142dac6d63ddc0aa478584d7eb31d0878e7e381dcd9
|
data/Makefile
CHANGED
@@ -3,12 +3,18 @@
|
|
3
3
|
# Makefile for building the Gem
|
4
4
|
#
|
5
5
|
|
6
|
-
all:
|
6
|
+
all: build
|
7
|
+
vim lib/bootswatch_rails/version.rb
|
8
|
+
git commit -a
|
9
|
+
rake release
|
10
|
+
|
11
|
+
install: build
|
12
|
+
git commit -a
|
13
|
+
sudo rake install
|
14
|
+
|
15
|
+
build:
|
7
16
|
./generate.sh
|
8
17
|
test -d cleditor && git add cleditor || true
|
9
18
|
git add lib
|
10
19
|
git add vendor
|
11
|
-
vim lib/bootswatch_rails/version.rb
|
12
|
-
git commit -a
|
13
|
-
rake release
|
14
20
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module BootswatchRails
|
2
|
-
VERSION = "3.2.0.
|
2
|
+
VERSION = "3.2.0.11"
|
3
3
|
THEMES = [:amelia, :cerulean, :cosmo, :custom, :cyborg, :darkly, :flatly, :journal, :lumen, :paper, :readable, :sandstone, :simplex, :slate, :spacelab, :superhero, :united, :yeti]
|
4
4
|
DEFAULT = 1
|
5
5
|
end
|
@@ -1,14 +1,30 @@
|
|
1
1
|
module CreatedByHelper
|
2
|
-
def text_created_by(model,
|
2
|
+
def text_created_by(model, action = "create", mode = "short")
|
3
3
|
begin
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
if action.include?("update")
|
5
|
+
id = model.updated_by
|
6
|
+
time = model.updated_at
|
7
|
+
else
|
8
|
+
id = model.created_by
|
9
|
+
time = model.created_at
|
10
|
+
end
|
11
|
+
user = <%= user.camelize %>.find(id)
|
7
12
|
name = user.name
|
13
|
+
email = user.email
|
8
14
|
rescue
|
9
|
-
return "
|
15
|
+
return ""
|
16
|
+
end
|
17
|
+
case mode
|
18
|
+
when "name"
|
19
|
+
name
|
20
|
+
when "email"
|
21
|
+
email
|
22
|
+
when "user"
|
23
|
+
mail_to(email, name)
|
24
|
+
when "long"
|
25
|
+
"#{mail_to(email, name)} (#{l(time)})"
|
26
|
+
else
|
27
|
+
"#{mail_to(email, name)} (#{l(time.to_date)})"
|
10
28
|
end
|
11
|
-
return name unless full
|
12
|
-
"#{mail_to(user.email, name)} (#{l(day)})"
|
13
29
|
end
|
14
30
|
end
|
data/lib/generators/bootswatch_rails/install/templates/lib/templates/erb/scaffold/_form.html.erb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
<%%= f.error_notification %>
|
3
3
|
|
4
4
|
<%- attributes.each do |attribute| -%>
|
5
|
+
<%- next if [ "created_by", "updated_by" ].include? attribute.name -%>
|
5
6
|
<%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
|
6
7
|
<%- if attribute.name.include?("picture") -%>
|
7
8
|
<%%= f.input :<%= attribute.name %>_cache, as: :hidden %>
|
data/lib/generators/bootswatch_rails/install/templates/lib/templates/erb/scaffold/index.html.erb
CHANGED
@@ -4,9 +4,17 @@
|
|
4
4
|
<thead>
|
5
5
|
<tr>
|
6
6
|
<% attributes.each do |attribute| -%>
|
7
|
-
<th
|
7
|
+
<th>
|
8
|
+
<%- if [ "created_by", "updated_by" ].include? attribute.name -%>
|
9
|
+
<%%= t('activerecord.attributes.<%= attribute.name %>') %>
|
10
|
+
<%- else -%>
|
11
|
+
<%%= t('activerecord.attributes.<%= singular_table_name %>.<%= attribute.name %>') %>
|
12
|
+
<%- end -%>
|
13
|
+
</th>
|
8
14
|
<% end -%>
|
9
|
-
<th class="index-actions"
|
15
|
+
<th class="index-actions">
|
16
|
+
<%%= t('actions.title') %>
|
17
|
+
</th>
|
10
18
|
</tr>
|
11
19
|
</thead>
|
12
20
|
|
@@ -21,6 +29,10 @@
|
|
21
29
|
<%%= <%= singular_table_name %>.<%= attribute.name %> ? t('simple_form.yes') : t('simple_form.no') %>
|
22
30
|
<%- elsif attribute.type == :belongs_to -%>
|
23
31
|
<%%= <%= singular_table_name %>.<%= attribute.name %>.name %>
|
32
|
+
<%- elsif attribute.name == "created_by" -%>
|
33
|
+
<%%= raw(text_created_by(<%= singular_table_name %>, "create")) %>
|
34
|
+
<%- elsif attribute.name == "updated_by" -%>
|
35
|
+
<%%= raw(text_created_by(<%= singular_table_name %>, "update")) %>
|
24
36
|
<%- else -%>
|
25
37
|
<%%= <%= singular_table_name %>.<%= attribute.name %> %>
|
26
38
|
<%- end -%>
|
data/lib/generators/bootswatch_rails/install/templates/lib/templates/erb/scaffold/show.html.erb
CHANGED
@@ -5,7 +5,11 @@
|
|
5
5
|
<% attributes.each do |attribute| -%>
|
6
6
|
<tr>
|
7
7
|
<td>
|
8
|
+
<%- if [ "created_by", "updated_by" ].include? attribute.name -%>
|
9
|
+
<%%= t('activerecord.attributes.<%= attribute.name %>') %>
|
10
|
+
<%- else -%>
|
8
11
|
<%%= t('activerecord.attributes.<%= singular_table_name %>.<%= attribute.name %>') %>
|
12
|
+
<%- end -%>
|
9
13
|
</td>
|
10
14
|
<td>
|
11
15
|
<%- if attribute.name.include?("picture") -%>
|
@@ -17,6 +21,10 @@
|
|
17
21
|
<%%= @<%= singular_table_name %>.<%= attribute.name %> ? t('simple_form.yes') : t('simple_form.no') %>
|
18
22
|
<%- elsif attribute.type == :belongs_to -%>
|
19
23
|
<%%= @<%= singular_table_name %>.<%= attribute.name %>.name %>
|
24
|
+
<%- elsif attribute.name == "created_by" -%>
|
25
|
+
<%%= raw(text_created_by(@<%= singular_table_name %>, "create")) %>
|
26
|
+
<%- elsif attribute.name == "updated_by" -%>
|
27
|
+
<%%= raw(text_created_by(@<%= singular_table_name %>, "update")) %>
|
20
28
|
<%- else -%>
|
21
29
|
<%%= @<%= singular_table_name %>.<%= attribute.name %> %>
|
22
30
|
<%- end -%>
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
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.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Volker Wiegand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|