rule.html 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. ---
  2. layout: default
  3. # This is where most of the code for CommunityRule lives
  4. # Follow comments below in various sections for further explanation
  5. ---
  6. {% include rule-scripts.html %}
  7. <article class="post">
  8. <header class="post-header">
  9. <h1 class="post-title" id="title">
  10. {{ page.title }}
  11. </h1>
  12. <button class="pushButton" id="editToggle" onclick="toggleEditMode()">
  13. Preview</button>
  14. <div class="post-content">
  15. {{ content }}
  16. </div>
  17. </header>
  18. <div id="rulebox">
  19. <span class="prompt">What is the community’s name?</span>
  20. <h1 contenteditable="true" class="editable output" id="communityname">{{ page.community-name }}</h1>
  21. <span class="prompt">Summarize its structure:</span>
  22. <p contenteditable="true" class="editable output" id="structure">{{ page.structure }}</p>
  23. <!-- RuleBuilder -->
  24. <div id="rule-builder">
  25. <button id="module-toggle" onclick="toggleVisible('module-menu')"
  26. class="button" title="Show/hide">
  27. <img src="{% link assets/tabler_icons/tool.svg %}" title="Modules" />
  28. </button>
  29. <div id="module-input"
  30. ondrop="drop(event)" ondragover="allowDrop(event)">
  31. <span class="prompt" id="drag-directions">Browse modules from below and drag them here.</span>
  32. </div>
  33. <div id="builder-field">
  34. </div>
  35. <div id="module-menu">
  36. <!-- Load preset modules from _modules/ -->
  37. {% assign modules_array = site.modules | sort: "type" %}
  38. {% assign last_type = "" %}
  39. {% for module in modules_array %}
  40. {% if module.layout == "module" %}
  41. {% if module.type != last_type %}
  42. {% if last_type != "" %}</div>{% endif %}
  43. <div class="module-type-header">
  44. <img src="{{ site.baseurl }}/{{ site.data.module_types[module.type].icon }}" />
  45. {{ module.type }}
  46. <button onclick="toggleVisible('module-type-{{ module.type }}')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Show/hide" /></button>
  47. </div>
  48. <div class="module-questions">{{ site.data.module_types[module.type].question }}</div>
  49. <div id="module-type-{{ module.type }}" style="display: none;">
  50. {% endif %}
  51. {% assign last_type = module.type %}
  52. <span class="module" id="module-{{ module.title | slugify }}"
  53. draggable="true" ondragstart="drag(event)">
  54. <span id="module-name" title="{{ module.summary }}">{{ module.title }}</span>
  55. <a target="_blank" href="{{ module.url }}">
  56. <img title="More info" draggable="false" class="module-logo"
  57. src="{% link assets/tabler_icons/info-circle.svg %}" /></a>
  58. <a onclick="this.parentNode.remove()" class="delete-module"
  59. style="display:none">
  60. <img src="{% link assets/tabler_icons/x.svg %}" /></a>
  61. </span>
  62. {% endif %}
  63. {% endfor %}
  64. </div>
  65. <div id="module-custom-container">
  66. <!-- Customizable module -->
  67. <span class="module" id="module-custom"
  68. draggable="true" ondragstart="drag(event)">
  69. <input contenteditable="true" draggable="false" placeholder="Custom module..."/>
  70. <img src="{% link assets/tabler_icons/bulb.svg %}" class="module-logo"
  71. draggable="false" />
  72. <a onclick="this.parentNode.remove()" class="delete-module"
  73. style="display:none">
  74. <img src="{% link assets/tabler_icons/x.svg %}" /></a>
  75. </span>
  76. </div>
  77. </div><!-- END module-menu -->
  78. </div><!-- END RuleBuilder -->
  79. <div id="rulewriter-box">
  80. <span class="prompt"></span>
  81. <p id="rulewriter" contenteditable="true" class="editable output"></p>
  82. </div>
  83. <div id="authorship" class="linkbox">
  84. <span id="authorship-words">Created by</span>
  85. <input contenteditable="true" class="editable link-text" id="author-text" placeholder="Created by" />
  86. <span class="link-divider"><img src="{% link assets/tabler_icons/pencil.svg %}" title="Add link" /></span>
  87. <input contenteditable="true" class="editable link-url" id="author-url" placeholder="Creator URL (http://, https://)" type="url" pattern="http://.*|https://.*" />
  88. <span id="authorship-result"></span>
  89. </div>
  90. </div><!--#rulebox-->
  91. <div id="lineage">
  92. <img src="{% link assets/tabler_icons/file.svg %}" title="Derivation lineage" />
  93. <span id="lineage-list"></span>
  94. </div>
  95. <button class="pushButton" id="publishRule" onclick="publishRule()"
  96. title="Add to the public Library">Publish</button>
  97. <button class="pushButton" id="fork" onclick="fork()"
  98. title="Edit this Rule into a new one">Fork</button>
  99. <button class="pushButton" onclick="textOutput()"
  100. title="Download this Rule as a Markdown text file">Export</button>
  101. <button class="pushButton" id="trash" onclick="deleteRule()">
  102. <img src="{% link assets/tabler_icons/trash.svg %}" title="Rule deletion request" />
  103. </button>
  104. <button class="pushButton"
  105. onclick="javascript:location.href='https://www.colorado.edu/lab/medlab/content/communityrule-user-feedback'">
  106. Feedback
  107. </button>
  108. <div id="attribution" style="display:none;">
  109. <br />
  110. <p><a href="https://communityrule.info">
  111. <img src="https://communityrule.info{% link assets/CommunityRule-derived-000000.svg %}" alt="CommunityRule derived"></a></p>
  112. <p id="dateTime"></p>
  113. <p>Created with <a href="https://communityrule.info">CommunityRule</a>,
  114. <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons BY-SA</a></p>
  115. <p><strong>The Publish feature is experimental. Rules may be removed without notice</strong></p>
  116. </div>
  117. <div id="attributionMD" style="display:none;">---
  118. [![CommunityRule derived](https://communityrule.info{% link assets/CommunityRule-derived-000000.svg %})](https://communityrule.info)
  119. [Creative Commons BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)
  120. </div>
  121. </article>