|
@@ -1,4 +1,3 @@
|
|
|
-
|
|
|
<div id="app">
|
|
|
<div class="app-wrapper" :class="{'is-preview':preview}">
|
|
|
<div class="editor" v-if="!preview && !legacy" v-cloak>
|
|
@@ -16,7 +15,8 @@
|
|
|
<div class="dropdown">
|
|
|
<label v-for="(icon, iconName, idx) in ruleIcons" :key="idx"
|
|
|
:class="{ selected: rule.icon == icon }">
|
|
|
- <input type="radio" id="" :selected="rule.icon == icon" :value="icon" v-model="rule.icon">
|
|
|
+ <input type="radio" id="" :selected="rule.icon == icon" :value="icon"
|
|
|
+ v-model="rule.icon">
|
|
|
<div><img :src="icon" :alt="iconName"></div>
|
|
|
</label>
|
|
|
<label class="default">
|
|
@@ -31,58 +31,52 @@
|
|
|
</label>
|
|
|
</div>
|
|
|
<div class="rule__modules" :class="{ target: holding }">
|
|
|
- <label class="label" for="" v-if="rule.name"><icon :icon="rule.icon"></icon>[[rule.name]]</label>
|
|
|
- <div
|
|
|
- class="modules__dropzone modules__grid"
|
|
|
- :data-module-id="rule.ruleID"
|
|
|
- .module="rule"
|
|
|
- @drop.prevent="dropOnRule" @dragenter.prevent @dragover.prevent
|
|
|
- >
|
|
|
- <div v-if="rule.modules.length < 1">Drag rules from the library below here, or create your own.</div>
|
|
|
- <module
|
|
|
- v-for="module in rule.modules"
|
|
|
- :key="module"
|
|
|
- @click="handleClickEditModule"
|
|
|
- :module="module"
|
|
|
- draggable="true"
|
|
|
- @dragstart="rearrangeModule"
|
|
|
- ></module>
|
|
|
+ <label class="label" for="" v-if="rule.name">
|
|
|
+ <icon :icon="rule.icon"></icon>[[rule.name]]
|
|
|
+ </label>
|
|
|
+ <div class="modules__dropzone modules__grid" :data-module-id="rule.ruleID" .module="rule"
|
|
|
+ @drop.prevent="dropOnRule" @dragenter.prevent @dragover.prevent>
|
|
|
+ <div v-if="rule.modules.length < 1">Drag rules from the library below here, or create your own.
|
|
|
+ </div>
|
|
|
+ <module v-for="module in rule.modules" :key="module" @click="handleClickEditModule" :module="module"
|
|
|
+ draggable="true" @dragstart="rearrangeModule"></module>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="label-group is-mobile">
|
|
|
<div class="module" @click="newCustomModule">
|
|
|
- <span class="plus"><img :src="icons.plus" alt="Add"></span>
|
|
|
- Create Custom Module
|
|
|
+ <span class="plus"><img :src="icons.plus" alt="Add"></span>
|
|
|
+ Create Custom Module
|
|
|
</div>
|
|
|
<div class="module-editor__empty">
|
|
|
- <small>Or click any module in categories like culture/decision/process/struture to start editing it.</small>
|
|
|
+ <small>Or click any module in categories like culture/decision/process/struture to start editing
|
|
|
+ it.</small>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<div class="module-editor__wrapper">
|
|
|
<div class="module-editor">
|
|
|
- <module
|
|
|
- class="module-editor__label"
|
|
|
- hide-submodules
|
|
|
- :module="editor.module"
|
|
|
- draggable="false"
|
|
|
- v-if="editor.module.name"
|
|
|
- ></module>
|
|
|
-
|
|
|
+ <module class="module-editor__label" hide-submodules :module="editor.module" draggable="false"
|
|
|
+ v-if="editor.module.name"></module>
|
|
|
+
|
|
|
<div class="module-editor__fields">
|
|
|
<div class="label-group">
|
|
|
<label class="label">
|
|
|
<span>Module name:</span>
|
|
|
- <input class="input-stack" type="text" v-model="editor.module.name" @change="editor.module.moduleID = slugify(editor.module.name)">
|
|
|
+ <input class="input-stack" type="text" v-model="editor.module.name"
|
|
|
+ @change="editor.module.moduleID = slugify(editor.module.name)">
|
|
|
</label>
|
|
|
<label class="label">
|
|
|
<span>Icon:</span>
|
|
|
<div class="dropdown">
|
|
|
- <label v-for="(icon, iconName, idx) in moduleIcons" :key="idx" :class="{ selected: editor.module.icon == icon }">
|
|
|
- <input type="radio" id="" :selected="editor.module.icon == icon" :value="icon" v-model="editor.module.icon">
|
|
|
+ <label v-for="(icon, iconName, idx) in moduleIcons" :key="idx"
|
|
|
+ :class="{ selected: editor.module.icon == icon }">
|
|
|
+ <input type="radio" id="" :selected="editor.module.icon == icon" :value="icon"
|
|
|
+ v-model="editor.module.icon">
|
|
|
<div><img :src="icon" :alt="iconName"></div>
|
|
|
</label>
|
|
|
- <label class="default"><div><img :src="icons.blank"></div></label>
|
|
|
+ <label class="default">
|
|
|
+ <div><img :src="icons.blank"></div>
|
|
|
+ </label>
|
|
|
</div>
|
|
|
</label>
|
|
|
</div>
|
|
@@ -92,34 +86,28 @@
|
|
|
</label>
|
|
|
|
|
|
<label class="label configs">
|
|
|
- <table>
|
|
|
- <tr v-for="(value, key) in editor.module.config">
|
|
|
- <td>[[key]]</td>
|
|
|
- <td><input type="text"
|
|
|
- v-model="editor.module.config[key]" /></td>
|
|
|
- <td style="vertical-align: initial">
|
|
|
- <span class="config-button"
|
|
|
- @click="removeConfig([[key]])">
|
|
|
- <img :src="icons.minus" alt="Remove">
|
|
|
- </span>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- <tr >
|
|
|
- <td><input id="newConfigKey"
|
|
|
- type="text"
|
|
|
- value="Configuration" /></td>
|
|
|
- <td>
|
|
|
- <input id="newConfigValue"
|
|
|
- type="text"
|
|
|
- value="Value" /></td>
|
|
|
- <td style="vertical-align: initial">
|
|
|
- <span class="config-button"
|
|
|
- @click="addConfig">
|
|
|
- <img :src="icons.plus" alt="Add">
|
|
|
- </span>
|
|
|
- </td>
|
|
|
- </tr>
|
|
|
- </table>
|
|
|
+ <table>
|
|
|
+ <tr v-for="(value, key) in editor.module.config">
|
|
|
+ <td>[[key]]</td>
|
|
|
+ <td><input type="text" v-model="editor.module.config[key]" /></td>
|
|
|
+ <td style="vertical-align: initial">
|
|
|
+ <span class="config-button" @click="removeConfig([[key]])">
|
|
|
+ <img :src="icons.minus" alt="Remove">
|
|
|
+ </span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <td><input id="newConfigKey" type="text" value="Configuration" /></td>
|
|
|
+ <td>
|
|
|
+ <input id="newConfigValue" type="text" value="Value" />
|
|
|
+ </td>
|
|
|
+ <td style="vertical-align: initial">
|
|
|
+ <span class="config-button" @click="addConfig">
|
|
|
+ <img :src="icons.plus" alt="Add">
|
|
|
+ </span>
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ </table>
|
|
|
</label>
|
|
|
<!-- Working on custom module library
|
|
|
|
|
@@ -150,29 +138,27 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <vue-button class="success" :icon="icons.plus" @click="clickAddModule" v-if="!moduleContains(editor.module) && editor.module">Add</vue-button>
|
|
|
- <vue-button class="danger" :icon="icons.minus" @click="clickRemoveModule" v-if="moduleContains(editor.module)">Remove</vue-button>
|
|
|
+ <vue-button class="success" :icon="icons.plus" @click="clickAddModule"
|
|
|
+ v-if="!moduleContains(editor.module) && editor.module">Add</vue-button>
|
|
|
+ <vue-button class="danger" :icon="icons.minus" @click="clickRemoveModule"
|
|
|
+ v-if="moduleContains(editor.module)">Remove</vue-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="modules">
|
|
|
<div class="tabs">
|
|
|
- <div class="tab__control" v-for="(type, name) in moduleTypes" :key="name" @click="moduleLibrary = name" :class="{ active: moduleLibrary == name}">
|
|
|
+ <div class="tab__control" v-for="(type, name) in moduleTypes" :key="name"
|
|
|
+ @click="moduleLibrary = name" :class="{ active: moduleLibrary == name}">
|
|
|
<img :src="type.icon" :alt="name"><span class="tab__control-name">[[ name ]]</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="tab__pane">
|
|
|
- <div class="modules__type" v-for="(type, name) in moduleTypes" :key="name" v-show="moduleLibrary == name" :test="name">
|
|
|
+ <div class="modules__type" v-for="(type, name) in moduleTypes" :key="name"
|
|
|
+ v-show="moduleLibrary == name" :test="name">
|
|
|
<p>[[ type.question ]]</p>
|
|
|
<div class="modules__grid">
|
|
|
- <module
|
|
|
- v-for="(module, index) in getModulesByType(name)"
|
|
|
- :key="index"
|
|
|
- :module="module"
|
|
|
- @click="handleClickCopyModule"
|
|
|
- has-grain
|
|
|
- draggable="true"
|
|
|
- @dragstart="startDragModule"
|
|
|
- ></module>
|
|
|
+ <module v-for="(module, index) in getModulesByType(name)" :key="index" :module="module"
|
|
|
+ @click="handleClickCopyModule" has-grain draggable="true" @dragstart="startDragModule">
|
|
|
+ </module>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -188,22 +174,22 @@
|
|
|
</label>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
+
|
|
|
<div class="rule" v-show="preview" v-if="!legacy">
|
|
|
<div class="controls">
|
|
|
- <vue-button class="primary is-large" @click="clickPreview" :icon="icons.edit" v-if="!view">Edit</vue-button>
|
|
|
+ <vue-button class="primary is-large" @click="clickPreview" :icon="icons.edit"
|
|
|
+ v-if="!view">Edit</vue-button>
|
|
|
</div>
|
|
|
- <h1><icon :icon="rule.icon" v-if="rule.icon"></icon> [[rule.name]]</h1>
|
|
|
+ <h1>
|
|
|
+ <icon :icon="rule.icon" v-if="rule.icon"></icon> [[rule.name]]
|
|
|
+ </h1>
|
|
|
<p>[[rule.summary]]</p>
|
|
|
<div class="modules__grid" :data-module-id="rule.ruleID" .module="rule">
|
|
|
- <module-display
|
|
|
- v-for="module in rule.modules"
|
|
|
- :key="module"
|
|
|
- :module="module"
|
|
|
- ></module-display>
|
|
|
+ <module-display v-for="module in rule.modules" :key="module" :module="module"></module-display>
|
|
|
</div>
|
|
|
<ul class="module-list">
|
|
|
- <module-list v-for="(module, index) in rule.modules" :key="index" :module="module" v-if="rule.modules"></module-list>
|
|
|
+ <module-list v-for="(module, index) in rule.modules" :key="index" :module="module"
|
|
|
+ v-if="rule.modules"></module-list>
|
|
|
</ul>
|
|
|
<div class="rule__creator" v-if="rule.creator.name">
|
|
|
Created By
|
|
@@ -211,6 +197,17 @@
|
|
|
<span v-if="rule.creator.url"><a :href="rule.creator.url">[[rule.creator.name]]</a></span>
|
|
|
<span v-else>[[rule.creator.name]]</span>
|
|
|
</div>
|
|
|
+ Version History:
|
|
|
+ <div style="white-space: normal;">
|
|
|
+ <div v-for="ruleId1 in rule.edit_history" :key="ruleId1"
|
|
|
+ style="display: inline-block; margin-right: 10px;">
|
|
|
+ <a :href="getRuleLink(ruleId1)">[[
|
|
|
+ getRuleName(ruleId1) ]]</a>
|
|
|
+ ==>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
</div>
|
|
|
<div class="rule legacy" v-if="legacy && preview">
|
|
|
<h1>[[rule.name]]</h1>
|
|
@@ -232,18 +229,23 @@
|
|
|
</div>
|
|
|
<div class="btn-group" v-if="!legacy && !view">
|
|
|
<!-- <vue-button class="primary is-large" @click="handleClickPublish" :icon="icons.publish" :loading="publishing">Publish</vue-button> -->
|
|
|
- <vue-button v-if="edit" class="primary is-large" @click="handleClickPublish" :icon="icons.edit" :loading="editing">
|
|
|
+ <vue-button v-if="edit" class="primary is-large" @click="handleClickPublish" :icon="icons.edit"
|
|
|
+ :loading="editing">
|
|
|
Edit
|
|
|
- </vue-button>
|
|
|
- <vue-button v-else class="primary is-large" @click="handleClickPublish" :icon="icons.publish" :loading="publishing">Publish</vue-button>
|
|
|
- </vue-button>
|
|
|
+ </vue-button>
|
|
|
+ <vue-button v-else class="primary is-large" @click="handleClickPublish" :icon="icons.publish"
|
|
|
+ :loading="publishing">Publish</vue-button>
|
|
|
+ </vue-button>
|
|
|
<vue-button class="is-large" @click="handleClickDownload" :icon="icons.download">Download</vue-button>
|
|
|
- <vue-button class="is-large" @click="handleClickImport" :icon="icons.upload">Import <div class="btn-cover">coming soon!</div></vue-button>
|
|
|
+ <vue-button class="is-large" @click="handleClickImport" :icon="icons.upload">Import <div class="btn-cover">
|
|
|
+ coming soon!</div></vue-button>
|
|
|
</div>
|
|
|
<div class="btn-group" v-if="view && !legacy">
|
|
|
<vue-button class="primary is-large" @click="clickPreview" :icon="icons.fork">Fork & Edit</vue-button>
|
|
|
- <vue-button class="primary is-large" v-if = "isOwner" @click="clickPreviewEdit" :icon="icons.fork">Edit </vue-button>
|
|
|
- <vue-button class="primary is-large" v-if = "isAdmin" @click="clickDelete" :icon="icons.fork">Delete </vue-button>
|
|
|
+ <vue-button class="primary is-large" v-if="isOwner" @click="clickPreviewEdit" :icon="icons.fork">Edit
|
|
|
+ </vue-button>
|
|
|
+ <vue-button class="primary is-large" v-if="isAdmin" @click="clickDelete" :icon="icons.fork">Delete
|
|
|
+ </vue-button>
|
|
|
<vue-button class="is-large" @click="handleClickDownload" :icon="icons.download">Download</vue-button>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -252,7 +254,8 @@
|
|
|
<h1>[[rule.name]]</h1>
|
|
|
<p>[[rule.summary]]</p>
|
|
|
<ul class="module-list">
|
|
|
- <module-list v-for="(module, index) in rule.modules" :key="index" :module="module" v-if="rule.modules" hide-icon></module-list>
|
|
|
+ <module-list v-for="(module, index) in rule.modules" :key="index" :module="module" v-if="rule.modules"
|
|
|
+ hide-icon></module-list>
|
|
|
</ul>
|
|
|
<hr>
|
|
|
<h2>Created By</h2>
|
|
@@ -272,30 +275,30 @@
|
|
|
<script>
|
|
|
|
|
|
let global = {};
|
|
|
-
|
|
|
+
|
|
|
global.modules = [
|
|
|
{% assign modules_array = site.modules | sort: "type" %}
|
|
|
- {% for module in modules_array %}
|
|
|
- {
|
|
|
- name: "{{ module.title | escape }}",
|
|
|
- url: "{{ site.baseurl }}{{ module.permalink }}",
|
|
|
+ {% for module in modules_array %}
|
|
|
+ {
|
|
|
+ name: "{{ module.title | escape }}",
|
|
|
+ url: "{{ site.baseurl }}{{ module.permalink }}",
|
|
|
moduleID: "{{ module.slug }}",
|
|
|
- icon: "{{ site.data.module_types[module.type].icon | default: 'null'}}",
|
|
|
- summary: "{{ module.summary }}",
|
|
|
- type: "{{ module.type }}",
|
|
|
- content: `{{ module.content | markdownify }}`,
|
|
|
- {% if module.config %}
|
|
|
- config: {
|
|
|
- {% for config in module.config %}
|
|
|
- "{{ config[0] }}": "{{ config[1] }}"
|
|
|
- {% unless forloop.last %}, {% endunless %}
|
|
|
- {% endfor %}
|
|
|
- },
|
|
|
- {% endif %}
|
|
|
- readonly: true,
|
|
|
- modules: []
|
|
|
- } {% unless forloop.last %}, {% endunless %}
|
|
|
+ icon: "{{ site.data.module_types[module.type].icon | default: 'null'}}",
|
|
|
+ summary: "{{ module.summary }}",
|
|
|
+ type: "{{ module.type }}",
|
|
|
+ content: `{{ module.content | markdownify }}`,
|
|
|
+ {% if module.config %}
|
|
|
+ config: {
|
|
|
+ {% for config in module.config %}
|
|
|
+ "{{ config[0] }}": "{{ config[1] }}"
|
|
|
+ {% unless forloop.last %}, {% endunless %}
|
|
|
{% endfor %}
|
|
|
+ },
|
|
|
+ {% endif %}
|
|
|
+ readonly: true,
|
|
|
+ modules: []
|
|
|
+ } {% unless forloop.last %}, {% endunless %}
|
|
|
+ {% endfor %}
|
|
|
];
|
|
|
|
|
|
// global.url = "{{ site.url }}{{ site.baseurl }}";
|
|
@@ -304,4 +307,4 @@
|
|
|
global.rule = {{ page.rule | jsonify }};
|
|
|
|
|
|
</script>
|
|
|
-<script src="/assets/js/vue.rules.js"></script>
|
|
|
+<script src="/assets/js/vue.rules.js"></script>
|