rule.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  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. <script>
  7. // Enter JavaScript-land!
  8. // First, some functions, followed by initialization commands
  9. // Begin BUILDER functions
  10. // source: https://www.codecanal.com/html5-drag-and-copy/
  11. function allowDrop(ev) {
  12. ev.preventDefault();
  13. }
  14. function drag(ev) {
  15. ev.dataTransfer.setData("text", ev.target.id);
  16. }
  17. function drop(ev) {
  18. ev.preventDefault();
  19. var target = ev.target;
  20. if (target.id != "module-input") { // First, confirm location is valid
  21. // Prevents dropping into dummy text field
  22. if (target.id == "drag-directions") {
  23. target = target.parentElement;
  24. } else if (!document.getElementById("module-input").contains(target) ||
  25. document.getElementById("module-menu").contains(target)) {
  26. // Ignore destinations not in the correct area
  27. return;
  28. }
  29. }
  30. // Set up transfer
  31. var data = ev.dataTransfer.getData("text");
  32. // Iff module is from the menu clone it
  33. var module = document.getElementById(data);
  34. if (module.parentElement.id == "module-menu") {
  35. module = module.cloneNode(true);
  36. var name = null;
  37. if (module.id == "module-custom") {
  38. // For custom modules: replace the <input> with text
  39. name = module.getElementsByTagName("input")[0].value;
  40. module.getElementsByTagName("input")[0].remove();
  41. var customText = document.createElement("span");
  42. customText.onClick = "moduleEditField(this.parentNode.id)";
  43. customText.id = "module-name";
  44. customText.append(name);
  45. module.prepend(customText);
  46. }
  47. // append id with unique timestamp
  48. var nowModule = new Date();
  49. module.id += "-" + nowModule.getTime();
  50. }
  51. // display the deletion button
  52. module.children[2].style.display = "inline";
  53. // pop it in!
  54. target.appendChild(module);
  55. // set up the editing field
  56. moduleEditField(module.id);
  57. // be sure the dummy text is gone
  58. if (document.contains(document.getElementById("drag-directions"))) {
  59. document.getElementById("drag-directions").remove();
  60. }
  61. }
  62. // Edits the title field of a given module based on #custom-field
  63. function moduleTitleEdit(moduleID) {
  64. var module = document.getElementById(moduleID).children[0];
  65. var content = document.getElementById("custom-field").innerHTML.replace(/(<([^>]+)>)/ig,'');
  66. module.title = content;
  67. }
  68. // Sets up a field for displaying and editing module details
  69. function moduleEditField(moduleID) {
  70. var module = document.getElementById(moduleID);
  71. var moduleName = module.children[0].innerHTML;
  72. var moduleTitle = module.children[0].title;
  73. if (editMode) {
  74. var query = "Explain how the <strong>" + moduleName
  75. + "</strong> module works.";
  76. var destination = document.getElementById("builder-field");
  77. if (moduleName == null) { moduleName = ""; }
  78. var output = '\n<div id="custom-field-container">';
  79. output += '<span class="question">' + query + '</span>';
  80. output += '<div class="field-controls"><a onclick="this.parentNode.parentNode.remove()"><img src="{% link assets/tabler_icons/x.svg %}" class="delete-module" /></a></div>';
  81. output += '<p contenteditable="true" class="editable" id="custom-field" oninput="moduleTitleEdit(\'' + moduleID + '\')">' + moduleTitle + '</p>';
  82. output += '</div>\n';
  83. destination.innerHTML = output;
  84. } else {
  85. var output = '\n<div id="custom-field-container">';
  86. output += '<div class="field-controls"><a onclick="this.parentNode.parentNode.remove()"><img src="{% link assets/tabler_icons/x.svg %}" class="delete-module" /></a></div>';
  87. output += '<p class="editable" id="custom-field">'
  88. + moduleTitle + '</p>';
  89. }
  90. }
  91. // Tests if the RuleBuilder is empty
  92. function builderEmpty() {
  93. var builder = document.getElementById("module-input");
  94. var childs = builder.children;
  95. if (builder.getElementsByClassName("module").length > 0) {
  96. return false;
  97. } else {
  98. return true;
  99. }
  100. }
  101. // Turns RuleBuilder contents into a nested array
  102. // TKTK to do
  103. function builderArray() {
  104. var modulesDOM = "";
  105. var modulesArray = [];
  106. }
  107. // end RuleBuilder functions
  108. // toggleVisible(id)
  109. // Toggles the visibility of a given element by given ID
  110. function toggleVisible(id) {
  111. var x = document.getElementById(id);
  112. if (x.style.display === "none") {
  113. x.style.display = "block";
  114. } else {
  115. x.style.display = "none";
  116. }
  117. }
  118. // classDisplayAll(className, value)
  119. // Assigns given display value to all elements with a given className
  120. function classDisplayAll(className, value) {
  121. var elements = document.getElementsByClassName(className);
  122. for (var i = 0; i < elements.length; i++) {
  123. elements[i].style.display = value;
  124. }
  125. }
  126. // toggleEditMode()
  127. // Toggles whether editable fields are editable or not
  128. // and removes editing tools.
  129. function toggleEditMode() {
  130. if (editMode === true) { // switch to preview mode
  131. editMode = false;
  132. classDisplayAll("section","block");
  133. classDisplayAll("button","none");
  134. classDisplayAll("question","none");
  135. classDisplayAll("metaheader","none");
  136. classDisplayAll("delete-module","none");
  137. var editableFields = document.getElementsByClassName("editable");
  138. // de-editable-ize the editable fields
  139. for (var i = 0; i < editableFields.length; i++) {
  140. editableFields[i].contentEditable = "false";
  141. editableFields[i].style.borderStyle = "none";
  142. // Remove empty fields entirely
  143. var content = editableFields[i].innerHTML;
  144. content = content.replace(/(<([^>]+)>)/ig,''); // strips stray tags
  145. if (content === "") {
  146. editableFields[i].style.display = "none";
  147. }
  148. }
  149. // Remove headers of empty sections (Inefficient! Might be merged with the above iteration)
  150. // First, RuleBuilder
  151. if (builderEmpty()) {
  152. document.getElementById("rule-builder").style.display = "none";
  153. }
  154. if (document.contains(document.getElementById("custom-field-container"))) {
  155. document.getElementById("custom-field-container").remove();
  156. }
  157. // Now, RuleWriter sections
  158. var sections = document.getElementsByClassName("section");
  159. for (var i = 0; i < sections.length; i++) {
  160. var sectionQuestions = sections[i].getElementsByClassName("editable");
  161. var blanks = 0;
  162. for (var x = 0; x < sectionQuestions.length; x++) {
  163. var content = sectionQuestions[x].innerHTML;
  164. content = content.replace(/(<([^>]+)>)/ig,''); // strips stray tags
  165. if (content == "") { blanks++; }
  166. if (blanks == sectionQuestions.length) {
  167. var headerID = "header-s" + (i + 1);
  168. document.getElementById(headerID).style.display = "none";
  169. }
  170. }
  171. }
  172. // Handle links
  173. // TKTK
  174. // Handle author link
  175. var authorName = document.getElementById("author-text").value;
  176. var authorURL = document.getElementById("author-url").value;
  177. if (authorName != "") {
  178. document.getElementById("authorship-words").style.display = "inline";
  179. if (authorURL != "") { // both author and URL present
  180. document.getElementById("authorship-result").innerHTML = "<a href='" + authorURL +"'>" + authorName + "</a>";
  181. document.getElementById("authorship-result").style.display = "inline";
  182. } else { // only authorName present
  183. document.getElementById("authorship-result").innerHTML = authorName;
  184. document.getElementById("authorship-result").style.display = "inline";
  185. }
  186. } else {
  187. document.getElementById("authorship").style.display = "none";
  188. }
  189. // Finally, change button name
  190. document.getElementById("editToggle").innerHTML = "Customize";
  191. } else { // Switch to editMode
  192. editMode = true;
  193. classDisplayAll("button","block");
  194. classDisplayAll("question","block");
  195. classDisplayAll("editable","block");
  196. classDisplayAll("header","block");
  197. classDisplayAll("section","none");
  198. classDisplayAll("metaheader","block");
  199. classDisplayAll("link-text","inline");
  200. classDisplayAll("link-url","inline");
  201. classDisplayAll("delete-module","inline");
  202. // builder handling
  203. document.getElementById("rule-builder").style.display = "block";
  204. // author handling
  205. document.getElementById("authorship-result").style.display = "none";
  206. document.getElementById("authorship-words").style.display = "none";
  207. document.getElementById("authorship").style.display = "block";
  208. // make all editable fields visible
  209. var editableFields = document.getElementsByClassName("editable");
  210. for (var i = 0; i < editableFields.length; i++) {
  211. editableFields[i].style.borderStyle = "none none dashed none";
  212. editableFields[i].contentEditable = "true";
  213. }
  214. // Change button name
  215. document.getElementById("editToggle").innerHTML = "Preview";
  216. }
  217. }
  218. // toggleDisplayMode()
  219. // toggles full displayMode, the Rule-only display for a published Rule
  220. // first, initialize variable:
  221. var displayMode = false;
  222. function toggleDisplayMode() {
  223. if (displayMode == false) {
  224. editMode = true;
  225. toggleEditMode(); // turns off editMode
  226. classDisplayAll("site-nav","none");
  227. classDisplayAll("post-header","none");
  228. classDisplayAll("site-footer","none");
  229. document.getElementById("attribution").style.display = "block";
  230. document.getElementById("toggleDisplayMode").style.display = "inline-block";
  231. document.getElementById("publishRule").style.display = "none";
  232. document.getElementById("trash").style.display = "inline-block";
  233. displayMode = true;
  234. } else {
  235. toggleEditMode() // turns on editMode
  236. classDisplayAll("site-nav","block");
  237. classDisplayAll("post-header","block");
  238. classDisplayAll("site-footer","block");
  239. document.getElementById("attribution").style.display = "none";
  240. document.getElementById("toggleDisplayMode").style.display = "none";
  241. document.getElementById("publishRule").style.display = "inline-block";
  242. document.getElementById("trash").style.display = "none";
  243. displayMode = false;
  244. }
  245. }
  246. // textOutput()
  247. // Produces Markdown rendition of Rule from Export button
  248. function textOutput() {
  249. var filename = 'GOVERNANCE.md';
  250. // First, add title, whether there is one or not
  251. var content = '# '+ document.getElementById('communityname').innerHTML + '\n\n';
  252. content = content.replace(/(<([^>]+)>)/ig,''); // strips stray tags
  253. // Now, begin adding other elements
  254. var elements = document.getElementsByClassName('output');
  255. for (var i = 1; i < elements.length; i++) {
  256. var thisBit = elements[i].innerHTML;
  257. thisBit = thisBit.replace(/(<([^>]+)>)/ig,''); // strips stray tags
  258. if (thisBit != "") {
  259. if (elements[i].classList.contains("subhead")) {
  260. // Before printing subhead, make sure it's not empty
  261. var i2 = i + 1;
  262. while ((i2 < elements.length) &&
  263. (!(elements[i2].classList.contains("subhead")))) {
  264. if (elements[i2].innerHTML != "") {
  265. // in this case, it's not empty, so print and move on
  266. content += '## ';
  267. content += thisBit + '\n\n';
  268. break;
  269. } else { i2++; }
  270. } // won't print anything if a subhead has only empty children
  271. } else {
  272. // Non-subhead elements can just go ahead and print
  273. content += thisBit + '\n\n';
  274. }
  275. }
  276. }
  277. // Add authorship block
  278. var authorName = document.getElementById("author-text").value;
  279. var authorURL = document.getElementById("author-url").value;
  280. var authorshipBlock = "---\n\nCreated by ";
  281. if (authorName != "") {
  282. if (authorURL != "") { // both author and URL present
  283. authorshipBlock += ("[" + authorName + "](" + authorURL + ")");
  284. } else { // only authorName present
  285. authorshipBlock += authorName;
  286. }
  287. content += (authorshipBlock + "\n");
  288. }
  289. // Add attribution block
  290. content += document.getElementById('attributionMD').innerHTML;
  291. // Starting here, see https://stackoverflow.com/a/33542499
  292. var blob = new Blob([content], {type: 'text/plain'});
  293. if(window.navigator.msSaveOrOpenBlob) {
  294. window.navigator.msSaveBlob(blob, filename);
  295. }
  296. else{
  297. var elem = window.document.createElement('a');
  298. elem.href = window.URL.createObjectURL(blob);
  299. elem.download = filename;
  300. document.body.appendChild(elem);
  301. elem.click();
  302. document.body.removeChild(elem);
  303. URL.revokeObjectURL(); // This needs an arg but I can't figure out what
  304. }
  305. var myFile = new Blob([fileContent], {type: 'text/plain'});
  306. window.URL = window.URL || window.webkitURL; document.getElementById('download').setAttribute('href',window.URL.createObjectURL(myFile));
  307. document.getElementById('download').setAttribute('download', fileName);
  308. }
  309. // BEGIN Publish tools, via SteinHQ.com
  310. // publishRule()
  311. // Publishes existing fields to new page, /builder/?rule=[ruleID]
  312. // Opens new page in Display mode
  313. function publishRule() {
  314. // Confirm user knows what they're getting into
  315. var r = confirm("Publish to the public Library?");
  316. if (r == false) { return; }
  317. // Proceed with publication
  318. var now = new Date();
  319. // Numerical ID for published Rule
  320. var timeID = now.getTime();
  321. // Readable UTC timestamp
  322. var dateTime = now.getUTCFullYear()+'.'+(now.getUTCMonth()+1)+'.'+now.getUTCDate()
  323. +' '+now.getUTCHours()+":"+ now.getUTCMinutes()+":"+now.getUTCSeconds()
  324. + ' UTC';
  325. // TKTK: Check if ruleID exists; while yes, replace and repeat
  326. var rule = [{
  327. ruleID: timeID,
  328. timestamp: dateTime,
  329. }];
  330. var fields = document.getElementsByClassName("editable");
  331. for (var i = 0; i < fields.length; i++) {
  332. var key = fields[i].id;
  333. var value = "";
  334. if (fields[i].nodeName == "INPUT") { // for <input>
  335. value = fields[i].value.replace(/(<([^>]+)>)/ig,"");
  336. } else { // for other fields
  337. value = fields[i].innerHTML.replace(/(<([^>]+)>)/ig,"");
  338. }
  339. rule[0][key] = value;
  340. }
  341. const store = new SteinStore(
  342. "https://api.steinhq.com/v1/storages/5e8b937ab88d3d04ae0816a5"
  343. );
  344. store.append("rules", rule).then(data => {
  345. window.open("/create/?r=" + timeID, "_self", false);
  346. });
  347. }
  348. // displayRule(ID)
  349. // Displays content based on ID
  350. function displayRule(ID) {
  351. const store = new SteinStore(
  352. "https://api.steinhq.com/v1/storages/5e8b937ab88d3d04ae0816a5"
  353. );
  354. store.read("rules", { search: { ruleID: ID } }).then(data => {
  355. // only runs when we have the data from Goog:
  356. var rule = data[0];
  357. var fields = document.getElementsByClassName("editable");
  358. for (var i = 0; i < fields.length; i++) {
  359. var key = fields[i].id;
  360. var value = rule[key];
  361. if (typeof value === "undefined") {
  362. value = "";
  363. } else if (key.includes("-")) { // links
  364. document.getElementById(key).value = value;
  365. } else {
  366. document.getElementById(key).innerHTML = value;
  367. }
  368. }
  369. // Publish timestamp to Rule
  370. document.getElementById('dateTime').innerHTML = rule['timestamp'];
  371. // Finish
  372. displayMode = false;
  373. toggleDisplayMode();
  374. document.title = rule['communityname'] + " / CommunityRule";
  375. });
  376. }
  377. // deleteRule()
  378. // A temporary placeholder that sends an email requesting rule deletion
  379. function deleteRule() {
  380. var urlParamz = new URLSearchParams(window.location.search);
  381. var rID = urlParamz.get('r');
  382. window.open("mailto:medlab@colorado.edu?subject=Delete Rule request ("
  383. + rID + ")&body=Please explain your rationale:\n");
  384. }
  385. // END Publish tools
  386. // FINALLY, Page loading
  387. // First, grab the current URL
  388. var urlParams = new URLSearchParams(window.location.search);
  389. // Determine if it is a published Rule
  390. if (urlParams.has('r')) {
  391. // If so, grab the Rule from database and enter displayMode
  392. var rID = urlParams.get('r');
  393. displayRule(rID);
  394. } else {
  395. // Otherwise, open in editMode as default
  396. var editMode = true;
  397. // switch out of editMode in special cases
  398. window.onload = function() {
  399. if ((window.location.href.indexOf("/templates/") != -1) ||
  400. (window.location.href.indexOf("/about/") != -1)) {
  401. toggleEditMode();
  402. }
  403. }
  404. }
  405. </script>
  406. <article class="post">
  407. <header class="post-header">
  408. <h1 class="post-title" id="title">
  409. {{ page.title }}
  410. </h1>
  411. <button class="pushButton" id="editToggle" onclick="toggleEditMode()">
  412. Preview</button>
  413. <div class="post-content">
  414. {{ content }}
  415. </div>
  416. </header>
  417. <div id="rulebox">
  418. <span class="question">What is the community’s name?</span>
  419. <h1 contenteditable="true" class="editable output" id="communityname">{{ page.community-name }}</h1>
  420. <!-- BUILDER -->
  421. <h2 id="header-rb" class="metaheader">
  422. <span class="subhead output">RuleBuilder</span>
  423. <button onclick="toggleVisible('rule-builder')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Show/hide" /></button>
  424. </h2>
  425. <div id="rule-builder">
  426. <button id="module-toggle" onclick="toggleVisible('module-menu')"
  427. class="button" title="Show/hide">
  428. <img src="{% link assets/tabler_icons/tool.svg %}" title="Modules" />
  429. </button>
  430. <div id="module-input"
  431. ondrop="drop(event)" ondragover="allowDrop(event)">
  432. <span class="question" id="drag-directions">
  433. </span>
  434. </div>
  435. <div id="builder-field">
  436. </div>
  437. <div id="module-menu">
  438. <!-- Customizable module -->
  439. <span class="module" id="module-custom"
  440. draggable="true" ondragstart="drag(event)">
  441. <input contenteditable="true" placeholder="Custom..."/>
  442. <img src="{% link assets/tabler_icons/bulb.svg %}"
  443. draggable="false" />
  444. <a onclick="this.parentNode.remove()" class="delete-module"
  445. style="display:none">
  446. <img src="{% link assets/tabler_icons/x.svg %}" /></a>
  447. </span>
  448. <!-- Load preset modules from _data/modules.csv -->
  449. {% for module in site.data.modules %}
  450. <span class="module" id="module-{{ module.id }}"
  451. draggable="true" ondragstart="drag(event)">
  452. <span id="module-name"
  453. onclick="moduleEditField(this.parentNode.id)">
  454. {{ module.name }}</span>
  455. <a target="_blank" href="{{ module.url }}" class="module-link">
  456. <img title="{{ module.type }}" draggable="false"
  457. {% if module.type == "structure" %}
  458. src="{% link assets/tabler_icons/building.svg %}" {% endif %}
  459. {% if module.type == "process" %}
  460. src="{% link assets/tabler_icons/rotate.svg %}" {% endif %}
  461. {% if module.type == "decision" %}
  462. src="{% link assets/tabler_icons/thumb-up.svg %}" {% endif %}
  463. {% if module.type == "culture" %}
  464. src="{% link assets/tabler_icons/palette.svg %}" {% endif %}
  465. /></a>
  466. <a onclick="this.parentNode.remove()" class="delete-module"
  467. style="display:none">
  468. <img src="{% link assets/tabler_icons/x.svg %}" /></a>
  469. </span>
  470. {% endfor %}
  471. </div>
  472. </div>
  473. <h2 id="header-rw" class="metaheader">
  474. <span class="subhead output">RuleWriter</span>
  475. <button onclick="toggleVisible('rule-writer')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Show/hide" /></button>
  476. </h2>
  477. <div id="rule-writer">
  478. <!-- SECTION S1: BASICS -->
  479. <h2 id="header-s1" class="header">
  480. <img src="{% link assets/tabler_icons/info-circle.svg %}"
  481. class="icons" />
  482. <span class="subhead output">Basics</span>
  483. <button onclick="toggleVisible('s1')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Show/hide" /></button>
  484. </h2>
  485. <div class="section" id="s1" style="display:none">
  486. <span class="question">What is the basic structure of the community?</span>
  487. <p contenteditable="true" class="editable output" id="structure">{{ page.structure }}</p>
  488. <span class="question">What is the community’s mission?</span>
  489. <p contenteditable="true" class="editable output" id="mission">{{ page.mission }}</p>
  490. <span class="question">What core values does the community hold?</span>
  491. <p contenteditable="true" class="editable output" id="values">{{ page.values }}</p>
  492. <span class="question">What is the legal status of the community’s assets and creations?</span>
  493. <p contenteditable="true" class="editable output" id="legal">{{ page.legal }}</p>
  494. </div><!--hiding section s1-->
  495. <!-- SECTION s2: PARTICIPANTS -->
  496. <h2 id="header-s2" class="header">
  497. <img src="{% link assets/tabler_icons/user.svg %}"
  498. class="icons" />
  499. <span class="subhead output">Participants</span>
  500. <button onclick="toggleVisible('s2')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Show/hide" /></button>
  501. </h2>
  502. <div class="section" id="s2" style="display:none">
  503. <span class="question">How does someone become a participant?</span>
  504. <p contenteditable="true" class="editable output" id="membership">{{ page.membership }}</p>
  505. <span class="question">How are participants suspended or removed?</span>
  506. <p contenteditable="true" class="editable output" id="removal">{{ page.removal }}</p>
  507. <span class="question">What special roles can participants hold, and how are roles assigned?</span>
  508. <p contenteditable="true" class="editable output" id="roles">{{ page.roles }}</p>
  509. <span class="question">Are there limits on the terms or powers of participant roles?</span>
  510. <p contenteditable="true" class="editable output" id="limits">{{ page.limits }}</p>
  511. </div><!--hiding section s2-->
  512. <!--SECTION s3: POLICY-->
  513. <h2 id="header-s3" class="header">
  514. <img src="{% link assets/tabler_icons/news.svg %}"
  515. class="icons" />
  516. <span class="subhead output">Policy</span>
  517. <button onclick="toggleVisible('s3')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Show/hide" /></button>
  518. </h2>
  519. <div class="section" id="s3" style="display:none">
  520. <span class="question">What basic rights does this Rule guarantee?</span>
  521. <p contenteditable="true" class="editable output" id="rights">{{ page.rights }}</p>
  522. <span class="question">Who has the capacity to decide on policies, and how do they do so?</span>
  523. <p contenteditable="true" class="editable output" id="decision">{{ page.decision }}</p>
  524. <span class="question">How are policies implemented?</span>
  525. <p contenteditable="true" class="editable output" id="implementation">{{ page.implementation }}</p>
  526. <span class="question">How does the community monitor and evaluate its policy implementation? </span>
  527. <p contenteditable="true" class="editable output" id="oversight">{{ page.oversight }}</p>
  528. </div><!--hiding section s3-->
  529. <!-- SECTION s4: PROCESS -->
  530. <h2 id="header-s4" class="header">
  531. <img src="{% link assets/tabler_icons/refresh.svg %}"
  532. class="icons" />
  533. <span class="subhead output">Process</span>
  534. <button onclick="toggleVisible('s4')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Show/hide" /></button>
  535. </h2>
  536. <div class="section" id="s4" style="display:none">
  537. <span class="question">Where does the community deliberate about policies and governance?</span>
  538. <p contenteditable="true" class="editable output" id="deliberation">{{ page.deliberation }}</p>
  539. <span class="question">How does the community manage access to administrative accounts and other tools?</span>
  540. <p contenteditable="true" class="editable output" id="access">{{ page.access }}</p>
  541. <span class="question">How does the community manage funds and economic flows?</span>
  542. <p contenteditable="true" class="editable output" id="economics">{{ page.economics }}</p>
  543. <span class="question">How are grievances among participants addressed?</span>
  544. <p contenteditable="true" class="editable output" id="grievances">{{ page.grievances }}</p>
  545. </div><!--hiding section s4-->
  546. <!-- SECTION s5: EVOLUTION -->
  547. <h2 id="header-s5" class="header">
  548. <img src="{% link assets/tabler_icons/adjustments.svg %}"
  549. class="icons" />
  550. <span class="subhead output">Evolution</span>
  551. <button onclick="toggleVisible('s5')" class="button chevrons"><img src="{% link assets/tabler_icons/chevrons-down.svg %}" title="Show/hide" /></button>
  552. </h2>
  553. <div class="section" id="s5" style="display:none">
  554. <span class="question">Where are policies and records kept?</span>
  555. <p contenteditable="true" class="editable output" id="records">{{ page.records }}</p>
  556. <span class="question">How can this Rule be modified?</span>
  557. <p contenteditable="true" class="editable output" id="modification">{{ page.modification }}</p>
  558. </div><!--hiding section s5-->
  559. </div><!--end: rule-writer-->
  560. <div id="authorship" class="linkbox">
  561. <span id="authorship-words">Created by</span>
  562. <input contenteditable="true" class="editable link-text" id="author-text" placeholder="Created by" />
  563. <span class="link-divider"><img src="{% link assets/tabler_icons/pencil.svg %}" title="Add link" /></span>
  564. <input contenteditable="true" class="editable link-url" id="author-url" placeholder="Creator URL (http://, https://)" type="url" pattern="http://.*|https://.*" />
  565. <span id="authorship-result"></span>
  566. </div>
  567. </div><!--#rulebox-->
  568. <div id="attribution" style="display:none;">
  569. <br />
  570. <p><a href="https://communityrule.info">
  571. <img src="https://communityrule.info{% link assets/CommunityRule-derived-000000.svg %}" alt="CommunityRule derived"></a></p>
  572. <p id="dateTime"></p>
  573. <p>Created with <a href="https://communityrule.info">CommunityRule</a><br />
  574. <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons BY-SA</a></p>
  575. <p><strong>The Publish feature is experimental. Rules may be removed without notice</strong></p>
  576. </div>
  577. <div id="attributionMD" style="display:none;">
  578. ---
  579. [![CommunityRule derived](https://communityrule.info{% link assets/CommunityRule-derived-000000.svg %})](https://communityrule.info)
  580. [Creative Commons BY-SA](https://creativecommons.org/licenses/by-sa/4.0/)</div>
  581. <button class="pushButton" id="publishRule" onclick="publishRule()"
  582. title="Add to the public Library">Publish</button>
  583. <button class="pushButton" id="toggleDisplayMode" onclick="toggleDisplayMode()"
  584. title="Edit this Rule into a new one">Fork</button>
  585. <button class="pushButton" onclick="textOutput()"
  586. title="Download this Rule as a Markdown text file">Export</button>
  587. <button class="pushButton" id="trash" onclick="deleteRule()">
  588. <img src="{% link assets/tabler_icons/trash.svg %}" title="Rule deletion request" />
  589. </button>
  590. <button class="pushButton"
  591. onclick="javascript:location.href='https://www.colorado.edu/lab/medlab/content/communityrule-user-feedback'">
  592. Feedback
  593. </button>
  594. <div class="question">Publish and Export are not yet available for the RuleBuilder</div>
  595. </article>