Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Add release notes to the start page
Browse files Browse the repository at this point in the history
  • Loading branch information
pfrazee committed Feb 22, 2017
1 parent 456b289 commit 599b490
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
23 changes: 23 additions & 0 deletions app/builtin-pages/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ sites loaded over the beaker: protocol
import * as yo from 'yo-yo'
import co from 'co'

const LATEST_VERSION = 6001 // semver where major*1mm and minor*1k; thus 3.2.1 = 3002001

// globals
// =

Expand All @@ -16,13 +18,21 @@ var builtinPages = [
{ href: 'beaker:downloads', label: 'Downloads', icon: 'down' }
]

var showReleaseNotes = false
var isAddingPin = false
var bookmarks, pinnedBookmarks

co(function* () {
bookmarks = (yield beakerBookmarks.list()) || []
pinnedBookmarks = (yield beakerBookmarks.listPinned()) || []
update()

let latestVersion = yield beakerSitedata.get('beaker:start', 'latest-version')
if (+latestVersion < LATEST_VERSION) {
showReleaseNotes = true
update()
beakerSitedata.set('beaker:start', 'latest-version', LATEST_VERSION)
}
})

// rendering
Expand All @@ -33,9 +43,22 @@ function update () {
<div class="start-wrapper">
${renderPinned()}
${renderBookmarks()}
${renderReleaseNotes()}
</div>
`)
}

function renderReleaseNotes () {
if (!showReleaseNotes) {
return ''
}
return yo`
<div class="alert alert__info alert__release-notes">
<strong>Welcome to Beaker 0.6.1!</strong>
New start page, Dat-DNS, and an improved bkr command-line.
<a href="https://github.com/beakerbrowser/beaker/releases/tag/0.6.1">Learn more</a>
</div>
`
}

function renderPinned () {
Expand Down
14 changes: 13 additions & 1 deletion app/stylesheets/builtin-pages.less
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,23 @@ form#add-pinned-site {
border: 1px solid transparent;
border-radius: 4px;


&__info {
color: #31708f;
background-color: #d9edf7;
border-color: #bce8f1;

a {
color: #31708f;
text-decoration: underline;
}
}

&__release-notes {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
white-space: nowrap;
}
}

0 comments on commit 599b490

Please sign in to comment.