]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Import/export templates and minor fixes
authorArthurHoaro <arthur@hoa.ro>
Sat, 15 Oct 2016 15:01:37 +0000 (17:01 +0200)
committerArthurHoaro <arthur@hoa.ro>
Sat, 5 Nov 2016 13:29:53 +0000 (14:29 +0100)
tpl/default/css/shaarli.css
tpl/default/export.html [new file with mode: 0644]
tpl/default/import.html [new file with mode: 0644]
tpl/default/js/shaarli.js
tpl/default/loginform.html
tpl/default/page.footer.html
tpl/default/page.header.html

index 22c173b1f99a550aa87eda7e8cb58fd4c867b6da..4b1be7e2b2557eefd10a5cd5d137c8863b9ad556 100644 (file)
@@ -789,6 +789,11 @@ pre {
         content:"\a\a";
         white-space: pre;
     }
+
+    .page-form-complete .radio-buttons {
+        text-align: left;
+        padding: 5px 15px;
+    }
 }
 
 
@@ -970,3 +975,15 @@ pre {
         border-top-style: none;
     }
 }
+
+
+/**
+ * IMPORT
+ */
+#import-field {
+    margin: 15px 0;
+}
+
+@media screen and (max-width: 64em) {
+
+}
\ No newline at end of file
diff --git a/tpl/default/export.html b/tpl/default/export.html
new file mode 100644 (file)
index 0000000..f641976
--- /dev/null
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<html>
+<head>
+  {include="includes"}
+</head>
+<body>
+{include="page.header"}
+
+{$ratioLabel='5-12'}
+{$ratioLabelMobile='7-8'}
+{$ratioInput='7-12'}
+{$ratioInputMobile='1-8'}
+
+<form method="GET" action="" name="exportform" id="exportform">
+  <div class="pure-g">
+    <div class="pure-u-lg-1-4 pure-u-1-8"></div>
+    <div class="pure-u-lg-1-2 pure-u-3-4 page-form page-form-complete">
+      <div>
+        <h2>{"Export Database"|t}</h2>
+      </div>
+      <input type="hidden" name="do" value="export">
+      <input type="hidden" name="token" value="{$token}">
+
+      <div class="pure-g">
+        <div class="pure-u-lg-1-2 pure-u-1">
+          <div class="form-label">
+            <label><span class="label-name">{'Selection'|t}</span></label>
+          </div>
+        </div>
+        <div class="pure-u-lg-1-2 pure-u-1">
+          <div class="radio-buttons">
+            <div>
+              <input type="radio" name="selection" value="all" checked="true">
+              {'All'|t}
+            </div>
+            <div>
+              <input type="radio" name="selection" value="private">
+              {'Private'|t}
+            </div>
+            <div>
+              <input type="radio" name="selection" value="public">
+              {'Public'|t}
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div class="pure-g">
+        <div class="pure-u-lg-1-2 pure-u-7-8">
+          <div class="form-label">
+            <label for="prepend_note_url">
+              <span class="label-name">{'Prepend note permalinks with this Shaarli instance\'s URL'|t}</span><br>
+              <span class="label-desc">{'Useful to import bookmarks in a web browser'|t}</span>
+            </label>
+          </div>
+        </div>
+        <div class="pure-u-lg-1-2 pure-u-1-8">
+          <div class="form-input">
+            <input type="checkbox" name="prepend_note_url" id="prepend_note_url">
+          </div>
+        </div>
+      </div>
+
+      <div class="center">
+        <input type="submit" value="{'Export'|t}">
+      </div>
+    </div>
+  </div>
+</form>
+
+{include="page.footer"}
+</body>
+</html>
diff --git a/tpl/default/import.html b/tpl/default/import.html
new file mode 100644 (file)
index 0000000..3e77011
--- /dev/null
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<html>
+<head>
+  {include="includes"}
+</head>
+<body>
+{include="page.header"}
+
+{$ratioLabel='5-12'}
+{$ratioLabelMobile='7-8'}
+{$ratioInput='7-12'}
+{$ratioInputMobile='1-8'}
+
+<form method="POST" action="?do=import" enctype="multipart/form-data" name="uploadform" id="uploadform">
+  <div class="pure-g">
+    <div class="pure-u-lg-1-4 pure-u-1-8"></div>
+    <div class="pure-u-lg-1-2 pure-u-3-4 page-form page-form-complete">
+      <div>
+        <h2>{"Import Database"|t}</h2>
+      </div>
+
+      <input type="hidden" name="token" value="{$token}">
+      <div class="center" id="import-field">
+        <input type="hidden" name="MAX_FILE_SIZE" value="{$maxfilesize}">
+        <input type="file" name="filetoupload">
+      </div>
+
+      <div class="pure-g">
+        <div class="pure-u-lg-1-3 pure-u-1">
+          <div class="form-label">
+            <label><span class="label-name">{'Visibility'|t}</span></label>
+          </div>
+        </div>
+        <div class="pure-u-lg-2-3 pure-u-1">
+          <div class="radio-buttons">
+            <div>
+              <input type="radio" name="privacy" value="default" checked="true">
+              Use values from the imported file, default to public
+            </div>
+            <div>
+              <input type="radio" name="privacy" value="private">
+              Import all bookmarks as private
+            </div>
+            <div>
+              <input type="radio" name="privacy" value="public">
+              Import all bookmarks as public
+            </div>
+          </div>
+        </div>
+      </div>
+
+      <div class="pure-g">
+        <div class="pure-u-lg-1-3 pure-u-7-8">
+          <div class="form-label">
+            <label for="overwrite"><span class="label-name">{'Overwrite existing bookmarks'|t}</span></label>
+          </div>
+        </div>
+        <div class="pure-u-lg-2-3 pure-u-1-8">
+          <div class="form-input">
+            <input type="checkbox" name="overwrite" id="overwrite">
+          </div>
+        </div>
+      </div>
+
+      <div class="pure-g">
+        <div class="pure-u-lg-1-3 pure-u-1">
+          <div class="form-label">
+            <label for="default_tags"><span class="label-name">{'Add default tags'|t}</span></label>
+          </div>
+        </div>
+        <div class="pure-u-lg-2-3 pure-u-1">
+          <div class="form-input">
+            <input type="text" name="default_tags" id="default_tags">
+          </div>
+        </div>
+      </div>
+
+      <div class="center">
+        <input type="submit" name="import_file" value="{'Import'|t}">
+      </div>
+    </div>
+  </div>
+</form>
+
+{include="page.footer"}
+</body>
+</html>
index e542548607899191d9c09421a59eb4fc3216d4d2..53ec20c5b83ebfbf1506a7d47eabcdd429ebd1e4 100644 (file)
@@ -166,9 +166,10 @@ if (hiddenReturnurl != null) {
     hiddenReturnurl.value = window.location.href;
 }
 
-
+/**
+ * Autofocus text fields
+ */
 var autofocusElements = document.querySelector('.autofocus');
-console.log(autofocusElements);
 if (autofocusElements != null) {
     autofocusElements.focus();
 }
\ No newline at end of file
index 219236068d6d05b6285ae38231fd3c81c8e077c9..28c92f3e3253505dc90c770682552f051b862c9b 100644 (file)
@@ -28,8 +28,8 @@
           <input type="password" name="password" placeholder="{'Password'|t}" tabindex="21">
         </div>
         <div class="remember-me">
-          <input type="checkbox" name="longlastingsession" id="longlastingsession" tabindex="22">
-          <label for="longlastingsession">{'Remember me'|t}</label>
+          <input type="checkbox" name="longlastingsession" id="longlastingsessionform" tabindex="22">
+          <label for="longlastingsessionform">{'Remember me'|t}</label>
         </div>
         <div>
           <input type="submit" value="{'Login'|t}" class="bigbutton" tabindex="23">
index f5a92382c73935f3808e389fb315c7210b3d4b13..b9d4389b94fa0b5bfbc78b28deb08d6e79be0bdf 100644 (file)
@@ -3,7 +3,7 @@
   <div id="footer" class="pure-u-20-24">
     <strong><a href="https://github.com/shaarli/Shaarli">Shaarli</a></strong> -
     The personal, minimalist, super-fast, database free, bookmarking service by the Shaarli community -
-    <a href="doc/Home.html" rel="nofollow">Help/documentation</a>
+    <a href="doc/Home.html" rel="nofollow">Documentation</a>
       {loop="$plugins_footer.text"}
           {$value}
       {/loop}
index 177b32fb65ed766fe3728b82eea8b23a58f7a817..5442ab425e7e3fca5621f759a1315ac064ccc595 100644 (file)
 </div>
 
 <div id="content">
-  <form method="post" name="loginform">
-    <div id="header-login-form">
-      <input type="text" name="login" placeholder="{'Username'|t}" tabindex="3">
-      <input type="password" name="password" placeholder="{'Password'|t}" tabindex="5">
-      <div class="remember-me">
-        <input type="checkbox" name="longlastingsession" id="longlastingsession" tabindex="6">
-        <label for="longlastingsession">{'Remember me'|t}</label>
+  {if="!isLoggedIn()"}
+    <form method="post" name="loginform">
+      <div id="header-login-form">
+        <input type="text" name="login" placeholder="{'Username'|t}" tabindex="3">
+        <input type="password" name="password" placeholder="{'Password'|t}" tabindex="5">
+        <div class="remember-me">
+          <input type="checkbox" name="longlastingsession" id="longlastingsession" tabindex="6">
+          <label for="longlastingsession">{'Remember me'|t}</label>
+        </div>
+        <input type="hidden" name="token" value="{$token}">
+        <input type="hidden" name="returnurl">
+        <input type="submit" value="Login" tabindex="7">
       </div>
-      <input type="hidden" name="token" value="{$token}">
-      <input type="hidden" name="returnurl">
-      <input type="submit" value="Login" tabindex="7">
-    </div>
-  </form>
+    </form>
+  {/if}
 
 {if="!empty($newVersion) || !empty($versionError)"}
   <div class="pure-g new-version-message pure-alert pure-alert-warning pure-alert-closable">