Skip to content

Commit

Permalink
Frontend - add Bootstrap to the layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
etdsoft committed Jun 23, 2014
1 parent ef2dd79 commit 6f8b22c
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 11 deletions.
6 changes: 2 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ gem 'sdoc', '~> 0.4.0', group: :doc
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring', group: :development

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

Expand All @@ -40,8 +37,9 @@ gem 'spring', group: :development

# --------------------------------------------------------- Dradis dependencies

# Dradis::Core
# Dradis::Core, ::Frontend
gemspec path: 'engines/core'
gemspec path: 'engines/frontend'

# In Production we need to be able to compile assets
# gem 'execjs'
Expand Down
15 changes: 15 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ PATH
dradis_core (3.0.0)
rails (~> 4.1.1)

PATH
remote: engines/frontend
specs:
dradis_frontend (3.0.0)
bcrypt (~> 3.1.7)
bootstrap-sass (~> 2.3.2.2)
rails (~> 4.1.1)
warden (~> 1.2.3)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -35,6 +44,9 @@ GEM
thread_safe (~> 0.1)
tzinfo (~> 1.1)
arel (5.0.1.20140414130214)
bcrypt (3.1.7)
bootstrap-sass (2.3.2.2)
sass (~> 3.2)
builder (3.2.2)
capybara (2.3.0)
mime-types (>= 1.16)
Expand Down Expand Up @@ -185,6 +197,8 @@ GEM
uglifier (2.5.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
warden (1.2.3)
rack (>= 1.0)
xpath (2.0.0)
nokogiri (~> 1.3)

Expand All @@ -198,6 +212,7 @@ DEPENDENCIES
coffee-rails (~> 4.0.0)
database_cleaner
dradis_core!
dradis_frontend!
factory_girl (~> 2.6.4)
guard-rspec
jbuilder (~> 2.0)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//= require jquery
//= require bootstrap
//= require_self

jQuery ->
if $('body').hasClass('unauthenticated')
$('body').
removeClass('unauthenticated').
addClass('alert').
addClass('alert-error')
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
/*
*= require_self
*/

@import 'bootstrap';
@import 'bootstrap-responsive';

body.authenticated {
background-color: green;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Foobar</title>
<title>Unauthenticated</title>
<%= stylesheet_link_tag 'dradis/frontend/manifests/application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'dradis/frontend/manifests/application', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body class="unauthenticated">
<%= yield %>
<div class="container">
<%= yield%>
</div>

<%= javascript_include_tag 'dradis/frontend/manifests/application', 'data-turbolinks-track' => true %>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<title>Foobar</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
<title>Authenticated</title>
<%= stylesheet_link_tag 'dradis/frontend/manifests/application', media: 'all', 'data-turbolinks-track' => true %>
<%= csrf_meta_tags %>

<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body class="authenticated">
<%= yield %>
<div class="container">
<%= yield%>
</div>

<%= javascript_include_tag 'dradis/frontend/manifests/application', 'data-turbolinks-track' => true %>
</body>
</html>
3 changes: 3 additions & 0 deletions engines/frontend/dradis_frontend.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ Gem::Specification.new do |s|
s.test_files = s.files.grep(%r{^(test|spec|features)/})

s.add_dependency 'rails', '~> 4.1.1'
s.add_dependency 'bcrypt', '~> 3.1.7'
s.add_dependency 'bootstrap-sass', '~> 2.3.2.2'
s.add_dependency 'warden', '~> 1.2.3'
end
3 changes: 3 additions & 0 deletions engines/frontend/lib/dradis_frontend.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
require 'dradis/frontend/version'
require 'dradis/frontend/engine'

require 'bootstrap-sass'
require 'warden'

module Dradis
module Frontend
end
Expand Down
Binary file added vendor/cache/bcrypt-3.1.7.gem
Binary file not shown.
Binary file added vendor/cache/bootstrap-sass-2.3.2.2.gem
Binary file not shown.
Binary file added vendor/cache/warden-1.2.3.gem
Binary file not shown.

0 comments on commit 6f8b22c

Please sign in to comment.