Create separate stylesheets for dashboard and the rest

This commit is contained in:
Piotr Sarnacki 2015-01-15 10:47:34 +01:00
parent 2396fb925d
commit fc0c549556
9 changed files with 41 additions and 6 deletions

View File

@ -71,10 +71,15 @@ end
output 'public/styles'
input assets.styles do
match '**/*.{scss,sass,css}' do
match 'app/**/*.{scss,sass,css}' do
sass assets.production? ? { style: :compressed } : {}
concat assets.styles_order, ['app.css']
end
match 'dashboard/**/*.{scss,sass,css}' do
sass assets.production? ? { style: :compressed } : {}
concat assets.styles_order, ['dashboard.css']
end
end
output 'public/images'

View File

@ -2,6 +2,13 @@ require 'routes/route'
TravisRoute = Travis.Route
Route = TravisRoute.extend()
Route = TravisRoute.extend
activate: ->
@get('stylesheetsManager').disable('main')
@get('stylesheetsManager').enable('dashboard')
deactivate: ->
@get('stylesheetsManager').enable('main')
@get('stylesheetsManager').disable('dashboard')
Travis.DashboardRoute = Route

View File

@ -1 +1 @@
DASHBOARD GOES HERE!
<h1>DASHBOARD GOES HERE!</h1>

View File

@ -190,6 +190,21 @@ Travis.initializer
application.inject('route', 'pusher', 'pusher:main')
stylesheetsManager = Ember.Object.create
enable: (id) ->
$("##{id}").removeAttr('disabled')
disable: (id) ->
$("##{id}").attr('disabled', 'disabled')
Travis.initializer
name: 'inject-stylesheets-manager'
initialize: (container, application) ->
application.register 'stylesheetsManager:main', stylesheetsManager, { instantiate: false }
application.inject('route', 'stylesheetsManager', 'stylesheetsManager:main')
Travis.Router.reopen
didTransition: ->
@_super.apply @, arguments

View File

@ -1,4 +1,4 @@
@import "app/compass"
@import "compass"
@import "app/_mixins/colors"
@import "app/_mixins/fonts"

View File

@ -1,4 +1,4 @@
@import "app/compass";
@import "compass";
.pro {
form.subscription-form {

View File

@ -0,0 +1,3 @@
h1 {
color: #A80000;
}

View File

@ -23,7 +23,8 @@
<link rel="dns-prefetch" href="//api.github.com">
<link rel="dns-prefetch" href="//www.gravatar.com">
<link rel="icon" type="image/png" href="/favicon.ico">
<link rel="stylesheet" href="/styles/app.css">
<link rel="stylesheet" href="/styles/app.css" id="main">
<link rel="stylesheet" href="/styles/dashboard.css" id="dashboard" />
<script src="/scripts/app.js"></script>
<script>
minispade.require('travis')

View File

@ -0,0 +1,4 @@
/* line 1, /Users/drogus/code/travis/travis-web/assets/styles/dashboard/dashboard.scss */
h1 {
color: #A80000;
}