Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Styling Gist Event

  • Loading branch information...
commit cefa4c1e32b986e56c059d76f0cfa455aa3d6fe2 1 parent 6e8aa46
@zmoazeni authored
View
4 coffee/site.coffee
@@ -63,6 +63,8 @@ class Event extends Spine.Model
when "FollowEvent" then "follow"
when "PullRequestEvent"
if @payload.action == "opened" then "pull_request" else "skip"
+ when "GistEvent"
+ if @payload.action == "create" then "gist" else "skip"
when "CreateEvent"
switch @payload.ref_type
when "branch"
@@ -77,6 +79,8 @@ class Event extends Spine.Model
switch view
when "item"
[view, id:@id, title:@type, date:@created_at_short_string()]
+ when "gist"
+ [view, id:@id, url:@payload.gist.html_url, date:@created_at_short_string()]
when "issue"
[view,
id:@id
View
8 coffee/views.coffee
@@ -121,6 +121,14 @@ views["issue"] = """
</li>
"""
+views["gist"] = """
+<li class="item" data-id="{{id}}">
+ <span class="corner"></span>
+ <h1>Created a <a href="{{url}}">gist</a></h1>
+ <span class="date">{{date}}</span>
+</li>
+"""
+
views["issue_comment"] = """
<li class="item" data-id="{{id}}">
<span class="corner"></span>
View
15 js/site.js
@@ -147,6 +147,13 @@
return "skip";
}
break;
+ case "GistEvent":
+ if (this.payload.action === "create") {
+ return "gist";
+ } else {
+ return "skip";
+ }
+ break;
case "CreateEvent":
switch (this.payload.ref_type) {
case "branch":
@@ -185,6 +192,14 @@
date: this.created_at_short_string()
}
];
+ case "gist":
+ return [
+ view, {
+ id: this.id,
+ url: this.payload.gist.html_url,
+ date: this.created_at_short_string()
+ }
+ ];
case "issue":
return [
view, {
View
2  js/views.js
@@ -32,6 +32,8 @@
views["issue"] = "<li class=\"item\" data-id=\"{{id}}\">\n <span class=\"corner\"></span>\n <h1>Opened an <a href=\"{{url}}\">issue</a> on <a href=\"{{repo_url}}\">{{repo}}</a></h1>\n <blockquote>{{title}}</blockquote>\n <blockquote>{{comment}}</blockquote>\n <span class=\"date\">{{date}}</span>\n</li>";
+ views["gist"] = "<li class=\"item\" data-id=\"{{id}}\">\n <span class=\"corner\"></span>\n <h1>Created a <a href=\"{{url}}\">gist</a></h1>\n <span class=\"date\">{{date}}</span>\n</li>";
+
views["issue_comment"] = "<li class=\"item\" data-id=\"{{id}}\">\n <span class=\"corner\"></span>\n <h1>Commented on an <a href=\"{{url}}\">issue</a> on <a href=\"{{repo_url}}\">{{repo}}</a></h1>\n <blockquote>{{comment}}</blockquote>\n <span class=\"date\">{{date}}</span>\n</li>";
views["commit_comment"] = "<li class=\"item\" data-id=\"{{id}}\">\n <span class=\"corner\"></span>\n <h1>Commented on a <a href=\"{{url}}\">commit</a> on <a href=\"{{repo_url}}\">{{repo}}</a></h1>\n <blockquote>{{comment}}</blockquote>\n <span class=\"date\">{{date}}</span>\n</li>";
Please sign in to comment.
Something went wrong with that request. Please try again.