cybele 1.4.0 → 1.5.0

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: 3849c244a5b785770ae862cdfea2cfabb394543a
4
- data.tar.gz: 8d136b832bf9c034215e8972b64e22298ddb4ed9
3
+ metadata.gz: abfe1ddfab2b1b5ec569f2ca57b36d1cc4b48530
4
+ data.tar.gz: d0d00a78f497e9a966efc73f0d13d534a9a93957
5
5
  SHA512:
6
- metadata.gz: 6efa6543bd3930ec5c13c9c5ca9528b06bec6dbd1002486d6383c319f88c4e1acc102aca732668aba422351591c416d66921fb53ee0eefbef8fc3e7843929c61
7
- data.tar.gz: 0b2d757875686ae06facdb82173c64d48d1cc1d53f95326cfb0c8cdf35991e98648f7abacfc883f97524a202bba713c3c808ec74f5fd81d5ec9f8489beeaffa0
6
+ metadata.gz: e380fc029c82589ad45dd4b528afbc6b50f156732b1eae452b2313eca8bbe159ee7f0bc72c9932f1be2fdd06548257dd61ac8f21c3b2838686f6762d25712d2f
7
+ data.tar.gz: c6c457f0249e7c9b1c99fe0b09ca9a1e5c3921121da2808be4cf59b70e474e6d5b04d0044b0a5abb7d4d771283204e5e41165c8c680426de2a0e4339fb3529e1
data/.gitignore CHANGED
@@ -1,2 +1,5 @@
1
1
  .idea/
2
- *.gem
2
+ *.gem
3
+ *.log
4
+ .bundle/
5
+ *.bundle/install.log
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
 
2
2
  #### [Current]
3
+ * [f49b2e1](../../commit/f49b2e1) - __(Muhammet DİLEK)__ TB-2 improve profile
4
+ * [0f86715](../../commit/0f86715) - __(hamitturkukaya)__ TB-2 Admin and user profiles added
5
+ * [0c4f887](../../commit/0c4f887) - __(Muhammet DİLEK)__ TB-14 custom 404 page added
6
+ * [617a7c1](../../commit/617a7c1) - __(Muhammet DİLEK)__ TB-14 custom 500 page added
7
+ * [32593a0](../../commit/32593a0) - __(hamitturkukaya)__ TB-26 hierapolis-rails version upgraded
8
+ * [9c91097](../../commit/9c91097) - __(Muhammet DİLEK)__ TB-16 devise gem updated
9
+ * [cefb812](../../commit/cefb812) - __(Muhammet DİLEK)__ TB-23 dev.rake added
10
+ * [97fca16](../../commit/97fca16) - __(Muhammet DİLEK)__ TB-24 show initial file added
11
+ * [d9eb93a](../../commit/d9eb93a) - __(Ahmet Sezgin Duran)__ TB-2 #time 15m Add user profile editor
12
+ * [0273c31](../../commit/0273c31) - __(Ahmet Sezgin Duran)__ TB-2 #time 30m Add admin profile editor
13
+ * [10e6992](../../commit/10e6992) - __(Onur Ozgur OZKAN)__ Merge remote-tracking branch 'origin/develop' into develop
14
+ * [304a51d](../../commit/304a51d) - __(Onur Ozgur OZKAN)__ Fixed .ruby-version filename.
15
+ * [5b193d7](../../commit/5b193d7) - __(Ahmet Sezgin Duran)__ TB-3 #time 30m Add Bullet gem's configuration
16
+
17
+ #### 1.4.0
18
+ * [06dbf38](../../commit/06dbf38) - __(Muhammet DİLEK)__ bump version 1.4.0
3
19
  * [cf40aec](../../commit/cf40aec) - __(Muhammet DİLEK)__ rails_best_practices gem added
4
20
  * [39a7cf2](../../commit/39a7cf2) - __(Onur Özgür ÖZKAN)__ Merge pull request [#114](../../issues/114) from marjinal1st/version-patch
5
21
 
data/Gemfile.lock CHANGED
@@ -1,39 +1,39 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cybele (1.3.0)
4
+ cybele (1.4.0)
5
5
  bundler (~> 1.5)
6
6
  rails (~> 4.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionmailer (4.0.2)
12
- actionpack (= 4.0.2)
11
+ actionmailer (4.0.4)
12
+ actionpack (= 4.0.4)
13
13
  mail (~> 2.5.4)
14
- actionpack (4.0.2)
15
- activesupport (= 4.0.2)
14
+ actionpack (4.0.4)
15
+ activesupport (= 4.0.4)
16
16
  builder (~> 3.1.0)
17
17
  erubis (~> 2.7.0)
18
18
  rack (~> 1.5.2)
19
19
  rack-test (~> 0.6.2)
20
- activemodel (4.0.2)
21
- activesupport (= 4.0.2)
20
+ activemodel (4.0.4)
21
+ activesupport (= 4.0.4)
22
22
  builder (~> 3.1.0)
23
- activerecord (4.0.2)
24
- activemodel (= 4.0.2)
23
+ activerecord (4.0.4)
24
+ activemodel (= 4.0.4)
25
25
  activerecord-deprecated_finders (~> 1.0.2)
26
- activesupport (= 4.0.2)
26
+ activesupport (= 4.0.4)
27
27
  arel (~> 4.0.0)
28
28
  activerecord-deprecated_finders (1.0.3)
29
- activesupport (4.0.2)
30
- i18n (~> 0.6, >= 0.6.4)
29
+ activesupport (4.0.4)
30
+ i18n (~> 0.6, >= 0.6.9)
31
31
  minitest (~> 4.2)
32
32
  multi_json (~> 1.3)
33
33
  thread_safe (~> 0.1)
34
34
  tzinfo (~> 0.3.37)
35
- arel (4.0.1)
36
- atomic (1.1.14)
35
+ arel (4.0.2)
36
+ atomic (1.1.16)
37
37
  builder (3.1.4)
38
38
  erubis (2.7.0)
39
39
  hike (1.2.3)
@@ -43,26 +43,26 @@ GEM
43
43
  treetop (~> 1.4.8)
44
44
  mime-types (1.25.1)
45
45
  minitest (4.7.5)
46
- multi_json (1.8.2)
47
- polyglot (0.3.3)
46
+ multi_json (1.9.2)
47
+ polyglot (0.3.4)
48
48
  rack (1.5.2)
49
49
  rack-test (0.6.2)
50
50
  rack (>= 1.0)
51
- rails (4.0.2)
52
- actionmailer (= 4.0.2)
53
- actionpack (= 4.0.2)
54
- activerecord (= 4.0.2)
55
- activesupport (= 4.0.2)
51
+ rails (4.0.4)
52
+ actionmailer (= 4.0.4)
53
+ actionpack (= 4.0.4)
54
+ activerecord (= 4.0.4)
55
+ activesupport (= 4.0.4)
56
56
  bundler (>= 1.3.0, < 2.0)
57
- railties (= 4.0.2)
57
+ railties (= 4.0.4)
58
58
  sprockets-rails (~> 2.0.0)
59
- railties (4.0.2)
60
- actionpack (= 4.0.2)
61
- activesupport (= 4.0.2)
59
+ railties (4.0.4)
60
+ actionpack (= 4.0.4)
61
+ activesupport (= 4.0.4)
62
62
  rake (>= 0.8.7)
63
63
  thor (>= 0.18.1, < 2.0)
64
64
  rake (10.0.4)
65
- sprockets (2.10.1)
65
+ sprockets (2.11.0)
66
66
  hike (~> 1.2)
67
67
  multi_json (~> 1.0)
68
68
  rack (~> 1.0)
@@ -71,14 +71,14 @@ GEM
71
71
  actionpack (>= 3.0)
72
72
  activesupport (>= 3.0)
73
73
  sprockets (~> 2.8)
74
- thor (0.18.1)
75
- thread_safe (0.1.3)
76
- atomic
74
+ thor (0.19.1)
75
+ thread_safe (0.3.1)
76
+ atomic (>= 1.1.7, < 2)
77
77
  tilt (1.4.1)
78
78
  treetop (1.4.15)
79
79
  polyglot
80
80
  polyglot (>= 0.3.1)
81
- tzinfo (0.3.38)
81
+ tzinfo (0.3.39)
82
82
 
83
83
  PLATFORMS
84
84
  ruby
@@ -20,7 +20,7 @@ module Cybele
20
20
  end
21
21
 
22
22
  def add_ruby_version
23
- copy_file 'ruby_version', '.ruby_version'
23
+ copy_file 'ruby-version', '.ruby-version'
24
24
  end
25
25
 
26
26
  def add_disable_xml_params
@@ -114,6 +114,18 @@ config.action_mailer.raise_delivery_errors = false
114
114
  configure_environment 'staging', config
115
115
  end
116
116
 
117
+ def configure_bullet
118
+ config = <<-RUBY
119
+ config.after_initialize do
120
+ Bullet.enable = true
121
+ Bullet.alert = true
122
+ Bullet.bullet_logger = true
123
+ end
124
+ RUBY
125
+
126
+ configure_environment 'development', config
127
+ end
128
+
117
129
  def setup_staging_environment
118
130
  run 'cp config/environments/production.rb config/environments/staging.rb'
119
131
 
@@ -179,17 +191,27 @@ require 'capybara/rspec'
179
191
 
180
192
  def add_exception_notification_to_environments
181
193
  config = <<-CODE
182
-
183
- config.middleware.use ExceptionNotification::Rack,
184
- :email => {
185
- :email_prefix => "[Whatever] ",
186
- :sender_address => %{"notifier" <notifier@example.com>},
187
- :exception_recipients => %w{exceptions@example.com}
188
- }
194
+ config.middleware.use ExceptionNotification::Rack,
195
+ :email => {
196
+ :email_prefix => "[Whatever] ",
197
+ :sender_address => %{"notifier" <notifier@example.com>},
198
+ :exception_recipients => %w{exceptions@example.com}
199
+ }
189
200
  CODE
190
201
 
191
202
  configure_environment('production', config)
192
203
  configure_environment('staging', config)
204
+
205
+ inject_into_file 'config/initializers/exception_notification.rb', :before => 'config.add_notifier :email, {' do <<-RUBY
206
+ unless Rails.env == 'development'
207
+ RUBY
208
+ end
209
+
210
+ inject_into_file 'config/initializers/exception_notification.rb', :before => '# Campfire notifier sends notifications to your Campfire room.' do <<-RUBY
211
+ end
212
+ RUBY
213
+ end
214
+
193
215
  end
194
216
 
195
217
  def leftovers
@@ -232,6 +254,25 @@ require 'capybara/rspec'
232
254
  path_names: {sign_in: 'login', sign_out: 'logout', password: 'secret',
233
255
  confirmation: 'verification'}"
234
256
  gsub_file 'app/models/admin.rb', /:registerable,/, ''
257
+
258
+ say 'Configuring profile editors...'
259
+ setup_profile_editors
260
+ end
261
+
262
+ def setup_profile_editors
263
+ # Inserting routes
264
+ inject_into_file 'config/routes.rb', :after => "namespace :hq do\n" do <<-RUBY
265
+ root to: 'dashboard#index'
266
+ resource :admin_profile, except: [:destroy], path: 'profile'
267
+ RUBY
268
+ end
269
+
270
+ inject_into_file 'config/routes.rb', :after => "'welcome#index'\n" do <<-RUBY
271
+
272
+ resource :user_profile, except: [:destroy], path: 'profile'
273
+
274
+ RUBY
275
+ end
235
276
  end
236
277
 
237
278
  def set_time_zone
@@ -239,6 +280,12 @@ require 'capybara/rspec'
239
280
  add_time_zone_to_user
240
281
  end
241
282
 
283
+ def create_profile
284
+ add_profile_models
285
+ add_profile_controllers
286
+ add_profile_views
287
+ end
288
+
242
289
  def create_hierapolis_theme
243
290
  remove_file 'lib/templates/rails/responders_controller/controller.rb'
244
291
  remove_file 'lib/templates/haml/scaffold/_form.html.haml'
@@ -267,6 +314,46 @@ require 'capybara/rspec'
267
314
  template 'config/initializers/secret_token.erb', 'config/initializers/secret_token.rb'
268
315
  end
269
316
 
317
+ def setup_show_for
318
+ copy_file 'config/initializers/show_for.rb', 'config/initializers/show_for.rb'
319
+ end
320
+
321
+ def create_dev_rake
322
+ copy_file 'lib/tasks/dev.rake', 'lib/tasks/dev.rake'
323
+ end
324
+
325
+ def custom_exception_page
326
+ copy_file 'app/views/errors/internal_server_error.html.haml', 'app/views/errors/internal_server_error.html.haml'
327
+ inject_into_file 'app/controllers/application_controller.rb', :before => 'protected' do <<-CODE
328
+
329
+ rescue_from Exception, :with => :server_error
330
+ def server_error(exception)
331
+ ExceptionNotifier::Notifier.exception_notification(request.env, exception).deliver
332
+ respond_to do |format|
333
+ format.html { render template: 'errors/internal_server_error', layout: 'layouts/application', status: 500 }
334
+ format.all { render nothing: true, status: 500}
335
+ end
336
+ end
337
+ CODE
338
+ end
339
+ end
340
+
341
+ def custom_404
342
+ copy_file 'app/views/errors/not_found.html.haml', 'app/views/errors/not_found.html.haml'
343
+ inject_into_file 'app/controllers/application_controller.rb', :before => 'protected' do <<-CODE
344
+
345
+ rescue_from ActiveRecord::RecordNotFound, :with => :page_not_found
346
+ rescue_from ActionController::RoutingError, :with => :page_not_found
347
+ def page_not_found
348
+ respond_to do |format|
349
+ format.html { render template: 'errors/not_found', layout: 'layouts/application', status: 404 }
350
+ format.all { render nothing: true, status: 404 }
351
+ end
352
+ end
353
+ CODE
354
+ end
355
+ end
356
+
270
357
  private
271
358
 
272
359
  def action_mailer_host(rails_env, host)
@@ -340,6 +427,12 @@ require "#{path}"
340
427
  generate 'migration AddTimeZoneToUser time_zone:string -s'
341
428
  end
342
429
 
430
+ def add_profile_models
431
+ say 'Creating Profile Models'
432
+ generate 'model user_profile first_name:string last_name:string gsm:string user:references -s'
433
+ generate 'model admin_profile first_name:string last_name:string gsm:string admin:references -s'
434
+ end
435
+
343
436
  def add_set_user_time_zone_method_to_application_controller
344
437
  say 'Add set_user_time_zone method to application controller'
345
438
  inject_into_file 'app/controllers/application_controller.rb', :after => 'protected' do <<-CODE
@@ -353,9 +446,32 @@ require "#{path}"
353
446
  inject_into_file 'app/controllers/application_controller.rb', :after => 'class ApplicationController < ActionController::Base' do <<-CODE
354
447
 
355
448
  before_filter :set_user_time_zone
449
+ respond_to :html, :json
356
450
 
357
451
  CODE
358
452
  end
359
453
  end
454
+
455
+ def add_profile_controllers
456
+ copy_file 'app/controllers/hq/admin_profiles_controller.rb', 'app/controllers/hq/admin_profiles_controller.rb'
457
+ copy_file 'app/controllers/user_profiles_controller.rb', 'app/controllers/user_profiles_controller.rb'
458
+ end
459
+
460
+ def add_profile_views
461
+ directory 'app/views/hq/admin_profiles', 'app/views/hq/admin_profiles'
462
+ directory 'app/views/user_profiles', 'app/views/user_profiles'
463
+
464
+ inject_into_file 'app/models/user.rb', :after => ":recoverable, :rememberable, :trackable, :validatable\n" do <<-RUBY
465
+ has_one :user_profile
466
+ accepts_nested_attributes_for :user_profile
467
+ RUBY
468
+ end
469
+
470
+ inject_into_file 'app/models/admin.rb', :after => ":recoverable, :rememberable, :trackable, :validatable\n" do <<-RUBY
471
+ has_one :admin_profile
472
+ accepts_nested_attributes_for :admin_profile
473
+ RUBY
474
+ end
475
+ end
360
476
  end
361
477
  end
@@ -40,7 +40,9 @@ module Cybele
40
40
  invoke :setup_welcome_page
41
41
  invoke :setup_devise
42
42
  invoke :setup_time_zone
43
- invoke :goodbye
43
+ invoke :setup_bullet_config
44
+ invoke :setup_hq_namespace
45
+ invoke :setup_profiles
44
46
  end
45
47
 
46
48
  def customize_gemfile
@@ -174,8 +176,9 @@ module Cybele
174
176
  build :set_time_zone
175
177
  end
176
178
 
177
- def goodbye
178
- say 'Congratulations! That\'s all...'
179
+ def setup_profiles
180
+ say 'Setup profiles'
181
+ build :create_profile
179
182
  end
180
183
 
181
184
  def run_bundle
@@ -205,6 +208,30 @@ module Cybele
205
208
  build :update_secret_token
206
209
  end
207
210
 
211
+ def setup_bullet_config
212
+ build :configure_bullet
213
+ end
214
+
215
+ def install_show_for
216
+ build :setup_show_for
217
+ end
218
+
219
+ def create_dev_rake
220
+ build :create_dev_rake
221
+ end
222
+
223
+ def custom_exception_page
224
+ build :custom_exception_page
225
+ end
226
+
227
+ def custom_404
228
+ build :custom_404
229
+ end
230
+
231
+ def goodbye
232
+ say 'Congratulations! That\'s all...'
233
+ end
234
+
208
235
  protected
209
236
 
210
237
  def get_builder_class
@@ -1,4 +1,4 @@
1
1
  module Cybele
2
- VERSION = '1.4.0'
2
+ VERSION = '1.5.0'
3
3
  end
4
4
 
@@ -0,0 +1,48 @@
1
+ # encoding: UTF-8
2
+ class Hq::AdminProfilesController < Hq::ApplicationController
3
+ before_action :profile_controller
4
+ before_action :set_admin_profile, only: [:show, :edit, :update, :destroy]
5
+ add_breadcrumb I18n.t('activerecord.models.admin_profiles'), :hq_admin_profile_path
6
+
7
+ def show
8
+ add_breadcrumb @admin_profile.first_name, hq_admin_profile_path
9
+ respond_with([:hq, @admin_profile])
10
+ end
11
+
12
+ def new
13
+ add_breadcrumb t('tooltips.new'), new_hq_admin_profile_path
14
+ @admin_profile = current_admin.build_admin_profile
15
+ respond_with([:hq, @admin_profile])
16
+ end
17
+
18
+ def edit
19
+ add_breadcrumb t('tooltips.edit'), edit_hq_admin_profile_path
20
+ end
21
+
22
+ def create
23
+ @admin_profile = current_admin.build_admin_profile(admin_profile_params)
24
+ @admin_profile.save
25
+ respond_with([:hq, @admin_profile], location: hq_admin_profile_path)
26
+ end
27
+
28
+ def update
29
+ @admin_profile.update(admin_profile_params)
30
+ respond_with([:hq, @admin_profile], location: hq_admin_profile_path)
31
+ end
32
+
33
+ private
34
+
35
+ def profile_controller
36
+ if current_admin.admin_profile.nil?
37
+ redirect_to new_hq_admin_profile_path
38
+ end
39
+ end
40
+
41
+ def set_admin_profile
42
+ @admin_profile = current_admin.admin_profile
43
+ end
44
+
45
+ def admin_profile_params
46
+ params.require(:admin_profile).permit(:first_name, :gsm, :last_name)
47
+ end
48
+ end
@@ -0,0 +1,48 @@
1
+ # encoding: UTF-8
2
+ class UserProfilesController < ApplicationController
3
+ before_action :profile_controller
4
+ before_action :set_user_profile, only: [:show, :edit, :update, :destroy]
5
+ add_breadcrumb I18n.t('activerecord.models.user_profiles'), :user_profile_path
6
+
7
+ def show
8
+ add_breadcrumb @user_profile.first_name, user_profile_path
9
+ respond_with(@user_profile)
10
+ end
11
+
12
+ def new
13
+ add_breadcrumb t('tooltips.new'), new_user_profile_path
14
+ @user_profile = current_user.build_user_profile
15
+ respond_with(@user_profile)
16
+ end
17
+
18
+ def edit
19
+ add_breadcrumb t('tooltips.edit'), edit_user_profile_path
20
+ end
21
+
22
+ def create
23
+ @user_profile = current_user.build_user_profile(user_profile_params)
24
+ @user_profile.save
25
+ respond_with(@user_profile, location: user_profile_path)
26
+ end
27
+
28
+ def update
29
+ @user_profile.update(user_profile_params)
30
+ respond_with(@user_profile, location: user_profile_path)
31
+ end
32
+
33
+ private
34
+
35
+ def profile_controller
36
+ if current_user.user_profile.nil?
37
+ redirect_to new_user_profile_path
38
+ end
39
+ end
40
+
41
+ def set_user_profile
42
+ @user_profile = current_user.user_profile
43
+ end
44
+
45
+ def user_profile_params
46
+ params.require(:user_profile).permit(:first_name, :gsm, :last_name)
47
+ end
48
+ end
@@ -0,0 +1,2 @@
1
+ .well
2
+ %p= t('internal_server_error')
@@ -0,0 +1,2 @@
1
+ .well
2
+ %p= t('not_found')
@@ -0,0 +1,15 @@
1
+ .panel.panel-default
2
+ .panel-heading
3
+ %i.icon-edit.icon-large
4
+ = yield :form_title
5
+ .panel-body
6
+ = simple_form_for([:hq, @admin_profile], url: hq_admin_profile_path) do |f|
7
+ = f.error_notification
8
+
9
+ .form-inputs
10
+ = f.input :first_name
11
+ = f.input :last_name
12
+ = f.input :gsm
13
+ .form-actions
14
+ = f.button :submit, class: 'btn btn-default'
15
+ = link_to t('cancel'), hq_admin_profile_path, class: 'btn'
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.edit', resource_name: AdminProfile.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.new', resource_name: AdminProfile.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,13 @@
1
+ - content_for :toolbar do
2
+ = link_to edit_hq_admin_profile_path, class: 'btn btn-default' do
3
+ %i.icon-pencil
4
+ = t('action_button.edit')
5
+ .panel.panel-default
6
+ .panel-heading
7
+ %i.icon-edit.icon-large
8
+ = t('tt.show', resource_name: AdminProfile.model_name.human)
9
+ .panel-body
10
+ = show_for @admin_profile do |s|
11
+ = s.attribute :first_name
12
+ = s.attribute :last_name
13
+ = s.attribute :gsm
@@ -1,2 +1,3 @@
1
1
  %h1= "Hi #{current_admin.email}"
2
- = link_to 'Sign out', destroy_admin_session_path, class: 'btn btn-large', method: :delete
2
+ = link_to 'Sign out', destroy_admin_session_path, class: 'btn btn-large', method: :delete
3
+ = link_to 'Edit Profile', edit_hq_admin_profile_path, class: 'btn btn-large'
@@ -0,0 +1,16 @@
1
+ .panel.panel-default
2
+ .panel-heading
3
+ %i.icon-edit.icon-large
4
+ = yield :form_title
5
+ .panel-body
6
+ = simple_form_for(@user_profile, url: user_profile_path) do |f|
7
+ = f.error_notification
8
+
9
+ .form-inputs
10
+ = f.input :first_name
11
+ = f.input :last_name
12
+ = f.input :gsm
13
+
14
+ .form-actions
15
+ = f.button :submit, class: 'btn btn-default'
16
+ = link_to t('cancel'), user_profile_path, class: 'btn'
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.edit', resource_name: UserProfile.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,3 @@
1
+ - content_for :form_title do
2
+ = t('tt.new', resource_name: UserProfile.model_name.human)
3
+ = render 'form'
@@ -0,0 +1,13 @@
1
+ - content_for :toolbar do
2
+ = link_to edit_user_profile_path, class: 'btn btn-default' do
3
+ %i.icon-pencil
4
+ = t('action_button.edit')
5
+ .panel.panel-default
6
+ .panel-heading
7
+ %i.icon-edit.icon-large
8
+ = t('tt.show', resource_name: UserProfile.model_name.human)
9
+ .panel-body
10
+ = show_for @user_profile do |s|
11
+ = s.attribute :first_name
12
+ = s.attribute :last_name
13
+ = s.attribute :gsm
@@ -9,6 +9,7 @@
9
9
  %p
10
10
  %strong Email:
11
11
  = current_user.email
12
+ = link_to 'Edit Profile', edit_user_profile_path, class: 'btn btn-large'
12
13
  - else
13
14
  = link_to 'Sign up today', new_user_registration_path, class: 'btn btn-large btn-success'
14
15
  = link_to 'Sign in', new_user_session_path, class: 'btn btn-large'
@@ -0,0 +1,3 @@
1
+ ShowFor.setup do |config|
2
+ config.label_class = nil
3
+ end
@@ -28,3 +28,6 @@ tr:
28
28
  format:
29
29
  format: "%u %n"
30
30
  unit: "₺"
31
+
32
+ internal_server_error: "Üzgünüz. Şu anda bir hata var. Mühendislerimiz bu hata üzerinde çalışma yapıyorlar. En kısa sürede çözeceğiz."
33
+ not_found: "Üzgünüz. Bu sayfa bulunamadı. Taşınmış olabilir. Buraya gitmek istediğinizden emin olun."
@@ -16,7 +16,7 @@ gem 'simple_form', '~> 3.0.1'
16
16
  gem 'show_for', '~> 0.3.0.rc'
17
17
  gem 'rails_config', '~> 0.3.3'
18
18
  gem 'compass-rails', '~> 1.1.2'
19
- gem 'devise', '~> 3.0.0'
19
+ gem 'devise', '~> 3.2.4'
20
20
  gem 'devise-i18n', '~> 0.9.0'
21
21
  gem 'will_paginate', '~> 3.0.4'
22
22
  gem 'will_paginate-bootstrap', '~> 0.2.3'
@@ -37,7 +37,7 @@ gem 'aws-sdk', '~> 1.29.0'
37
37
  # gem 'rails-observers'
38
38
  gem 'rails_best_practices', '~> 1.15.1'
39
39
 
40
- gem 'hierapolis-rails', '~> 0.4.0'
40
+ gem 'hierapolis-rails', '~> 1.0.0'
41
41
  gem 'breadcrumbs_on_rails', '~> 2.3.0'
42
42
  gem 'blankable', '~> 0.2.0'
43
43
 
@@ -0,0 +1,33 @@
1
+ namespace :dev do
2
+ # Just run development env
3
+ # This code run insert seed and agency data
4
+ # A simple trick to over migration problem
5
+ task :setup => [:environment] do
6
+ raise 'Nah, You are at production' if Rails.env.production?
7
+ Rake::Task['dev:kill_postgres_connections'].execute
8
+ Rake::Task['db:drop'].execute
9
+ Rake::Task['db:create'].execute
10
+ Rake::Task['db:migrate'].execute
11
+ Rake::Task['dev:initial'].execute
12
+ Rake::Task['db:seed'].execute
13
+ end
14
+
15
+ task :initial => [:environment] do
16
+ User.create(email: 'user@example.com', password: '12341234', password_confirmation: '12341234')
17
+ Admin.create(email: 'admin@example.com', password: '12341234', password_confirmation: '12341234')
18
+ end
19
+
20
+ task :kill_postgres_connections => [:environment] do
21
+ db_name = "#{File.basename(Rails.root)}_#{Rails.env}"
22
+ sh = <<EOF
23
+ ps xa \
24
+ | grep postgres: \
25
+ | grep #{db_name} \
26
+ | grep -v grep \
27
+ | awk '{print $1}' \
28
+ | xargs kill
29
+ EOF
30
+ puts `#{sh}`
31
+ end
32
+
33
+ end
File without changes
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cybele
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - lab2023
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-07 00:00:00.000000000 Z
11
+ date: 2014-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -80,9 +80,11 @@ files:
80
80
  - templates/app/assets/javascripts/application.js.coffee
81
81
  - templates/app/assets/stylesheets/application.css.sass
82
82
  - templates/app/controllers/application_controller.rb
83
+ - templates/app/controllers/hq/admin_profiles_controller.rb
83
84
  - templates/app/controllers/hq/application_controller.rb
84
85
  - templates/app/controllers/hq/dashboard_controller.rb
85
86
  - templates/app/controllers/hq/sessions_controller.rb
87
+ - templates/app/controllers/user_profiles_controller.rb
86
88
  - templates/app/controllers/welcome_controller.rb
87
89
  - templates/app/views/devise/confirmations/new.html.haml
88
90
  - templates/app/views/devise/mailer/confirmation_instructions.html.haml
@@ -95,15 +97,26 @@ files:
95
97
  - templates/app/views/devise/sessions/new.html.haml
96
98
  - templates/app/views/devise/shared/_links.haml
97
99
  - templates/app/views/devise/unlocks/new.html.haml
100
+ - templates/app/views/errors/internal_server_error.html.haml
101
+ - templates/app/views/errors/not_found.html.haml
102
+ - templates/app/views/hq/admin_profiles/_form.html.haml
103
+ - templates/app/views/hq/admin_profiles/edit.html.haml
104
+ - templates/app/views/hq/admin_profiles/new.html.haml
105
+ - templates/app/views/hq/admin_profiles/show.html.haml
98
106
  - templates/app/views/hq/dashboard/index.html.haml.erb
99
107
  - templates/app/views/hq/sessions/new.html.haml
100
108
  - templates/app/views/layouts/application.html.haml.erb
109
+ - templates/app/views/user_profiles/_form.html.haml
110
+ - templates/app/views/user_profiles/edit.html.haml
111
+ - templates/app/views/user_profiles/new.html.haml
112
+ - templates/app/views/user_profiles/show.html.haml
101
113
  - templates/app/views/welcome/index.html.haml.erb
102
114
  - templates/config/database.yml.erb
103
115
  - templates/config/initializers/disable_xml_params.rb
104
116
  - templates/config/initializers/mail.rb
105
117
  - templates/config/initializers/paperclip.rb
106
118
  - templates/config/initializers/secret_token.erb
119
+ - templates/config/initializers/show_for.rb
107
120
  - templates/config/initializers/simple_form.rb
108
121
  - templates/config/initializers/simple_form_bootstrap.rb
109
122
  - templates/config/locales/responders.en.yml
@@ -117,8 +130,9 @@ files:
117
130
  - templates/editorconfig
118
131
  - templates/lib/application_responder.rb
119
132
  - templates/lib/tasks/annotate.rake
133
+ - templates/lib/tasks/dev.rake
120
134
  - templates/lib/templates/rails/responders_controller/controller.rb
121
- - templates/ruby_version
135
+ - templates/ruby-version
122
136
  homepage: https://github.com/kebab-project/cybele
123
137
  licenses:
124
138
  - MIT