Permalink
Browse files

Styling gollum event

  • Loading branch information...
1 parent 760b62f commit a855573a005285ba32f8bb496b48f01c621a3a88 Zach Moazeni committed May 10, 2012
Showing with 57 additions and 1 deletion.
  1. +12 −0 coffee/site.coffee
  2. +20 −0 coffee/views.coffee
  3. +23 −1 js/site.js
  4. +2 −0 js/views.js
View
@@ -78,6 +78,7 @@ class Event extends Spine.Model
if @payload.commits?.length > 0 then "push" else "skip"
when "DeleteEvent" then "skip"
when "WatchEvent" then "watch"
+ when "GollumEvent" then "gollum"
else "item"
viewInfo: ->
@@ -186,6 +187,17 @@ class Event extends Spine.Model
date:@created_at_short_string(),
more:@payload.commits.length > 3
]
+ when "gollum"
+ pages = @payload.pages.map((p, i) => {title:p.title, url:p.html_url, action:p.action, hidden:i > 2})
+ [view,
+ id:@id
+ repo:@repo.name
+ repo_url:"https://github.com/#{@repo.name}"
+ pages:pages
+ num:pages.length
+ date:@created_at_short_string()
+ more:pages.length > 3
+ ]
else []
View
@@ -99,6 +99,26 @@ views["push"] = """
</li>
"""
+views["gollum"] = """
+<li class="item" data-id="{{id}}" data-type="push">
+ <span class="corner"></span>
+ <h1>Updated {{num}} page(s) for <a href="{{repo_url}}">{{repo}}</a></h1>
+ <ol class="commits">
+ {{#pages}}
+ <li {{#hidden}}style="display:none;" data-more{{/hidden}}>{{action}}: <a href="{{url}}">{{title}}</a></li>
+ {{/pages}}
+
+ {{#more}}
+ <li data-more-placeholder>...</li>
+ {{/more}}
+ </ol>
+ {{#more}}
+ <div><a href="#" data-show-more data-alt="less" data-toggled=false>more</a></div>
+ {{/more}}
+ <span class="date">{{date}}</span>
+</li>
+"""
+
views["repository"] = """
<li class="prominent" data-id="{{id}}">
<div class="well">Created: <a href="{{repo_url}}">{{repo}}</a> <div>{{date}}</div></div>
View
Oops, something went wrong.
View
Oops, something went wrong.

0 comments on commit a855573

Please sign in to comment.