rule.html 30 KB

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