bootswatch_rails 3.2.0.8 → 3.2.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b52c84f40d30196bf1b3d8fea4072ff6f5597f5f
4
- data.tar.gz: c35a28d8c46a6bd2370a08842763793ad1084c47
3
+ metadata.gz: 5c29af7c2c41bffd6146e9fd4e726aa6202cc830
4
+ data.tar.gz: dae74081c4ff90d6fe2248ed5451f13864830724
5
5
  SHA512:
6
- metadata.gz: 33469e37ee41c95b527877219af37ce101f95d0ab1be396185d4b58ec5ea4524fc93c31c8f6347f567f4555cd5dff5bc18a0c91a58a1a19568702881c325607e
7
- data.tar.gz: ac6c12f65cf5547e8d08ad5658f83a4bbef102f98c1e6887961cf13a36a712f08a7facc273acb86816a7091146d6413954dde1a2e6cdd64cd2179af810088abe
6
+ metadata.gz: 3f2f02a86545e79db91a55b1d00c5ea9f183becdefe5753dedeecb5f12bccf5556991c176a2e00c3c1943e332aebc95a5b4c3563bcacd3c0b74be1349e0ec35c
7
+ data.tar.gz: 3af828a7d06e3325db033bc46841c054ff03dc21aba31c363b90a5c9a514db03eeca390a30f7e4e9c079a02157115d1b6f468d3a61cc23da794f7f77ef3fd68d
@@ -1,5 +1,5 @@
1
1
  module BootswatchRails
2
- VERSION = "3.2.0.8"
2
+ VERSION = "3.2.0.9"
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
@@ -0,0 +1,42 @@
1
+ require 'rails/generators/active_record'
2
+
3
+ module BootswatchRails
4
+ module Generators
5
+ class CreatedByGenerator < ActiveRecord::Generators::Base
6
+ desc "Add created_by and updated_by to resource"
7
+ argument :name, type: :string,
8
+ desc: "The resource to be updated"
9
+ argument :user, type: :string, default: "user",
10
+ banner: "user model (default 'user')"
11
+ class_option :migration, type: :boolean, default: true,
12
+ desc: 'Create a migration for added attributes'
13
+ source_root File.expand_path('../templates', __FILE__)
14
+
15
+ def add_migration
16
+ return unless options.migration?
17
+ migration_template 'created_by_migration.rb', "db/migrate/#{migration_name}.rb"
18
+ end
19
+
20
+ def add_helper
21
+ copy_file "created_by_helper.rb", "app/helpers/created_by_helper.rb"
22
+ end
23
+
24
+ def update_controller
25
+ file = "app/controllers/#{table_name}_controller.rb"
26
+ inject_into_file file, after: /def update$/ do
27
+ "\n @#{name}.updated_by = current_#{user}.id if current_#{user}"
28
+ end
29
+ inject_into_file file, after: /@#{name} = #{class_name}\.new\(#{name}_params\)$/ do
30
+ "\n @#{name}.created_by = current_#{user}.id if current_#{user}" +
31
+ "\n @#{name}.updated_by = current_#{user}.id if current_#{user}"
32
+ end
33
+ end
34
+
35
+ protected
36
+
37
+ def migration_name
38
+ "add_created_by_to_#{name}"
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,14 @@
1
+ module CreatedByHelper
2
+ def text_created_by(model, mode = "create", full = true)
3
+ begin
4
+ id = model.send("#{mode}d_by")
5
+ day = model.send("#{mode}d_at").to_date
6
+ user = User.find(id)
7
+ name = user.name
8
+ rescue
9
+ return "???"
10
+ end
11
+ return name unless full
12
+ "#{mail_to(user.email, name)} (#{l(day)})"
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ class <%= migration_name.camelize %> < ActiveRecord::Migration
2
+ def change
3
+ add_column :<%= table_name %>, :created_by, :integer
4
+ add_column :<%= table_name %>, :updated_by, :integer
5
+ end
6
+ end
@@ -5576,7 +5576,7 @@ button.close {
5576
5576
  max-width: 276px;
5577
5577
  padding: 1px;
5578
5578
  text-align: left;
5579
- background-color: #ffffff;
5579
+ background-color: #13a0aa;
5580
5580
  background-clip: padding-box;
5581
5581
  border: 1px solid #cccccc;
5582
5582
  border: 1px solid rgba(0, 0, 0, 0.2);
@@ -5603,8 +5603,8 @@ button.close {
5603
5603
  font-size: 14px;
5604
5604
  font-weight: normal;
5605
5605
  line-height: 18px;
5606
- background-color: #f7f7f7;
5607
- border-bottom: 1px solid #ebebeb;
5606
+ background-color: #11939c;
5607
+ border-bottom: 1px solid #0e7d85;
5608
5608
  border-radius: 5px 5px 0 0;
5609
5609
  }
5610
5610
  .popover-content {
@@ -5639,7 +5639,7 @@ button.close {
5639
5639
  bottom: 1px;
5640
5640
  margin-left: -10px;
5641
5641
  border-bottom-width: 0;
5642
- border-top-color: #ffffff;
5642
+ border-top-color: #13a0aa;
5643
5643
  }
5644
5644
  .popover.right > .arrow {
5645
5645
  top: 50%;
@@ -5654,7 +5654,7 @@ button.close {
5654
5654
  left: 1px;
5655
5655
  bottom: -10px;
5656
5656
  border-left-width: 0;
5657
- border-right-color: #ffffff;
5657
+ border-right-color: #13a0aa;
5658
5658
  }
5659
5659
  .popover.bottom > .arrow {
5660
5660
  left: 50%;
@@ -5669,7 +5669,7 @@ button.close {
5669
5669
  top: 1px;
5670
5670
  margin-left: -10px;
5671
5671
  border-top-width: 0;
5672
- border-bottom-color: #ffffff;
5672
+ border-bottom-color: #13a0aa;
5673
5673
  }
5674
5674
  .popover.left > .arrow {
5675
5675
  top: 50%;
@@ -5683,7 +5683,7 @@ button.close {
5683
5683
  content: " ";
5684
5684
  right: 1px;
5685
5685
  border-right-width: 0;
5686
- border-left-color: #ffffff;
5686
+ border-left-color: #13a0aa;
5687
5687
  bottom: -10px;
5688
5688
  }
5689
5689
  .carousel {
@@ -6284,6 +6284,3 @@ a.thumbnail:focus,
6284
6284
  a.thumbnail.active {
6285
6285
  border-color: #0d747c;
6286
6286
  }
6287
- .popover {
6288
- color: #444444;
6289
- }
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.8
4
+ version: 3.2.0.9
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-20 00:00:00.000000000 Z
11
+ date: 2014-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -96,6 +96,9 @@ files:
96
96
  - lib/generators/bootswatch_rails/carrierwave/templates/document_uploader.rb
97
97
  - lib/generators/bootswatch_rails/carrierwave/templates/picture_uploader.rb
98
98
  - lib/generators/bootswatch_rails/cleditor/cleditor_generator.rb
99
+ - lib/generators/bootswatch_rails/created_by/created_by_generator.rb
100
+ - lib/generators/bootswatch_rails/created_by/templates/created_by_helper.rb
101
+ - lib/generators/bootswatch_rails/created_by/templates/created_by_migration.rb
99
102
  - lib/generators/bootswatch_rails/install/install_generator.rb
100
103
  - lib/generators/bootswatch_rails/install/templates/app/assets/images/Rails_logo_80.jpg
101
104
  - lib/generators/bootswatch_rails/install/templates/app/helpers/application_helper.rb