Permalink
Browse files

added some links in github block

  • Loading branch information...
msoap committed Apr 3, 2012
1 parent 8d3a1bd commit f7817f186e233f150ca639971bd5d17bb148828a
Showing with 35 additions and 5 deletions.
  1. +18 −0 index.html
  2. +16 −4 js/script.js
  3. +1 −1 js/script.min.js
View
@@ -109,6 +109,24 @@ <h2>linked.in</h2>
<a href="${link_to_all}">All items&hellip;</a>
</ul>
</script>
+ <script id="tmpl_links_block_github" type="text/x-jquery-tmpl">
+ <span class="service_title">${name}</span>
+ <ul>
+ {{each(i, item) items}}
+ <li title="${item.description}">
+ ${item.title}.
+ ({{each(j, url_item) item.urls}}
+ <a href="${url_item.url}">${url_item.title}</a>
+ {{if j < item.urls.length - 1}}
+ /
+ {{/if}}
+ {{/each}})
+ <span class="item_data">${item.date}</span>
+ </li>
+ {{/each}}
+ <a href="${link_to_all}">All items&hellip;</a>
+ </ul>
+ </script>
<!-- Yandex.Metrika counter -->
<div style="display:none;"><script type="text/javascript">
View
@@ -46,16 +46,26 @@ var App = {
name: 'Github repositories:',
link_to_all: 'http://github.com/msoap',
items: github_data.data.map(function(i) {
+
+ var urls = [];
+ if (i.homepage.length) {
+ urls.push({title: "home", url: i.homepage})
+ };
+ urls.push({title: "repo", url: i.html_url});
+ if (i.has_wiki) {
+ urls.push({title: "wiki", url: i.html_url + '/wiki'})
+ };
+
return {
title: i.description,
description: i.description,
- url: i.html_url,
+ urls: urls,
date: new Date(i.updated_at).toLocaleDateString()
};
})
};
- App.render_any('div#github', vars);
+ App.render_any('div#github', vars, "script#tmpl_links_block_github");
});
},
@@ -176,7 +186,9 @@ var App = {
},
// -------- render any block ---------
- render_any: function(where_selector, vars) {
- $("script#tmpl_links_block").tmpl(vars).appendTo(where_selector);
+ render_any: function(where_selector, vars, template) {
+ if (! template)
+ template = "script#tmpl_links_block";
+ $(template).tmpl(vars).appendTo(where_selector);
}
};
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

0 comments on commit f7817f1

Please sign in to comment.