This repository has been archived by the owner on Feb 7, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added nunjucks clientside, registry is working, needs styles
- Loading branch information
Showing
5 changed files
with
3,283 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<x-template name="search-item"> | ||
<script type="template/script"> | ||
</script> | ||
<script type="template/content"> | ||
{% raw %} | ||
<div class="tag-header"> | ||
<h3> | ||
<a class="tag-name" href="http://registry.x-tags.org/{{registry_path}}/view">{{ name }}</a> | ||
<span class="tag-author">by <a target="_blank" href="{{repo}}">{{author}}</a> | ||
</span> | ||
</h3> | ||
<ul class="tag-categories"> | ||
{% for cat in category %} | ||
<li>{{ cat }}</li> | ||
{% endfor %} | ||
</ul> | ||
</div> | ||
<p class="tag-description">{{description}}</p> | ||
{% endraw %} | ||
</script> | ||
</x-template> | ||
|
||
<script type="text/javascript"> | ||
|
||
document.addEventListener('DOMComponentsLoaded', function(){ | ||
document.getElementsByName('search-item')[0].renderer = function(elem, template, data){ | ||
data.registry_path = data.repo.replace('https://github.com/','') + '/' + data.tag_name; | ||
var tmpl = new nunjucks.Template(template); | ||
return tmpl.render(data); | ||
}; | ||
}); | ||
|
||
xtag.register('x-search-result',{ | ||
mixins: ['template'], | ||
onCreate: function(){ | ||
this.setAttribute('template','search-item'); | ||
} | ||
}); | ||
|
||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.