Skip to content

Commit

Permalink
add hq layouts partials
Browse files Browse the repository at this point in the history
  • Loading branch information
ismail Akbudak committed Jun 21, 2016
1 parent 0c104e3 commit 6e6fa6d
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 17 deletions.
1 change: 1 addition & 0 deletions dump.rdb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REDIS0006�ܳC�Z��V
21 changes: 6 additions & 15 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def generate_devise_settings
end

def generate_devise_user
generate 'devise User name:string surname:string is_active:boolean'
generate 'devise User name:string surname:string is_active:boolean time_zone:string'
generate_devise_strong_parameters('user')
remove_file 'config/locales/devise.en.yml', force: true
end
Expand All @@ -279,7 +279,7 @@ def generate_welcome_page
end

def setup_namespaces
generate 'devise Admin name:string surname:string is_active:boolean'
generate 'devise Admin name:string surname:string is_active:boolean time_zone:string'

directory 'app/controllers/hq', 'app/controllers/hq'
directory 'app/views/hq', 'app/views/hq'
Expand Down Expand Up @@ -403,6 +403,10 @@ def copy_files
template 'app/views/layouts/hq/application.html.haml.erb', 'app/views/layouts/hq/application.html.haml', force: true
remove_file 'app/views/layouts/login.html.haml', force: true
template 'app/views/layouts/hq/login.html.haml.erb', 'app/views/layouts/hq/login.html.haml', force: true
remove_file 'app/views/layouts/partials/_navbar.html.haml', force: true
template 'app/views/layouts/partials/_navbar.html.haml.erb', 'app/views/layouts/partials/_navbar.html.haml', force: true
remove_file 'app/views/layouts/partials/_dock.html.haml', force: true
template 'app/views/layouts/partials/_dock.html.haml.erb', 'app/views/layouts/partials/_dock.html.haml', force: true

# Mailer layout files
template 'app/views/layouts/mailer.html.haml.erb', 'app/views/layouts/mailer.html.haml', force: true
Expand Down Expand Up @@ -492,22 +496,9 @@ def create_sanitizer_initializer(model_name)
end

def devise_parameter_sanitizer(model_name)
# inject_into_file 'app/controllers/application_controller.rb', after: 'protect_from_forgery with: :exception' do <<-CODE
# protected
# def devise_parameter_sanitizer
# if resource_class == #{model_name.classify}
# #{model_name.classify}::ParameterSanitizer.new(#{model_name.classify}, :#{model_name.parameterize}, params)
# else
# super # Use the default one
# end
# end
# CODE
# end
end

def add_time_zone_to_user
say 'Add time_zone to User model'
generate 'migration AddTimeZoneToUser time_zone:string -s'
end


Expand Down
2 changes: 1 addition & 1 deletion templates/README.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Set .env.local variables
Set access_token in config/initializers/rollbar.rb
Set default values for is_active, time_zone variable using in User and Admin model migrations db/migrate/*.rb
Change username and password in config/settings.yml

ln -s ../VERSION.txt VERSION.txt
We are using sidekiq with redis-server for background jobs.

Clone project run this commands in terminal
Expand Down
2 changes: 1 addition & 1 deletion templates/app/controllers/hq/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Hq::SessionsController < Devise::SessionsController
layout 'login'
layout 'hq/login'

private

Expand Down
8 changes: 8 additions & 0 deletions templates/app/views/layouts/hq/partials/_dock.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%i#toggle.icon-align-justify.icon-large

%ul#dock
%li.launcher
%i.icon-dashboard
=link_to t('dock.dashboard'), hq_dashboard_index_path

#beaker{data: {toggle: 'tooltip'}, title: 'Made by lab2023'}
17 changes: 17 additions & 0 deletions templates/app/views/layouts/hq/partials/_navbar.html.haml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#navbar.navbar.navbar-default
%a.navbar-brand{href: hq_root_path}
%i.icon-beer
<%= app_name %>
%ul.nav.navbar-nav.pull-right
%li.dropdown.user
%a.dropdown-toggle{'data-toggle' => 'dropdown', href: '#'}
%i.icon-user
%strong
= current_admin.email
%b.caret
%ul.dropdown-menu
%li
=link_to t('navbar.edit_profile'), edit_admin_registration_path
%li.divider
%li
=link_to t('navbar.signout'), destroy_admin_session_path, method: :delete

0 comments on commit 6e6fa6d

Please sign in to comment.