Переглянути джерело

Separated out RuleWriter and RuleBuilder

Nathan Schneider 4 роки тому
батько
коміт
873854af56
3 змінених файлів з 1 додано та 131 видалено
  1. 1 1
      _guides/first_rule.md
  2. 0 92
      _layouts/rule.html
  3. 0 38
      create.md

+ 1 - 1
_guides/first_rule.md

@@ -10,7 +10,7 @@ Whether your community is already up and running or still just an ambition, choo
 
 **Get that? Be brief.** The longer your Rule is, the more likely you'll be to confuse people and introduce internal inconsistencies.
 
-**It may be easiest to start with a [template]({% link templates.md %}), but you can also [start from scratch]({% link create.md %}).** On a template, press the <span class="pushButton">Customize</span> button to get started. Even if you end up changing almost everything you find in a template, the process can spur thinking in ways that a blank canvas would not.
+**It may be easiest to start with a [template]({% link templates.md %}), but you can also [start from scratch]({% link rule-writer.md %}).** On a template, press the <span class="pushButton">Customize</span> button to get started. Even if you end up changing almost everything you find in a template, the process can spur thinking in ways that a blank canvas would not.
 
 **Press the <span class="pushButton"><img src="{% link assets/tabler_icons/plus.svg %}" title="Expand" /></span> buttons to expand each section and start exploring.** You don't need to fill every field or even every section. If you don't leave an answer, the field will simply disappear when you publish.
 

+ 0 - 92
_layouts/rule.html

@@ -8,57 +8,6 @@ layout: default
   // Enter JavaScript-land!
   // First, some functions, followed by initialization commands
 
-  // Begin BUILDER functions
-  // source: https://www.codecanal.com/html5-drag-and-copy/
-  function allowDrop(ev) {
-      ev.preventDefault();
-  }
-  function drag(ev) {
-      ev.dataTransfer.setData("text", ev.target.id);
-  }
-  function drop(ev) {
-      ev.preventDefault();
-      var target = ev.target;
-      // Prevents dropping into text field
-      if (target.id == "drag-directions") {
-          target = target.parentElement;
-      }
-      // Set up transfer
-      var data = ev.dataTransfer.getData("text");
-      // Iff module is from the menu clone it
-      var module = document.getElementById(data);
-      if (module.parentElement.id == "module-menu") {
-          module = module.cloneNode(true);
-          // Add a corresponding text field
-          var name = module.innerHTML.replace(/(<([^>]+)>)/ig,'');
-          var query = "Explain how the " + name + " module works.";
-          addField(query);
-      }
-      // append name
-      module.id += "-dropped";
-      // display the deletion button
-      module.children[2].style.display = "inline";
-      // pop it in!
-      target.appendChild(module);
-      // be sure the dummy text is gone
-      document.getElementById("drag-directions").style.display = "none";
-      // Send field contents to console to aid in database stuff
-      console.log(document.getElementById("module-input"));   
-  }
-
-  // Adds a new question field
-  function addField(content) {
-      // if input is null, add an empty field to the list
-      // include a field removal button
-      var destination = document.getElementById("builder-field");
-      if (content == null) { content = ""; }     
-      var output = '\n<div><a onclick="this.parentNode.remove()" id="delete-module"><img src="{% link assets/tabler_icons/x.svg %}" align="right"/></a>';
-      output += '<span class="question">' + content + '</span>';
-      output += '<p contenteditable="true" class="editable output" id="custom-field"></p></div>\n';
-      destination.innerHTML += output;
-  }
-  // end BUILDER functions
-  
   // toggleVisible(id)
   // Toggles the visibility of a given element by given ID
   function toggleVisible(id) {
@@ -378,47 +327,6 @@ layout: default
 
     <span class="question">What is the community’s name?</span>
     <h1 contenteditable="true" class="editable output" id="communityname">{{ page.community-name }}</h1>
-
-    <p class="question"><strong>RuleBuilder</strong></p>
-    
-    <!-- BUILDER -->
-    <div ondrop="drop(event)" ondragover="allowDrop(event)"
-         class="modulebox" id="module-input">
-      <span class="question" id="drag-directions">
-        Drag modules from the icon at right</span>      
-      <div class="button">
-        <img src="{% link assets/tabler_icons/tool.svg %}" title="Modules" />
-        <div class="tooltiptext" id="module-menu">
-          <!-- Customizable module -->
-          <span class="module" id="module-custom"
-                draggable="true" ondragstart="drag(event)">
-			<input contenteditable="true" placeholder="Custom..." />
-            <img src="{% link assets/tabler_icons/bulb.svg %}"
-                 draggable="false" />
-		    <a onclick="this.parentNode.remove()" id="delete-module"
-			   style="display:none">
-			  <img src="{% link assets/tabler_icons/x.svg %}" /></a>
-		  </span>
-		  <!-- Load preset modules from _data/modules.csv -->
-		  {% for module in site.data.modules %}
-		  <span class="module fixed" id="module-{{ module.id }}"
-			  draggable="true" ondragstart="drag(event)">
-		    <span>{{ module.name }}</span>
-		  <a target="_blank" href="{{ module.url }}">
-			<img src="{% link assets/tabler_icons/link.svg %}"
-				 draggable="false" /></a>
-		  <a onclick="this.parentNode.remove()" id="delete-module"
-			 style="display:none">
-			<img src="{% link assets/tabler_icons/x.svg %}" /></a>
-		  </span>
-          {% endfor %}
-        </div>
-      </div>
-    </div>
-    <div id="builder-field">
-    </div>
-
-    <p class="question"><strong>RuleWriter</strong></p>
     
     <!-- SECTION S1: BASICS -->
     <h2 id="header-s1" class="header">

+ 0 - 38
create.md

@@ -1,38 +0,0 @@
----
-layout: rule
-title: Create
-permalink: /create/
-icon: 
-
-community-name: 
-
-# BASICS
-structure: 
-mission:
-values:
-legal: 
-
-# PARTICIPANTS
-membership:
-removal:
-roles:
-limits: 
-
-# POLICY
-rights: 
-decision: 
-implementation: 
-oversight: 
-
-# PROCESS
-deliberation: 
-access: 
-economics: 
-grievances: 
-
-# EVOLUTION
-records: 
-modification: 
----
-
-Use the questions below to build a rule or [start with a template]({% link templates.md %}). Answer questions in complete sentences, as the questions disappear.