index.template 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <button id="install" style="display:none;" class="recommend">
  2. Install this App
  3. </button>
  4. <script>
  5. if('mozApps' in navigator){
  6. (function(ic){
  7. ic.onsuccess = function(){
  8. if(ic.result){
  9. $('button#install').hide();
  10. }else{
  11. $('button#install').click(function(e){
  12. e.preventDefault();
  13. // install the app
  14. var request = navigator.mozApps.install(location.origin+'/bugs.webapp');
  15. request.onsuccess = function(data){
  16. replaceState('page-index');
  17. };
  18. request.onerror = function(){
  19. // App wasn't installed, info is in
  20. // installapp.error.name
  21. error(request.error.name);
  22. };
  23. return false;
  24. }).show();
  25. };
  26. };
  27. })(navigator.mozApps.checkInstalled(location.origin+"/bugs.webapp"));
  28. }
  29. </script>
  30. <h3>
  31. Welcome to Bugs
  32. </h3>
  33. <p>
  34. Bugs is a project issue tracker.
  35. </p>
  36. {{#if key}}
  37. <div>
  38. <section data-type="list">
  39. <header>
  40. Latest Issues
  41. </header>
  42. <ul>
  43. {{#each activity}}
  44. <li>
  45. <aside class="pack-end">
  46. <time style="font-size:smaller;" class="timeago">
  47. {{timestamp}}
  48. </time>
  49. </aside>
  50. <a href="{{url}}">
  51. <p>
  52. {{rel.title}}
  53. </p>
  54. <p>
  55. {{action}}
  56. </p>
  57. </a>
  58. </li>
  59. {{/each}}
  60. </ul>
  61. </section>
  62. </div>
  63. {{else}}
  64. <a class="button" href="#page-register">
  65. Register
  66. </a>
  67. <a class="button" href="#page-login">
  68. Login
  69. </a>
  70. {{/if}}