Skip to content

Commit

Permalink
fix layout error
Browse files Browse the repository at this point in the history
  • Loading branch information
ismail Akbudak committed Jun 21, 2016
1 parent c4536a9 commit 6babcef
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 5 deletions.
6 changes: 6 additions & 0 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,12 @@ def setup_namespaces
copy_file 'app/controllers/hq/sessions_controller.rb', 'app/controllers/hq/sessions_controller.rb'
directory 'app/views/hq/sessions', 'app/views/hq/sessions'

remove_file 'app/views/layouts/hq/application.html.haml'
template 'app/views/layouts/hq/application.html.haml.erb', 'app/views/layouts/hq/application.html.haml', force: true

remove_file 'app/views/layouts/hq/login.html.haml'
template 'app/views/layouts/hq/login.html.haml.erb', 'app/views/layouts/hq/login.html.haml', force: true

# User
copy_file 'app/controllers/user/user_application_controller.rb', 'app/controllers/user/user_application_controller.rb'

Expand Down
2 changes: 1 addition & 1 deletion templates/app/controllers/user/passwords_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class User::PasswordsController < Devise::PasswordsController
layout 'user/login'
# layout 'user/login'

private

Expand Down
2 changes: 1 addition & 1 deletion templates/app/controllers/user/profiles_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def profile_params
.permit(
:name,
:surname,
:timezone
:time_zone
)
end
end
2 changes: 1 addition & 1 deletion templates/app/controllers/user/registrations_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class User::RegistrationsController < Devise::RegistrationsController
layout 'user/application'
# layout 'user/application'
before_action :authenticate_user!
before_action :redirect_user, only: [:new, :create, :destroy]
add_breadcrumb I18n.t('activerecord.models.user'), :user_root_path
Expand Down
2 changes: 1 addition & 1 deletion templates/app/controllers/user/sessions_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class User::SessionsController < Devise::SessionsController
layout 'user/login'
# layout 'user/login'

private

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'application_responder'

class User::UserApplicationController < ActionController::Base
layout 'user/application'
# layout 'user/application'
before_action :authenticate_user!
self.responder = ApplicationResponder
respond_to :html, :json
Expand Down
55 changes: 55 additions & 0 deletions templates/app/views/layouts/hq/application.html.haml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
!!! 5
/[if IE 8] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
/[if IE 9] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
/[if lt IE 10] <html class="no-js lt-ie10" lang="en-us">
%html{lang: 'en', class: 'no-js'}
%head
%title= content_for?(:title) ? "#{yield(:title)} - <%= app_name %>" : '<%= app_name %>'
%meta(http-equiv="content-type" content="text/html" charset="utf-8")
%meta(http-equiv="x-ua-compatible" content="ie=edge,chrome=1")
%meta(name="description" content="<%= app_name %>")
%meta(name="author" content="<%= app_name %>")
%meta{content: 'initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width', name: 'viewport'}
%meta(name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)")
%meta(name='apple-mobile-web-app-capable' content='yes')
%meta(name='apple-mobile-web-app-status-bar-style' content='translucent-black')

%link(rel="shortcut icon" href="/images/favicon.png")

= csrf_meta_tags

/ Stylesheets (Don't change include order)
= stylesheet_link_tag 'hq/application',
'//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css',
'//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css',
media: 'all', 'data-turbolinks-track' => true

/ Javascripts
= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js',
'hq/application', 'data-turbolinks-track' => true
= yield :head

%body.main

/ Navbar
= render partial: 'layouts/hq/partials/navbar'

#wrapper

/ Sidebar
%section#sidebar
= render partial: 'layouts/hq/partials/dock'

/ Tools
%section#tools
= render partial: 'layouts/hq/partials/breadcrumb'
= render partial: 'layouts/hq/partials/toolbar'

/ Content
#content
= render 'layouts/partials/warnings'
= render partial: 'layouts/partials/messages'
= yield

/ Footer
= render partial: 'layouts/hq/partials/footer'
34 changes: 34 additions & 0 deletions templates/app/views/layouts/hq/login.html.haml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
!!! 5
/[if IE 8] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
/[if IE 9] <html class="no-js lt-ie10 lt-ie9" lang="en-us">
/[if lt IE 10] <html class="no-js lt-ie10" lang="en-us">
%html{lang: 'en', class: 'no-js'}
%head
%title= yield :title
%meta(http-equiv="content-type" content="text/html" charset="utf-8")
%meta(http-equiv="x-ua-compatible" content="ie=edge,chrome=1")
%meta(name="description" content="")
%meta(name="author" content="")
%meta{content: 'initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width', name: 'viewport'}
%meta(name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)")
%meta(name='apple-mobile-web-app-capable' content='yes')
%meta(name='apple-mobile-web-app-status-bar-style' content='translucent-black')

%link(rel="shortcut icon" href="/images/favicon.png")

/ Stylesheets (Don't change include order)
= stylesheet_link_tag 'hq/application',
'//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css',
media: 'all', 'data-turbolinks-track' => true
= yield :head

%body.login
= render 'layouts/partials/warnings'
.wrapper
= render partial: 'layouts/partials/messages'
= yield

%br/
.text-center.text-muted
= render partial: 'layouts/hq/partials/footer'
= render file: 'public/VERSION.txt'

0 comments on commit 6babcef

Please sign in to comment.