Merge pull request #179 from arturhoo/feature/svg-badges

Use SVG badges instead of PNG
This commit is contained in:
Brad Rydzewski 2014-03-16 22:33:53 -07:00
commit 5c848d647a
5 changed files with 12 additions and 11 deletions

View file

@ -1,5 +1,6 @@
# This file lists all individuals having contributed content to the repository.
# If you're submitting a patch, please add your name here in alphabetical order as part of the patch.
Artur Rodrigues <arturhoo@gmail.com>
Brad Rydzewski <brad@drone.io>
Thomas Burke <burke@drone.io>
Thomas Burke <burke@drone.io>

View file

@ -1,7 +1,7 @@
Drone is a [Continuous Integration](http://en.wikipedia.org/wiki/Continuous_integration) platform built on [Docker](https://www.docker.io/)
[![Build Status](http://beta.drone.io/github.com/drone/drone/status.png?branch=master)](http://beta.drone.io/github.com/drone/drone)
[![GoDoc](https://godoc.org/github.com/drone/drone?status.png)](https://godoc.org/github.com/drone/drone)
[![Build Status](http://beta.drone.io/github.com/drone/drone/status.svg?branch=master)](http://beta.drone.io/github.com/drone/drone)
[![GoDoc](https://godoc.org/github.com/drone/drone?status.svg)](https://godoc.org/github.com/drone/drone)
### Getting Started

View file

@ -209,7 +209,7 @@ func setupHandlers() {
m.Get("/:host/:owner/:name/commit/:branch/:commit/build/:label", handler.RepoHandler(handler.CommitShow))
m.Get("/:host/:owner/:name/commit/:branch/:commit", handler.RepoHandler(handler.CommitShow))
m.Get("/:host/:owner/:name/tree", handler.RepoHandler(handler.RepoDashboard))
m.Get("/:host/:owner/:name/status.png", handler.ErrorHandler(handler.Badge))
m.Get("/:host/:owner/:name/status.svg", handler.ErrorHandler(handler.Badge))
m.Get("/:host/:owner/:name/settings", handler.RepoAdminHandler(handler.RepoSettingsForm))
m.Get("/:host/:owner/:name/params", handler.RepoAdminHandler(handler.RepoParamsForm))
m.Get("/:host/:owner/:name/badges", handler.RepoAdminHandler(handler.RepoBadges))

View file

@ -8,12 +8,12 @@ import (
)
const (
badgeSuccess = "https://img.shields.io/badge/build-success-brightgreen.png"
badgeFailure = "https://img.shields.io/badge/build-failure-red.png"
badgeUnknown = "https://img.shields.io/badge/build-unknown-lightgray.png"
badgeSuccess = "https://img.shields.io/badge/build-success-brightgreen.svg"
badgeFailure = "https://img.shields.io/badge/build-failure-red.svg"
badgeUnknown = "https://img.shields.io/badge/build-unknown-lightgray.svg"
)
// Display a static badge (png format) for a specific
// Display a static badge (svg format) for a specific
// repository and an optional branch.
// TODO this needs to implement basic caching
func Badge(w http.ResponseWriter, r *http.Request) error {

View file

@ -32,13 +32,13 @@
<div class="col-xs-9" role="main">
<form>
<div class="form-group">
<img class="pull-right" src="{{.Host}}/{{.Repo.Slug}}/status.png?branch=master">
<img class="pull-right" src="{{.Host}}/{{.Repo.Slug}}/status.svg?branch=master">
<label>Badge, Markdown format</label>
<textarea class="form-control" rows="3">[![Build Status]({{.Host}}/{{.Repo.Slug}}/status.png?branch=master)]({{.Host}}/{{.Repo.Slug}})</textarea>
<textarea class="form-control" rows="3">[![Build Status]({{.Host}}/{{.Repo.Slug}}/status.svg?branch=master)]({{.Host}}/{{.Repo.Slug}})</textarea>
</div>
<div class="form-group">
<label>Badge, HTML format</label>
<textarea class="form-control" rows="3">&lt;a href="{{.Host}}/{{.Repo.Slug}}"&gt;&lt;img src="{{.Host}}/{{.Repo.Slug}}/status.png?branch=master" /&gt;&lt;/a&gt;</textarea>
<textarea class="form-control" rows="3">&lt;a href="{{.Host}}/{{.Repo.Slug}}"&gt;&lt;img src="{{.Host}}/{{.Repo.Slug}}/status.svg?branch=master" /&gt;&lt;/a&gt;</textarea>
</div>
</form>
</div><!-- ./col-xs-9 -->