]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
plugin admin first version
authorArthurHoaro <arthur@hoa.ro>
Wed, 12 Oct 2016 10:33:22 +0000 (12:33 +0200)
committerArthurHoaro <arthur@hoa.ro>
Wed, 12 Oct 2016 10:33:22 +0000 (12:33 +0200)
tpl/default/css/shaarli.css
tpl/default/page.header.html
tpl/default/pluginsadmin.html [new file with mode: 0644]

index a1435b37334940469be5525917c44d97178d2fc0..f57c0bb03fede8f8ec06577757db127982eddd5d 100644 (file)
@@ -619,6 +619,10 @@ pre {
     border-bottom: 1px solid #797979;
 }
 
+.page-form h3 {
+    text-align: center;
+}
+
 .page-form a {
     color: #b0ddce;
     font-weight: bold;
@@ -640,6 +644,7 @@ pre {
 
 .page-form textarea {
     height: 240px;
+    padding: 15px 5px 3px 15px;
     resize: vertical;
     overflow-y: auto;
     word-wrap:break-word
@@ -652,7 +657,7 @@ pre {
 }
 
 .page-form input[type="submit"] {
-    margin: 10px 0;
+    margin: 15px 5px;
     height: 35px;
     width: 150px;
     background: #1b926c;
@@ -712,6 +717,32 @@ pre {
     font-size: 0.7em;
 }
 
+.page-form section {
+    margin-top: 20px;
+}
+
+
+.page-form table {
+    margin: auto;
+    width: 90%;
+}
+
+.page-form table .order {
+    text-decoration: none;
+}
+
+.page-form table, .page-form th, .page-form td {
+    border-width: 1px 0;
+    border-style: solid;
+    border-color: #b0ddce;
+}
+
+.page-form th, .page-form td {
+    padding: 5px;
+
+}
+
+/* Awesomeplete fix */
 .page-form .awesomplete {
     width: 80%;
 }
@@ -875,7 +906,7 @@ pre {
 
 .label-tag {
     border: 1px solid #505050;
-    font-size: 0.9em;
+    font-size: 1em;
 }
 
 .label-tag:hover {
index 335ef686c23eaa8fe07f2de5e946d44b16b59e09..177b32fb65ed766fe3728b82eea8b23a58f7a817 100644 (file)
 {/if}
 
 {if="!empty($plugin_errors) && isLoggedIn()"}
-    <ul class="errors">
+  <div class="pure-g new-version-message pure-alert pure-alert-error pure-alert-closable">
+    <div class="pure-u-2-24"></div>
+    <div class="pure-u-20-24">
         {loop="plugin_errors"}
-            <li>{$value}</li>
+            <p>{$value}</p>
         {/loop}
-    </ul>
+    </div>
+    <div class="pure-u-2-24">
+      <i class="fa fa-times pure-alert-close"></i>
+    </div>
+  </div>
 {/if}
 
 <div class="clear"></div>
diff --git a/tpl/default/pluginsadmin.html b/tpl/default/pluginsadmin.html
new file mode 100644 (file)
index 0000000..189c103
--- /dev/null
@@ -0,0 +1,145 @@
+<!DOCTYPE html>
+<html>
+<head>
+  {include="includes"}
+</head>
+<body>
+{include="page.header"}
+
+<noscript>
+  <div class="pure-g new-version-message pure-alert pure-alert-warning">
+    <div class="pure-u-2-24"></div>
+    <div class="pure-u-20-24">
+      {'You need to enable Javascript to change plugin loading order.'|t}
+    </div>
+  </div>
+  <div class="clear"></div>
+</noscript>
+
+<form method="POST" action="?do=save_pluginadmin" name="pluginform" id="pluginform">
+  <div class="pure-g">
+    <div class="pure-u-lg-1-6 pure-u-1-8"></div>
+    <div class="pure-u-lg-2-3 pure-u-3-4 page-form page-form-complete">
+      <h2>{'Plugin administration'|t}</h2>
+
+      <section id="enabled_plugins">
+        <h3>{'Enabled Plugins'|t}</h3>
+
+        <div>
+          {if="count($enabledPlugins)==0"}
+          <p>{'No plugin enabled.'|t}</p>
+          {else}
+          <table id="plugin_table">
+            <thead>
+            <tr>
+              <th class="center">{'Disable'|t}</th>
+              <th class="center">{'Order'|t}</th>
+              <th>{'Name'|t}</th>
+              <th>{'Description'|t}</th>
+            </tr>
+            </thead>
+            <tbody>
+            {loop="$enabledPlugins"}
+            <tr data-line="{$key}" data-order="{$counter}">
+              <td class="center"><input type="checkbox" name="{$key}" id="{$key}" checked="checked"></td>
+              <td class="center">
+                {if="count($enabledPlugins)>1"}
+                  <a href="#" class="order"
+                     onclick="return orderUp(this.parentNode.parentNode.getAttribute('data-order'));">
+                    ▲
+                  </a>
+                  <a href="#" class="order"
+                     onclick="return orderDown(this.parentNode.parentNode.getAttribute('data-order'));">
+                    ▼
+                  </a>
+                {/if}
+                <input type="hidden" name="order_{$key}" value="{$counter}">
+              </td>
+              <td class="center"><label for="{$key}">{function="str_replace('_', ' ', $key)"}</label></td>
+              <td><label for="{$key}">{$value.description}</label></td>
+            </tr>
+            {/loop}
+            </tbody>
+          </table>
+          {/if}
+        </div>
+      </section>
+
+      <section id="disabled_plugins">
+        <h3>{'Disabled Plugins'|t}</h3>
+
+        <div>
+          {if="count($disabledPlugins)==0"}
+          <p>{'No plugin disabled.'|t}</p>
+          {else}
+          <table>
+            <tr>
+              <th class="center">{'Enable'|t}</th>
+              <th>{'Name'|t}</th>
+              <th>{'Description'|t}</th>
+            </tr>
+            {loop="$disabledPlugins"}
+            <tr>
+              <td class="center"><input type="checkbox" name="{$key}" id="{$key}"></td>
+              <td class="center"><label for="{$key}">{function="str_replace('_', ' ', $key)"}</label></td>
+              <td><label for="{$key}">{$value.description}</label></td>
+            </tr>
+            {/loop}
+          </table>
+          {/if}
+        </div>
+
+      </section>
+
+      <div class="center">
+        <input type="submit" value="{'Save'|t}" name="save">
+      </div>
+    </div>
+  </div>
+  <input type="hidden" name="token" value="{$token}">
+</form>
+
+<form action="?do=save_pluginadmin" method="POST">
+  <div class="pure-g">
+    <div class="pure-u-lg-1-6 pure-u-1-8"></div>
+    <div class="pure-u-lg-2-3 pure-u-3-4 page-form page-form-light">
+      <h2>{'Plugin configuration'|t}</h2>
+      <section id="plugin_parameters">
+        <div>
+          {if="count($enabledPlugins)==0"}
+            <p>{'No plugin enabled.'|t}</p>
+          {else}
+            {loop="$enabledPlugins"}
+              {if="count($value.parameters) > 0"}
+                <div class="plugin_parameters">
+                  <h3>{function="str_replace('_', ' ', $key)"}</h3>
+                  {loop="$value.parameters"}
+                  <div class="plugin_parameter">
+                    <div class="float_label">
+                      <label for="{$key}">
+                        <code>{$key}</code>
+                      </label>
+                    </div>
+                    <div class="float_input">
+                      <input name="{$key}" value="{$value}" id="{$key}" type="text" />
+                    </div>
+                  </div>
+                  {/loop}
+                </div>
+              {/if}
+            {/loop}
+          {/if}
+          <div class="center">
+            <input type="submit" name="parameters_form" value="{'Save'|t}"/>
+          </div>
+        </div>
+      </section>
+    </div>
+  </div>
+</form>
+
+{include="page.footer"}
+<script src="inc/plugin_admin.js#"></script>
+
+</body>
+</html>