Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Show all available badges on GET / #43

Merged
merged 2 commits into from

2 participants

@stenington
Owner

It really does.

@stenington
Owner

For @brianloveswords to review, and/or I'm just going to merge this and review and fixes can happen later.

@brianloveswords brianloveswords merged commit dd4a4f3 into mozilla:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 10, 2012
  1. @stenington
  2. @stenington

    Add top copy to all.html

    stenington authored
This page is out of date. Refresh to see the latest.
Showing with 49 additions and 1 deletion.
  1. +2 −1  app.js
  2. +6 −0 routes/admin.js
  3. +41 −0 views/public/all.html
View
3  app.js
@@ -37,6 +37,7 @@ app.configure(function () {
}));
app.use(user.requireAuth({
whitelist: [
+ '/',
'/login',
'/logout',
'/badge/*', // public badge resources
@@ -65,7 +66,7 @@ app.post('/admin/config', issuer.update);
// Badge listing
// -------------
var indexMiddleware = [badge.findAll, behavior.findAll];
-app.get('/', indexMiddleware, admin.badgeIndex);
+app.get('/', badge.findAll, admin.all);
app.get('/admin', indexMiddleware, admin.badgeIndex);
app.get('/admin/badges', indexMiddleware, admin.badgeIndex);
View
6 routes/admin.js
@@ -76,6 +76,12 @@ exports.criteria = function criteria(req, res) {
});
}
+exports.all = function all(req, res) {
+ return res.render('public/all.html', {
+ badges: req.badges,
+ });
+};
+
exports.claim = function claim(req, res) {
return res.render('public/claim.html', {
csrf: req.session._csrf,
View
41 views/public/all.html
@@ -0,0 +1,41 @@
+{% extends "public/layout.html" %}
+{% block head %}
+ <link rel="stylesheet" href="/stylesheets/criteria.css">
+{% endblock %}
+{% block body %}
+ <div class="row">
+ <div class="span7">
+ <h2>Mozilla Webmaker Badges</h2>
+ </div>
+ <div class="span10">
+ <strong>Webmaker Badges are here!</strong>
+ <p>
+ Badges are digital records of skills, achievements and participation. Now you can earn Webmaker Badges to recognize the skills that you learn while making awesome webmaking projects, as well as for participating in the Webmaker community and events.
+ </p>
+ <p>
+ Head over to <a href="https://thimble.webmaker.org">Thimble</a>, pick a project and sign in to start earning!
+ </p>
+ </div>
+ </div>
+ {% for badge in badges %}
+ <div class="media card">
+ <img class="img badge" src="{{ badge.relativeUrl('image')}}">
+ <div class="bd">
+ <hgroup>
+ <span class="wordmark">Mozilla</span>
+ <h1>{{ badge.name }}</h1>
+ </hgroup>
+ <dl class="dl-horizontal narrow-dt">
+ <dt>Description:</dt>
+ <dd>
+ {% if badge.criteria.content %}
+ {{ badge.criteria.content | markdown }}
+ {% else %}
+ {{ badge.description | stupidSafe }}
+ {% endif %}
+ </dd>
+ </dl>
+ </div>
+ </div>
+ {% endfor %}
+{% endblock %}
Something went wrong with that request. Please try again.