docItem.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template name="docItem">
  2. <div class="container top-margin">
  3. <div class="row">
  4. <div class="col-md-12">
  5. {{> docMeta }}
  6. </div>
  7. </div>
  8. <div class="row">
  9. <div class="col-md-12">
  10. {{> editingUsers }}
  11. </div>
  12. </div>
  13. <div class="row">
  14. <div class="col-md-6">
  15. {{> editor}}
  16. </div>
  17. <div class="col-md-6">
  18. {{> viewer }}
  19. </div>
  20. </div>
  21. {{> commentList }}
  22. {{> insertCommentForm }}
  23. </div><!-- end of docItem container -->
  24. </template>
  25. <template name="editor">
  26. <h2>doc id: {{ docid }}</h2>
  27. {{> sharejsCM docid=docid onRender=config id="editor" mode="javascript" }}
  28. </template>
  29. <template name="viewer">
  30. <iframe id="viewer_iframe">
  31. </iframe>
  32. </template>
  33. <template name="docMeta">
  34. {{#with document }}
  35. <span class="h1">{{> editableText collection="documents" field="title" }}</span>
  36. {{#if canEdit }}
  37. <div class="checkbox">
  38. <label>
  39. <input type="checkbox" class="js-tog-private" checked="{{ isPrivate }}"/>Private
  40. </label>
  41. </div>
  42. {{/if}}
  43. {{/with}}
  44. </template>
  45. <template name="editingUsers">
  46. Editors:
  47. {{#each users }}
  48. <span class="label label-success">{{firstname}}</span>
  49. {{/each}}
  50. </template>
  51. <template name="commentList">
  52. <ul>
  53. {{#each comments }}
  54. <li>{{ title }}
  55. <p>{{ body }}</p>
  56. </li>
  57. {{/each}}
  58. </ul>
  59. </template>
  60. <template name="insertCommentForm2">
  61. {{> quickForm collection="Comments" id="insertCommentForm" type="method" meteormethod="addComment" }}
  62. </template>
  63. <template name="insertCommentForm">
  64. {{#autoForm collection="Comments" id="insertCommentForm" type="method" meteormethod="addComment" }}
  65. <fieldset>
  66. <legend>Comment</legend>
  67. {{> afQuickField name="title" }}
  68. {{> afQuickField name="body" rows=6 value="starter text" }}
  69. {{> afQuickField name="docid" value=docid type="hidden" }}
  70. {{> afQuickField name="owner" value="invalid" type="hidden" }}
  71. </fieldset>
  72. <button type="submit" class="btn btn-primary">Insert</button>
  73. {{/autoForm}}
  74. </template>