mirror of
https://github.com/status-im/burnchart.git
synced 2025-01-19 15:12:05 +00:00
info page
This commit is contained in:
parent
9ff502bf59
commit
abab523883
@ -6,14 +6,22 @@ Router = require 'route66'
|
|||||||
config = require './modules/config'
|
config = require './modules/config'
|
||||||
{ Repo } = require './modules/repo'
|
{ Repo } = require './modules/repo'
|
||||||
|
|
||||||
|
# Render an eco template into selector.
|
||||||
|
show = (selector, template, context = {}) ->
|
||||||
|
tml = require "./templates/#{template}"
|
||||||
|
document.querySelector(selector).innerHTML = tml context
|
||||||
|
|
||||||
module.exports = ->
|
module.exports = ->
|
||||||
|
# Show info notice?
|
||||||
|
show 'body', 'info' unless location.hash
|
||||||
|
|
||||||
# A new router.
|
# A new router.
|
||||||
new Router().path
|
new Router().path
|
||||||
'/:user/:repo': ->
|
'/:user/:repo': ->
|
||||||
repo = _.toArray(arguments).join('/')
|
repo = _.toArray(arguments).join('/')
|
||||||
|
|
||||||
# Render the body.
|
# Render the body.
|
||||||
document.querySelector('body').innerHTML = do require('./templates/body')
|
show 'body', 'graph'
|
||||||
|
|
||||||
# Get config/cache.
|
# Get config/cache.
|
||||||
async.waterfall [ config
|
async.waterfall [ config
|
||||||
|
@ -19,7 +19,9 @@
|
|||||||
"modules/regex.coffee",
|
"modules/regex.coffee",
|
||||||
"modules/request.coffee",
|
"modules/request.coffee",
|
||||||
"modules/repo.coffee",
|
"modules/repo.coffee",
|
||||||
"templates/body.eco",
|
"templates/error.eco",
|
||||||
|
"templates/graph.eco",
|
||||||
|
"templates/info.eco",
|
||||||
"templates/label.eco",
|
"templates/label.eco",
|
||||||
"templates/progress.eco"
|
"templates/progress.eco"
|
||||||
],
|
],
|
||||||
|
@ -16,14 +16,31 @@ h2
|
|||||||
font-size: 14px
|
font-size: 14px
|
||||||
text-transform: uppercase
|
text-transform: uppercase
|
||||||
|
|
||||||
#repos
|
.box
|
||||||
color: #FFF
|
|
||||||
|
|
||||||
#box
|
|
||||||
background: #43444f
|
background: #43444f
|
||||||
border-radius: 6px
|
color: #FFF
|
||||||
box-shadow: 2px 4px 6px rgba(0,0,0,0.2)
|
box-shadow: 2px 4px 6px rgba(0,0,0,0.2)
|
||||||
|
|
||||||
|
&.info, &.error, &.success
|
||||||
|
border-top: 4px solid #E2E2E2
|
||||||
|
|
||||||
|
&.info
|
||||||
|
border-top-color: #96CFFB
|
||||||
|
|
||||||
|
&.error
|
||||||
|
border-top-color: #FE5D55
|
||||||
|
|
||||||
|
&.info, &.error
|
||||||
|
padding: 20px
|
||||||
|
width: 50%
|
||||||
|
margin: 0 auto
|
||||||
|
|
||||||
|
&.success
|
||||||
|
border-top-color: #4ACAB4
|
||||||
|
|
||||||
|
a
|
||||||
|
color: #FFF
|
||||||
|
|
||||||
#progress
|
#progress
|
||||||
padding: 20px
|
padding: 20px
|
||||||
border-radius: 0 0 6px 6px
|
border-radius: 0 0 6px 6px
|
||||||
@ -66,7 +83,6 @@ h2
|
|||||||
|
|
||||||
#graph
|
#graph
|
||||||
background: #FFF
|
background: #FFF
|
||||||
border-radius: 6px 6px 0 0
|
|
||||||
height: 200px
|
height: 200px
|
||||||
|
|
||||||
svg
|
svg
|
||||||
|
3
src/templates/error.eco
Normal file
3
src/templates/error.eco
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
<div class="box" id="info">
|
||||||
|
<p>Hello trouble</p>
|
||||||
|
</div>
|
@ -1,5 +1,4 @@
|
|||||||
<div id="repos"></div>
|
<div class="box">
|
||||||
<div id="box">
|
|
||||||
<div id="graph"></div>
|
<div id="graph"></div>
|
||||||
<div id="progress"></div>
|
<div id="progress"></div>
|
||||||
</div>
|
</div>
|
4
src/templates/info.eco
Normal file
4
src/templates/info.eco
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<div class="box info" id="info">
|
||||||
|
<h2>GitHub Burndown Chart</h2>
|
||||||
|
<p>Use your browser's location hash to specify a repo: <a href="#!/radekstepan/disposable">#!/radekstepan/disposable</a>.</p>
|
||||||
|
</div>
|
Loading…
x
Reference in New Issue
Block a user