index.template 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 issues}}
  44. <li>
  45. <aside class="pack-end">
  46. {{user.name}}
  47. </aside>
  48. <a href="#!{{id}}">
  49. <p>
  50. {{#if priority}}[<span style="{{#if color}}color:{{color}};{{/if}}">{{priority}}</span>] {{/if}}{{title}}{{#if status}} ({{status}}){{/if}}
  51. </p>
  52. <p>
  53. {{description}}
  54. </p>
  55. </a>
  56. </li>
  57. {{/each}}
  58. </ul>
  59. </section>
  60. </div>
  61. {{else}}
  62. <a class="button" href="#page-register">
  63. Register
  64. </a>
  65. <a class="button" href="#page-login">
  66. Login
  67. </a>
  68. {{/if}}