|
@@ -137,13 +137,35 @@ These are the major functional buttons*/
|
|
|
classDisplayAll("button","none");
|
|
|
classDisplayAll("question","none");
|
|
|
var editableFields = document.getElementsByClassName("editable");
|
|
|
+ // de-editable-ize the editable fields
|
|
|
for (var i = 0; i < editableFields.length; i++) {
|
|
|
editableFields[i].contentEditable = "false";
|
|
|
editableFields[i].style.borderStyle = "none";
|
|
|
+ // Remove empty fields entirely
|
|
|
if (editableFields[i].innerHTML === "") {
|
|
|
editableFields[i].style.display = "none";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // Remove headers of empty sections
|
|
|
+ // Inefficient! Might be merged with the above iteration
|
|
|
+ var sections = document.getElementsByClassName("section");
|
|
|
+ for (var i = 0; i < sections.length; i++) {
|
|
|
+ console.log(sections[i]);
|
|
|
+ var sectionQuestions = sections[i].getElementsByClassName("editable");
|
|
|
+ var blanks = 0;
|
|
|
+ for (var x = 0; x < sectionQuestions.length; x++) {
|
|
|
+ console.log(sectionQuestions[x].innerHTML);
|
|
|
+ if (sectionQuestions[x].innerHTML == "") { blanks++; }
|
|
|
+ if (blanks == sectionQuestions.length) {
|
|
|
+ console.log(sections[i].style.display)
|
|
|
+ console.log("triggered!");
|
|
|
+ var headerID = "header-s" + (i + 1);
|
|
|
+ console.log("removing: " + headerID);
|
|
|
+ document.getElementById(headerID).style.display = "none";
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ // Finally, change button name
|
|
|
document.getElementById("editToggle").innerHTML = "Customize";
|
|
|
} else {
|
|
|
editMode = true;
|
|
@@ -156,6 +178,7 @@ These are the major functional buttons*/
|
|
|
editableFields[i].style.borderStyle = "none none dashed none";
|
|
|
editableFields[i].contentEditable = "true";
|
|
|
}
|
|
|
+ // Change button name
|
|
|
document.getElementById("editToggle").innerHTML = "Preview";
|
|
|
}
|
|
|
}
|
|
@@ -194,7 +217,7 @@ These are the major functional buttons*/
|
|
|
var content = '# CommunityRule: ' + document.getElementById('communityname').innerHTML + '\n\n';
|
|
|
var elements = document.getElementsByClassName('output');
|
|
|
for (var i = 1; i < elements.length; i++) {
|
|
|
- if (elements[i].innerHTML != '') {
|
|
|
+ if (elements[i].innerHTML != "") {
|
|
|
if (elements[i].classList.contains("subhead")) {
|
|
|
content += '## ';
|
|
|
}
|
|
@@ -326,7 +349,8 @@ These are the major functional buttons*/
|
|
|
|
|
|
<h1 contenteditable="true" class="editable output" id="communityname">{{ page.community-name }}</h1>
|
|
|
|
|
|
- <h2 id="basics">
|
|
|
+ <!-- SECTION S1: BASICS -->
|
|
|
+ <h2 id="header-s1">
|
|
|
<img src="{% link assets/tabler_icons/info-circle.svg %}"
|
|
|
class="icons" />
|
|
|
<span class="subhead output">Basics</span>
|
|
@@ -358,7 +382,7 @@ These are the major functional buttons*/
|
|
|
</div><!--hiding section s1-->
|
|
|
|
|
|
<!-- SECTION s2: PARTICIPANTS -->
|
|
|
- <h2 id="participants">
|
|
|
+ <h2 id="header-s2">
|
|
|
<img src="{% link assets/tabler_icons/user.svg %}"
|
|
|
class="icons" />
|
|
|
<span class="subhead output">Participants</span>
|
|
@@ -394,11 +418,11 @@ These are the major functional buttons*/
|
|
|
|
|
|
</div><!--hiding section s2-->
|
|
|
|
|
|
- <!--SECTION: POLICIES-->
|
|
|
- <h2 id="policies">
|
|
|
+ <!--SECTION s3: POLICY-->
|
|
|
+ <h2 id="header-s3">
|
|
|
<img src="{% link assets/tabler_icons/news.svg %}"
|
|
|
class="icons" />
|
|
|
- <span class="subhead output">Policies</span>
|
|
|
+ <span class="subhead output">Policy</span>
|
|
|
<button onclick="toggleVisible('s3')" class="button plus"> + </button>
|
|
|
</h2>
|
|
|
<div class="section" id="s3" style="display:none">
|
|
@@ -412,12 +436,6 @@ These are the major functional buttons*/
|
|
|
</div>
|
|
|
<p contenteditable="true" class="editable output" id="decision">{{ page.decision }}</p>
|
|
|
|
|
|
- <span class="question">Where do community members deliberate about potential policies?</span>
|
|
|
- <div class="button">Modules
|
|
|
- <span class="tooltiptext"><a target="_blank" href="https://democraticmediums.info/mediums/caucus/">caucus</a>, <a target="_blank" href="https://democraticmediums.info/mediums/coalition/">coalition</a>, <a target="_blank" href="https://democraticmediums.info/mediums/board/">board</a>, <a target="_blank" href="https://democraticmediums.info/mediums/debate/">debate</a>, <a target="_blank" href="https://democraticmediums.info/mediums/lobbying/">lobbying</a>, <a target="_blank" href="https://democraticmediums.info/mediums/recess/">recess</a>, <a target="_blank" href="https://democraticmediums.info/mediums/secrecy/">secrecy</a>, <a target="_blank" href="https://democraticmediums.info/mediums/transparency/">transparency</a></span>
|
|
|
- </div>
|
|
|
- <p contenteditable="true" class="editable output" id="deliberation">{{ page.deliberation }}</p>
|
|
|
-
|
|
|
<span class="question">How are policies implemented?</span>
|
|
|
<div class="button">Modules
|
|
|
<span class="tooltiptext"><a target="_blank" href="https://democraticmediums.info/mediums/exclusion/">exclusion</a>, <a target="_blank" href="https://democraticmediums.info/mediums/lazy_consensus/">lazy consensus</a>, <a target="_blank" href="https://democraticmediums.info/mediums/restorative_justice/">restorative justice</a></span>
|
|
@@ -432,8 +450,8 @@ These are the major functional buttons*/
|
|
|
|
|
|
</div><!--hiding section s3-->
|
|
|
|
|
|
- <!-- SECTION: PROCESS -->
|
|
|
- <h2 id="process">
|
|
|
+ <!-- SECTION s4: PROCESS -->
|
|
|
+ <h2 id="header-s4">
|
|
|
<img src="{% link assets/tabler_icons/refresh.svg %}"
|
|
|
class="icons" />
|
|
|
<span class="subhead output">Process</span>
|
|
@@ -461,8 +479,8 @@ These are the major functional buttons*/
|
|
|
|
|
|
</div><!--hiding section s4-->
|
|
|
|
|
|
- <!-- SECTION: EVOLUTION -->
|
|
|
- <h2 id="evolution">
|
|
|
+ <!-- SECTION s5: EVOLUTION -->
|
|
|
+ <h2 id="header-s5">
|
|
|
<img src="{% link assets/tabler_icons/adjustments.svg %}"
|
|
|
class="icons" />
|
|
|
<span class="subhead output">Evolution</span>
|