index.template 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 Activity
  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. <a class="more">
  62. latest
  63. </a>
  64. </section>
  65. </div>
  66. {{else}}
  67. <a class="button" href="#page-register">
  68. Register
  69. </a>
  70. <a class="button" href="#page-login">
  71. Login
  72. </a>
  73. {{/if}}