tanraya-playmo 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. data/lib/tanraya-playmo.rb +1 -1
  2. data/lib/tanraya_playmo/version.rb +1 -1
  3. data/recipes/appgems_recipe.rb +33 -0
  4. data/recipes/assets_paths_recipe.rb +20 -0
  5. data/recipes/csv_recipe.rb +11 -0
  6. data/recipes/devise_views_recipe.rb +10 -0
  7. data/{lib/tanraya_playmo/recipes → recipes}/dragonfly_recipe.rb +49 -8
  8. data/recipes/kaminari_recipe.rb +13 -0
  9. data/recipes/mailer_layout_recipe.rb +8 -0
  10. data/recipes/tableless_recipe.rb +11 -0
  11. data/recipes/templates/devise_views_recipe/locales/devise.ru.yml +60 -0
  12. data/recipes/templates/devise_views_recipe/views/devise/confirmations/new.html.erb +9 -0
  13. data/recipes/templates/devise_views_recipe/views/devise/mailer/confirmation_instructions.html.erb +10 -0
  14. data/recipes/templates/devise_views_recipe/views/devise/mailer/reset_password_instructions.html.erb +7 -0
  15. data/recipes/templates/devise_views_recipe/views/devise/mailer/unlock_instructions.html.erb +7 -0
  16. data/recipes/templates/devise_views_recipe/views/devise/passwords/edit.html.erb +11 -0
  17. data/recipes/templates/devise_views_recipe/views/devise/passwords/new.html.erb +9 -0
  18. data/recipes/templates/devise_views_recipe/views/devise/registrations/done.html.erb +3 -0
  19. data/recipes/templates/devise_views_recipe/views/devise/registrations/edit.html.erb +22 -0
  20. data/recipes/templates/devise_views_recipe/views/devise/registrations/new.html.erb +10 -0
  21. data/recipes/templates/devise_views_recipe/views/devise/sessions/new.html.erb +15 -0
  22. data/recipes/templates/devise_views_recipe/views/devise/shared/_links.erb +27 -0
  23. data/recipes/templates/devise_views_recipe/views/devise/unlocks/new.html.erb +15 -0
  24. data/recipes/templates/kaminari_recipe/kaminari.ru.yml +8 -0
  25. data/recipes/templates/kaminari_recipe/views/kaminari/_first_page.html.erb +11 -0
  26. data/recipes/templates/kaminari_recipe/views/kaminari/_gap.html.erb +8 -0
  27. data/recipes/templates/kaminari_recipe/views/kaminari/_last_page.html.erb +11 -0
  28. data/recipes/templates/kaminari_recipe/views/kaminari/_next_page.html.erb +11 -0
  29. data/recipes/templates/kaminari_recipe/views/kaminari/_page.html.erb +20 -0
  30. data/recipes/templates/kaminari_recipe/views/kaminari/_paginator.html.erb +25 -0
  31. data/recipes/templates/kaminari_recipe/views/kaminari/_prev_page.html.erb +11 -0
  32. data/recipes/templates/mailer_layout_recipe/mailer.html.erb +14 -0
  33. data/recipes/templates/tableless_recipe/tableless.rb +15 -0
  34. data/tanraya-playmo.gemspec +0 -1
  35. metadata +36 -17
@@ -9,5 +9,5 @@ module TanrayaPlaymo
9
9
  #cookbook.delete_all
10
10
 
11
11
  # Load custom recipes
12
- Dir["#{File.dirname(__FILE__)}/tanraya_playmo/recipes/*_recipe.rb"].each { |f| require f }
12
+ Dir["#{File.dirname(__FILE__)}/../recipes/*_recipe.rb"].each { |f| require f }
13
13
  end
@@ -1,3 +1,3 @@
1
1
  module TanrayaPlaymo
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -0,0 +1,33 @@
1
+ recipe :appgems do
2
+ description 'This will add necessary gems into your app'
3
+ after :dragonfly
4
+
5
+ silenly do
6
+ # see https://github.com/sj26/mailcatcher
7
+ gem 'mailcatcher', '0.5.1', :group => :development
8
+
9
+ # see https://github.com/yaroslav/russian
10
+ gem 'russian', '0.6.0'
11
+
12
+ # see https://github.com/hallelujah/valid_email
13
+ gem 'valid_email', '0.0.4'
14
+
15
+ # see https://github.com/kaize/configus
16
+ gem 'configus', '0.0.2'
17
+
18
+ # see https://github.com/amatsuda/i18n_generators
19
+ gem 'i18n_generators', '1.1.0'
20
+
21
+ # see https://github.com/mbleigh/seed-fu
22
+ gem 'seed-fu', '2.2.0', :group => :development
23
+
24
+ # see https://github.com/pry/pry/
25
+ gem 'pry', '0.9.8'
26
+
27
+ # Move sass-rails out of the group assets (Rails 3.1.3)
28
+ # TODO: Check it on Rails 3.2
29
+ gsub_file 'Gemfile', /^\s{2}gem 'sass-rails'.+$/, ''
30
+ gem 'sass-rails', '3.1.5'
31
+ end
32
+ end
33
+
@@ -0,0 +1,20 @@
1
+ recipe :assets_paths do
2
+ description 'This will setup additional assets paths in your app'
3
+ after :devise_views
4
+
5
+ ask "Would you like to setup assets paths to vendor/ and lib/ in this project?" do
6
+ inject_into_file "config/application.rb", :after => "class Application < Rails::Application\n" do
7
+ <<-CONTENT.gsub(/^ {4}/, '')
8
+
9
+ # Setup additional assets paths (lib/ and vendor/)
10
+ [:lib, :vendor].each do |dir|
11
+ [:stylesheets, :javascripts, :images].each do |asset_type|
12
+ config.sass.load_paths << Rails.root.join(dir, 'assets', asset_type)
13
+ end
14
+ end
15
+
16
+ CONTENT
17
+ end
18
+ end
19
+ end
20
+
@@ -0,0 +1,11 @@
1
+ recipe :csv do
2
+ description 'This will add client_side_validations into your app'
3
+ after :kaminari
4
+
5
+ ask "Would you like to use client_side_validations in this project?" do
6
+ # see https://github.com/bcardarella/client_side_validations
7
+ gem 'client_side_validations', '3.1.4'
8
+
9
+ end
10
+ end
11
+
@@ -0,0 +1,10 @@
1
+ recipe :devise_views do
2
+ description 'This will add customized Devise views into your app'
3
+ after :mailer_layout
4
+
5
+ silenly do
6
+ remove_directory 'app/views/devise'
7
+ copy_directory 'views/devise', 'app/views/devise'
8
+ end
9
+ end
10
+
@@ -1,9 +1,10 @@
1
1
  recipe :dragonfly do
2
- description 'This will add Dragondly gem into your app'
3
- after :rails
2
+ description 'This will add Dragonfly gem into your app'
3
+ after :capistrano
4
4
 
5
5
  ask "Would you like to use Dragonfly in this project?" do
6
- gem "dragonfly"
6
+ gem 'dragonfly', '~>0.9.10'
7
+ gem 'rack-cache', :require => 'rack/cache'
7
8
 
8
9
  # Create initializer
9
10
  create_file 'config/initializers/dragonfly.rb', <<-CONTENT.gsub(/^ {6}/, '')
@@ -11,9 +12,9 @@ recipe :dragonfly do
11
12
  CONTENT
12
13
 
13
14
  # Create Image model?
14
- ask "Create polymorphic Image model?" do
15
+ #ask "Create polymorphic Image model?" do
15
16
  # Create migration
16
- filename = "db/migrate/#{(Time.now - 3600).strftime("%Y%m%d%H%M%S")}_create_images.rb"
17
+ filename = "db/migrate/#{(Time.now).strftime("%Y%m%d%H%M%S")}_create_images.rb"
17
18
 
18
19
  create_file filename, <<-CONTENT.gsub(/^ {8}/, '')
19
20
  class CreateImages < ActiveRecord::Migration
@@ -55,6 +56,10 @@ recipe :dragonfly do
55
56
  class Image < ActiveRecord::Base
56
57
  ALLOWED_MIME_TYPES = ['image/jpeg', 'image/jpg', 'image/png', 'image/gif']
57
58
  ALLOWED_EXTENSIONS = [:jpeg, :jpg, :png, :JPEG, :JPG, :PNG]
59
+
60
+ # Image width and height
61
+ WIDTH = (150..3000)
62
+ HEIGHT = (150..3000)
58
63
 
59
64
  belongs_to :imageable, :polymorphic => true
60
65
  image_accessor :image # accessor to image_uid
@@ -66,12 +71,48 @@ recipe :dragonfly do
66
71
  # see: github.com/markevans/dragonfly
67
72
  validates_property :format, :of => :image, :in => ALLOWED_EXTENSIONS
68
73
  validates_property :mime_type, :of => :image, :in => ALLOWED_MIME_TYPES
69
- validates_property :width, :of => :image, :in => (150..3000)
70
- validates_property :height, :of => :image, :in => (150..3000)
74
+ validates_property :width, :of => :image, :in => WIDTH
75
+ validates_property :height, :of => :image, :in => HEIGHT
71
76
 
72
77
  default_scope order(:updated_at)
73
78
  end
74
79
  CONTENT
75
- end
80
+
81
+ # TODO Add this into deploy.rb
82
+ install do
83
+ gsub_file 'config/deploy.rb', 'namespace :db do' do
84
+ <<-CONTENT.gsub(/^ {12}/, '')
85
+ namespace :db do
86
+
87
+ namespace :dragonfly do
88
+ desc "Symlink the Rack::Cache files"
89
+ task :symlink, :roles => [:app] do
90
+ run "mkdir -p \#{shared_path}/tmp/dragonfly && ln -nfs \#{shared_path}/tmp/dragonfly \#{release_path}/tmp/dragonfly"
91
+ end
92
+ end
93
+
94
+ after 'deploy:update_code', 'dragonfly:symlink'
95
+ CONTENT
96
+
97
+ append_file 'db/seebs.rb' do
98
+ <<-CONTENT.gsub(/^ {12}/, '')
99
+
100
+ # Example of how to add images to imageable model:
101
+ # def read_photo(photo)
102
+ # return File.open(File.join(File.dirname(__FILE__), "seeds", "photos", photo), "rb")
103
+ # end
104
+
105
+ # u = Consultor.create!({:email => 'ohlobystin@example.com', :password => 'secret', :password_confirmation => 'secret'})
106
+ # u.build_profile({:name => 'Иван Охлобыстин', :image_attributes => { :image => read_photo('ohlobystin.jpg')}})
107
+ # u.roles << consultor_role
108
+ # u.save!
109
+
110
+ CONTENT
111
+ end
112
+ end
113
+
114
+ end
115
+
116
+ #end
76
117
  end
77
118
  end
@@ -0,0 +1,13 @@
1
+ recipe :kaminari do
2
+ description 'This will add Kaminari pagination into your app'
3
+ after :assets_paths
4
+
5
+ ask "Would you like to use Kaminari pagination in this project?" do
6
+ # see https://github.com/amatsuda/kaminari
7
+ gem 'kaminari', '0.13.0'
8
+
9
+ copy_directory 'views/kaminari', 'app/views/kaminari'
10
+ copy_file 'kaminari.ru.yml', 'config/locales/kaminari.ru.yml'
11
+ end
12
+ end
13
+
@@ -0,0 +1,8 @@
1
+ recipe :mailer_layout do
2
+ description 'This will add mailer layout into your app'
3
+ after :tableless
4
+
5
+ silenly do
6
+ copy_file 'mailer.html.erb', 'app/views/layouts/mailer.html.erb'
7
+ end
8
+ end
@@ -0,0 +1,11 @@
1
+ recipe :tableless do
2
+ description 'This will add tableless model into your app'
3
+ after :appgems
4
+
5
+ silenly do
6
+ empty_dir 'lib/models'
7
+ copy_file 'tableless.rb', 'lib/models/tableless.rb'
8
+ end
9
+ end
10
+
11
+
@@ -0,0 +1,60 @@
1
+ # Русский перевод для https://github.com/plataformatec/devise/tree/v1.4.2
2
+ # Другие переводы на https://github.com/plataformatec/devise/wiki/I18n
3
+
4
+ ru:
5
+ errors:
6
+ messages:
7
+ expired: "устарела. Пожалуйста, запросите новую"
8
+ not_found: "не найдена"
9
+ already_confirmed: "уже подтверждена. Пожалуйста, попробуйте войти в систему"
10
+ not_locked: "не заблокирована"
11
+ not_saved:
12
+ one: "%{resource}: сохранение не удалось из-за %{count} ошибки"
13
+ few: "%{resource}: сохранение не удалось из-за %{count} ошибок"
14
+ many: "%{resource}: сохранение не удалось из-за %{count} ошибок"
15
+ other: "%{resource}: сохранение не удалось из-за %{count} ошибки"
16
+
17
+ devise:
18
+ failure:
19
+ already_authenticated: "Вы уже вошли в систему."
20
+ unauthenticated: "Вам необходимо войти в систему или зарегистрироваться."
21
+ unconfirmed: "Вы должны подтвердить вашу учётную запись."
22
+ locked: "Ваша учётная запись заблокирована."
23
+ invalid: "Неверный адрес e-mail или пароль."
24
+ invalid_token: "Неверный ключ аутентификации."
25
+ timeout: "Ваш сеанс закончился. Пожалуйста, войдите в систему снова."
26
+ inactive: "Ваша учётная запись ещё не активирована."
27
+ sessions:
28
+ signed_in: "Вход в систему выполнен."
29
+ signed_out: "Выход из системы выполнен."
30
+ passwords:
31
+ send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по восстановлению вашего пароля."
32
+ updated: "Ваш пароль изменён. Теперь вы вошли в систему."
33
+ send_paranoid_instructions: "Если ваш адрес e-mail есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по восстановлению вашего пароля."
34
+ confirmations:
35
+ send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
36
+ send_paranoid_instructions: "Если ваш адрес e-mail есть в нашей базе данных, то в течение нескольких минут вы получите письмо с инструкциями по подтверждению вашей учётной записи."
37
+ confirmed: "Ваша учётная запись подтверждена. Теперь вы вошли в систему."
38
+ registrations:
39
+ signed_up: "Добро пожаловать! Вы успешно зарегистрировались."
40
+ inactive_signed_up: "Добро пожаловать! Вы успешно зарегистрировались. Но пока вы не можете войти в систему, т.к. ваша учётная запись %{reason}."
41
+ updated: "Ваша учётная запись изменена."
42
+ destroyed: "До свидания! Ваша учётная запись удалена. Надеемся снова увидеть вас."
43
+ reasons:
44
+ inactive: 'не активна'
45
+ unconfirmed: 'не подтверждена'
46
+ locked: 'заблокирована'
47
+ unlocks:
48
+ send_instructions: "В течение нескольких минут вы получите письмо с инструкциями по разблокировке вашей учётной записи."
49
+ unlocked: "Ваша учётная запись разблокирована. Теперь вы вошли в систему."
50
+ send_paranoid_instructions: "Если ваша учётная запись существует, то в течение нескольких минут вы получите письмо с инструкциями по её разблокировке."
51
+ omniauth_callbacks:
52
+ success: "Вход в систему выполнен с учётной записью из %{kind}."
53
+ failure: "Вы не можете войти в систему с учётной записью из %{kind}, т.к. \"%{reason}\"."
54
+ mailer:
55
+ confirmation_instructions:
56
+ subject: "Инструкции по подтверждению учётной записи"
57
+ reset_password_instructions:
58
+ subject: "Инструкции по восстановлению пароля"
59
+ unlock_instructions:
60
+ subject: "Инструкции по разблокировке учётной записи"
@@ -0,0 +1,9 @@
1
+ <%= heading_with_title 'Не получили инструкции по подтверждению аккаунта?' %>
2
+
3
+ <%= simple_form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
4
+
5
+ <%= f.input :email, :required => true %>
6
+ <%= f.button :submit, "Переслать инструкции заново" %>
7
+ <% end %>
8
+
9
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,10 @@
1
+ <h2>Вы зарегистрировались на сайте &laquo;Ремесленный парк Урала&raquo;</h2>
2
+
3
+ <p>Ваши реквизиты:</p>
4
+ <p>
5
+ <b>Логин</b>: <%= @resource.email %><br>
6
+ <b>Пароль</b>: <%= @resource.password %>
7
+ </p>
8
+
9
+ <p>
10
+ Вам нужно подтвердить аккаунт, чтобы начать работу на сайте. Пройдите по ссылке: <%= link_to 'Подтвердить аккаунт', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
@@ -0,0 +1,7 @@
1
+ <h2>Здравствуйте, <%= @resource.username %>!</h2>
2
+
3
+ <p>Вы запросили смену пароля. Вы можете сменить пароль, нажав на ссылку ниже.</p>
4
+
5
+ <p><%= link_to 'Сменить пароль', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
6
+
7
+ <p>Если вы не запрашивали смену пароля, просто проигнорируйте это письмо.</p>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Your account has been locked due to an excessive amount of unsuccessful sign in attempts.</p>
4
+
5
+ <p>Click the link below to unlock your account:</p>
6
+
7
+ <p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
@@ -0,0 +1,11 @@
1
+ <%= page_header 'Изменение пароля' %>
2
+
3
+ <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
4
+ <%= f.input :reset_password_token, :as => :hidden %>
5
+ <%= f.full_error :reset_password_token %>
6
+ <%= f.input :password, :label => "Новый пароль", :required => true %>
7
+ <%= f.input :password_confirmation, :label => "Подтвердите новый пароль", :required => true %>
8
+ <%= f.button :submit, "Сменить пароль" %>
9
+ <% end %>
10
+
11
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,9 @@
1
+ <%= page_header 'Забыли пароль?' %>
2
+
3
+ <%= simple_form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
4
+
5
+ <%= f.input :email, :required => true %>
6
+ <%= f.button :submit, "Прислать мне инструкции по сбросу пароля" %>
7
+ <% end %>
8
+
9
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,3 @@
1
+ <%= heading_with_title I18n.t 'devise.registrations.inactive_signed_up', :reason => I18n.t('devise.registrations.reasons.unconfirmed') %>
2
+
3
+ <p>Через несколько минут на ваш почтовый ящик придет письмо со ссылкой на подтверждение регистрации. Вам нужно нажать на эту ссылку, тогда регистрация будет окончена.</p>
@@ -0,0 +1,22 @@
1
+ <h2>Edit <%= resource_name.to_s.humanize %></h2>
2
+
3
+ <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
4
+ <%= f.error_notification %>
5
+
6
+ <div class="inputs">
7
+ <%= f.input :email, :required => true, :autofocus => true %>
8
+ <%= f.input :password, :hint => "leave it blank if you don't want to change it", :required => false %>
9
+ <%= f.input :password_confirmation, :required => false %>
10
+ <%= f.input :current_password, :hint => "we need your current password to confirm your changes", :required => true %>
11
+ </div>
12
+
13
+ <div class="actions">
14
+ <%= f.button :submit, "Update" %>
15
+ </div>
16
+ <% end %>
17
+
18
+ <h3>Cancel my account</h3>
19
+
20
+ <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
21
+
22
+ <%= link_to "Back", :back %>
@@ -0,0 +1,10 @@
1
+ <%= heading_with_title 'Регистрация на сайте' %>
2
+
3
+ <%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
4
+ <%= f.input :email, :required => true, :autofocus => true %>
5
+ <%= f.input :password, :required => true %>
6
+ <%= f.input :password_confirmation, :required => true %>
7
+ <%= f.button :submit, "Зарегистрироваться" %>
8
+ <% end %>
9
+
10
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,15 @@
1
+ <%= heading_with_title 'Вход на сайт' %>
2
+
3
+ <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
4
+ <div class="inputs">
5
+ <%= f.input :email, :required => false, :autofocus => true %>
6
+ <%= f.input :password, :required => false %>
7
+ <%= f.input :remember_me, :as => :boolean if devise_mapping.rememberable? %>
8
+ </div>
9
+
10
+ <div class="actions">
11
+ <%= f.button :submit, "Войти" %>
12
+ </div>
13
+ <% end %>
14
+
15
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,27 @@
1
+ <ul id="devise-links">
2
+ <%- if controller_name != 'sessions' %>
3
+ <li><%= link_to "Вход на сайт", new_session_path(resource_name) %></li>
4
+ <% end -%>
5
+
6
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
7
+ <li><%= link_to "Зарегистрироваться", new_registration_path(resource_name) %></li>
8
+ <% end -%>
9
+
10
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
11
+ <li><%= link_to "Забыли пароль?", new_password_path(resource_name) %></li>
12
+ <% end -%>
13
+
14
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
15
+ <li><%= link_to "Не получили инструкции по подтверждению аккаунта?", new_confirmation_path(resource_name) %></li>
16
+ <% end -%>
17
+
18
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
19
+ <li><%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %></li>
20
+ <% end -%>
21
+
22
+ <%- if devise_mapping.omniauthable? %>
23
+ <%- resource_class.omniauth_providers.each do |provider| %>
24
+ <li><%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %></li>
25
+ <% end -%>
26
+ <% end -%>
27
+ </ul>
@@ -0,0 +1,15 @@
1
+ <h2>Resend unlock instructions</h2>
2
+
3
+ <%= simple_form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
4
+ <%= f.error_notification %>
5
+
6
+ <div class="inputs">
7
+ <%= f.input :email, :required => true %>
8
+ </div>
9
+
10
+ <div class="actions">
11
+ <%= f.button :submit, "Resend unlock instructions" %>
12
+ </div>
13
+ <% end %>
14
+
15
+ <%= render :partial => "devise/shared/links" %>
@@ -0,0 +1,8 @@
1
+ ru:
2
+ views:
3
+ pagination:
4
+ first: "&laquo; Первая"
5
+ last: "Последняя &raquo;"
6
+ previous: "&lsaquo; Предыдущая"
7
+ next: "Следующая &rsaquo;"
8
+ truncate: "..."
@@ -0,0 +1,11 @@
1
+ <%# Link to the "First" page
2
+ - available local variables
3
+ url: url to the first page
4
+ current_page: a page object for the currently displayed page
5
+ num_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="first">
10
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.first'), url, :remote => remote %>
11
+ </li>
@@ -0,0 +1,8 @@
1
+ <%# Non-link tag that stands for skipped pages...
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ num_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ -%>
8
+ <li class="page gap"><%= raw(t 'views.pagination.truncate') %></li>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Last" page
2
+ - available local variables
3
+ url: url to the last page
4
+ current_page: a page object for the currently displayed page
5
+ num_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="last">
10
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.last'), url, {:remote => remote} %>
11
+ </li>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Next" page
2
+ - available local variables
3
+ url: url to the next page
4
+ current_page: a page object for the currently displayed page
5
+ num_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="next">
10
+ <%= link_to_unless current_page.last?, raw(t 'views.pagination.next'), url, :rel => 'next', :remote => remote %>
11
+ </li>
@@ -0,0 +1,20 @@
1
+ <%# Link showing page number
2
+ - available local variables
3
+ page: a page object for "this" page
4
+ url: url to this page
5
+ current_page: a page object for the currently displayed page
6
+ num_pages: total number of pages
7
+ per_page: number of items to fetch per page
8
+ remote: data-remote
9
+ -%>
10
+ <li class="page<%= ' current' if page.current? %>">
11
+ <% if page.current? %>
12
+ <span>
13
+ <% end %>
14
+
15
+ <%= link_to_unless page.current?, page, url, opts = {:remote => remote, :rel => page.next? ? 'next' : page.prev? ? 'prev' : nil} %>
16
+
17
+ <% if page.current? %>
18
+ </span>
19
+ <% end %>
20
+ </li>
@@ -0,0 +1,25 @@
1
+ <%# The container tag
2
+ - available local variables
3
+ current_page: a page object for the currently displayed page
4
+ num_pages: total number of pages
5
+ per_page: number of items to fetch per page
6
+ remote: data-remote
7
+ paginator: the paginator that renders the pagination tags inside
8
+ -%>
9
+ <%= paginator.render do %>
10
+ <nav class="pagination">
11
+ <ul>
12
+ <%= first_page_tag unless current_page.first? %>
13
+ <%= prev_page_tag unless current_page.first? %>
14
+ <% each_page do |page| %>
15
+ <% if page.left_outer? || page.right_outer? || page.inside_window? -%>
16
+ <%= page_tag page %>
17
+ <% elsif !page.was_truncated? -%>
18
+ <%= gap_tag %>
19
+ <% end %>
20
+ <% end %>
21
+ <%= next_page_tag unless current_page.last? %>
22
+ <%= last_page_tag unless current_page.last? %>
23
+ </ul>
24
+ </nav>
25
+ <% end %>
@@ -0,0 +1,11 @@
1
+ <%# Link to the "Previous" page
2
+ - available local variables
3
+ url: url to the previous page
4
+ current_page: a page object for the currently displayed page
5
+ num_pages: total number of pages
6
+ per_page: number of items to fetch per page
7
+ remote: data-remote
8
+ -%>
9
+ <li class="prev">
10
+ <%= link_to_unless current_page.first?, raw(t 'views.pagination.previous'), url, :rel => 'prev', :remote => remote %>
11
+ </li>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
5
+ </head>
6
+ <body>
7
+ <%%= yield %>
8
+
9
+ <hr>
10
+ <p>
11
+ <a href="<%%= root_url %>"><%%= root_url %></a>, <%%= Time.now.year %>. Site Name Here.
12
+ </p>
13
+ </body>
14
+ </html>
@@ -0,0 +1,15 @@
1
+ class Tableless
2
+ include ActiveModel::Validations
3
+ include ActiveModel::Conversion
4
+ extend ActiveModel::Naming
5
+
6
+ def initialize(props = {})
7
+ props.each do |name, value|
8
+ send("#{name}=", value)
9
+ end
10
+ end
11
+
12
+ def persisted?
13
+ false
14
+ end
15
+ end
@@ -19,6 +19,5 @@ Gem::Specification.new do |s|
19
19
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
20
  s.require_paths = ["lib"]
21
21
 
22
- s.add_dependency("rails", ["~> 3.1"])
23
22
  s.add_dependency("playmo", ["~> 0.1.0"])
24
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tanraya-playmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,22 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-17 00:00:00.000000000Z
12
+ date: 2012-02-13 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rails
16
- requirement: &12060760 !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '3.1'
22
- type: :runtime
23
- prerelease: false
24
- version_requirements: *12060760
25
14
  - !ruby/object:Gem::Dependency
26
15
  name: playmo
27
- requirement: &12109460 !ruby/object:Gem::Requirement
16
+ requirement: &17352400 !ruby/object:Gem::Requirement
28
17
  none: false
29
18
  requirements:
30
19
  - - ~>
@@ -32,7 +21,7 @@ dependencies:
32
21
  version: 0.1.0
33
22
  type: :runtime
34
23
  prerelease: false
35
- version_requirements: *12109460
24
+ version_requirements: *17352400
36
25
  description: This just only for my purposes
37
26
  email:
38
27
  - andrew@tanraya.com
@@ -46,8 +35,38 @@ files:
46
35
  - README.md
47
36
  - Rakefile
48
37
  - lib/tanraya-playmo.rb
49
- - lib/tanraya_playmo/recipes/dragonfly_recipe.rb
50
38
  - lib/tanraya_playmo/version.rb
39
+ - recipes/appgems_recipe.rb
40
+ - recipes/assets_paths_recipe.rb
41
+ - recipes/csv_recipe.rb
42
+ - recipes/devise_views_recipe.rb
43
+ - recipes/dragonfly_recipe.rb
44
+ - recipes/kaminari_recipe.rb
45
+ - recipes/mailer_layout_recipe.rb
46
+ - recipes/tableless_recipe.rb
47
+ - recipes/templates/devise_views_recipe/locales/devise.ru.yml
48
+ - recipes/templates/devise_views_recipe/views/devise/confirmations/new.html.erb
49
+ - recipes/templates/devise_views_recipe/views/devise/mailer/confirmation_instructions.html.erb
50
+ - recipes/templates/devise_views_recipe/views/devise/mailer/reset_password_instructions.html.erb
51
+ - recipes/templates/devise_views_recipe/views/devise/mailer/unlock_instructions.html.erb
52
+ - recipes/templates/devise_views_recipe/views/devise/passwords/edit.html.erb
53
+ - recipes/templates/devise_views_recipe/views/devise/passwords/new.html.erb
54
+ - recipes/templates/devise_views_recipe/views/devise/registrations/done.html.erb
55
+ - recipes/templates/devise_views_recipe/views/devise/registrations/edit.html.erb
56
+ - recipes/templates/devise_views_recipe/views/devise/registrations/new.html.erb
57
+ - recipes/templates/devise_views_recipe/views/devise/sessions/new.html.erb
58
+ - recipes/templates/devise_views_recipe/views/devise/shared/_links.erb
59
+ - recipes/templates/devise_views_recipe/views/devise/unlocks/new.html.erb
60
+ - recipes/templates/kaminari_recipe/kaminari.ru.yml
61
+ - recipes/templates/kaminari_recipe/views/kaminari/_first_page.html.erb
62
+ - recipes/templates/kaminari_recipe/views/kaminari/_gap.html.erb
63
+ - recipes/templates/kaminari_recipe/views/kaminari/_last_page.html.erb
64
+ - recipes/templates/kaminari_recipe/views/kaminari/_next_page.html.erb
65
+ - recipes/templates/kaminari_recipe/views/kaminari/_page.html.erb
66
+ - recipes/templates/kaminari_recipe/views/kaminari/_paginator.html.erb
67
+ - recipes/templates/kaminari_recipe/views/kaminari/_prev_page.html.erb
68
+ - recipes/templates/mailer_layout_recipe/mailer.html.erb
69
+ - recipes/templates/tableless_recipe/tableless.rb
51
70
  - tanraya-playmo.gemspec
52
71
  homepage: https://github.com/tanraya/tanraya-playmo
53
72
  licenses: []
@@ -69,7 +88,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
88
  version: '0'
70
89
  requirements: []
71
90
  rubyforge_project: tanraya-playmo
72
- rubygems_version: 1.8.10
91
+ rubygems_version: 1.8.15
73
92
  signing_key:
74
93
  specification_version: 3
75
94
  summary: My own recipes cooked with Playmo