aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorhubzilla <git@macgirvin.com>2016-08-01 09:13:43 +1000
committerGitHub <noreply@github.com>2016-08-01 09:13:43 +1000
commit74c68f09e5d7fa28d7345e18e813dc726309ea48 (patch)
treea6e4b55e1eb695242165256808e47bed51a9df78 /view
parentda9b6690e565452a9a9d69084a07ac48005d7e60 (diff)
parent99afd0a449cde502b32c30d5b6170c6b87b85edc (diff)
downloadvolse-hubzilla-74c68f09e5d7fa28d7345e18e813dc726309ea48.tar.gz
volse-hubzilla-74c68f09e5d7fa28d7345e18e813dc726309ea48.tar.bz2
volse-hubzilla-74c68f09e5d7fa28d7345e18e813dc726309ea48.zip
Merge pull request #469 from anaqreon/website-import
Website import tool
Diffstat (limited to 'view')
-rw-r--r--view/css/mod_webpages.css85
-rw-r--r--view/js/mod_webpages.js15
-rw-r--r--view/pdl/mod_webpages.pdl1
-rw-r--r--view/tpl/webpage_import.tpl126
-rw-r--r--view/tpl/website_import_tools.tpl37
5 files changed, 264 insertions, 0 deletions
diff --git a/view/css/mod_webpages.css b/view/css/mod_webpages.css
index 1c6ec4aea..f72f632dd 100644
--- a/view/css/mod_webpages.css
+++ b/view/css/mod_webpages.css
@@ -34,3 +34,88 @@
.webpage-list-tool {
padding: 7px 10px;
}
+
+.webpage-import-button {
+ background-color: green;
+ color: white;
+}
+
+.webpage-import-button:hover {
+ background-color: darkgreen;
+}
+
+
+/* SQUARED TWO */
+.squaredTwo {
+ width: 28px;
+ height: 28px;
+ background: #fcfff4;
+
+ background: -webkit-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
+ background: -moz-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
+ background: -o-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
+ background: -ms-linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
+ background: linear-gradient(top, #fcfff4 0%, #dfe5d7 40%, #b3bead 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fcfff4', endColorstr='#b3bead',GradientType=0 );
+ margin: 20px auto;
+
+ -webkit-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
+ -moz-box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
+ box-shadow: inset 0px 1px 1px white, 0px 1px 3px rgba(0,0,0,0.5);
+ position: relative;
+}
+
+.squaredTwo label {
+ cursor: pointer;
+ position: absolute;
+ width: 20px;
+ height: 20px;
+ left: 4px;
+ top: 4px;
+
+ -webkit-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
+ -moz-box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
+ box-shadow: inset 0px 1px 1px rgba(0,0,0,0.5), 0px 1px 0px rgba(255,255,255,1);
+
+ background: -webkit-linear-gradient(top, #222 0%, #45484d 100%);
+ background: -moz-linear-gradient(top, #222 0%, #45484d 100%);
+ background: -o-linear-gradient(top, #222 0%, #45484d 100%);
+ background: -ms-linear-gradient(top, #222 0%, #45484d 100%);
+ background: linear-gradient(top, #222 0%, #45484d 100%);
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#222', endColorstr='#45484d',GradientType=0 );
+}
+
+.squaredTwo label:after {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
+ filter: alpha(opacity=0);
+ opacity: 0;
+ content: '';
+ position: absolute;
+ width: 9px;
+ height: 5px;
+ background: transparent;
+ top: 4px;
+ left: 4px;
+ border: 3px solid #fcfff4;
+ border-top: none;
+ border-right: none;
+
+ -webkit-transform: rotate(-45deg);
+ -moz-transform: rotate(-45deg);
+ -o-transform: rotate(-45deg);
+ -ms-transform: rotate(-45deg);
+ transform: rotate(-45deg);
+}
+
+.squaredTwo label:hover::after {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";
+ filter: alpha(opacity=30);
+ opacity: 0.3;
+}
+
+.squaredTwo input[type=checkbox]:checked + label:after {
+ -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
+ filter: alpha(opacity=100);
+ opacity: 1;
+}
+
diff --git a/view/js/mod_webpages.js b/view/js/mod_webpages.js
new file mode 100644
index 000000000..7cfe297e1
--- /dev/null
+++ b/view/js/mod_webpages.js
@@ -0,0 +1,15 @@
+$(document).ready(function() {
+ $("input[type=\"checkbox\"]").hide();
+});
+
+window.isChecked = true;
+
+function checkedAll(isChecked) {
+ window.isChecked = !window.isChecked ;
+ var c = document.getElementsByTagName('input');
+ for (var i = 0; i < c.length; i++){
+ if (c[i].type == 'checkbox'){
+ c[i].checked = isChecked;
+ }
+ }
+} \ No newline at end of file
diff --git a/view/pdl/mod_webpages.pdl b/view/pdl/mod_webpages.pdl
index cef69f194..b62ec6e7c 100644
--- a/view/pdl/mod_webpages.pdl
+++ b/view/pdl/mod_webpages.pdl
@@ -1,3 +1,4 @@
[region=aside]
[widget=design_tools][/widget]
+[widget=website_import_tools][/widget]
[/region] \ No newline at end of file
diff --git a/view/tpl/webpage_import.tpl b/view/tpl/webpage_import.tpl
new file mode 100644
index 000000000..fdc983932
--- /dev/null
+++ b/view/tpl/webpage_import.tpl
@@ -0,0 +1,126 @@
+<div class="generic-content-wrapper">
+ <form action="" method="post" autocomplete="on" >
+ <input type="hidden" name="action" value="importselected">
+ <div class="section-title-wrapper">
+ <div class="pull-right">
+ <button class="btn btn-md btn-success" type="submit" name="submit" value="{{$importbtn}}">{{$importbtn}}</button>
+ </div>
+ <h2>{{$title}}</h2>
+ <div class="clear"></div>
+ </div>
+ <div id="import-website-content-wrapper" class="section-content-wrapper">
+ <div class="pull-left">
+ <button id="toggle-select-all" class="btn btn-xs btn-primary" onclick="checkedAll(window.isChecked); return false;"><i class="fa fa-check"></i>&nbsp;Toggle Select All</button>
+ </div>
+ <div class="clear"></div>
+ <h4>Scanned Pages</h4>
+ <div>
+ <table class="table-striped table-responsive table-hover" style="width: 100%;">
+ <tr><td>Import?</td><td>Page</td><!--<td>Existing Page</td>--></tr>
+ {{foreach $pages as $page}}
+ <tr>
+ <td>
+ <div class='squaredTwo'>
+ <input type="checkbox" id="page_{{$page.pagelink}}" name="page[]" value="{{$page.pagelink}}">
+ <label for="page_{{$page.pagelink}}"></label>
+ </div>
+ </td>
+ <td>
+ <div class='desc'>
+ Page Link: {{$page.pagelink}}<br>
+ Layout: {{$page.layout}}<br>
+ Title: {{$page.title}}<br>
+ Content File: {{$page.contentfile}}<br>
+ Type: {{$page.type}}<br>
+ </div>
+ </td>
+ <!-- TODO: Retrieve existing element information to avoid accidental overwriting
+ <td>
+ <div class='desc'>
+ Name: {{$page.curpage.pagelink}}<br>
+ Layout: {{$page.curpage.layout}}<br>
+ Title: {{$page.curpage.title}}<br>
+ Last edit: {{$page.curpage.edited}}<br>
+ Type: {{$page.curpage.type}}<br>
+ </div>
+ </td>
+ -->
+ </tr>
+ {{/foreach}}
+ </table>
+ </div>
+
+
+ <h4>Scanned Layouts</h4>
+ <div>
+ <table class="table-striped table-responsive table-hover" style="width: 100%;">
+ <tr><td>Import?</td><td>Layout</td><!--<td>Existing Layout</td>--></tr>
+ {{foreach $layouts as $layout}}
+ <tr>
+ <td>
+ <div class='squaredTwo'>
+ <input type="checkbox" id="layout_{{$layout.name}}" name="layout[]" value="{{$layout.name}}">
+ <label for="layout_{{$layout.name}}"></label>
+ </div>
+ </td>
+ <td>
+ <div class='desc'>
+ Name: {{$layout.name}}<br>
+ Description: {{$layout.description}}<br>
+ Content File: {{$layout.contentfile}}<br>
+ </div>
+ </td>
+ <!-- TODO: Retrieve existing element information to avoid accidental overwriting
+ <td>
+ <div class='desc'>
+ Name: {{$layout.curblock.name}}<br>
+ Title: {{$layout.curblock.description}}<br>
+ Last edit: {{$layout.curblock.edited}}<br>
+ </div>
+ </td>
+ -->
+ </tr>
+ {{/foreach}}
+ </table>
+ </div>
+
+ <h4>Scanned Blocks</h4>
+ <div>
+ <table class="table-striped table-responsive table-hover" style="width: 100%;">
+ <tr><td>Import?</td><td>Block</td><!--<td>Existing Block</td>--></tr>
+ {{foreach $blocks as $block}}
+ <tr>
+ <td>
+ <div class='squaredTwo'>
+ <input type="checkbox" id="block_{{$block.name}}" name="block[]" value="{{$block.name}}">
+ <label for="block_{{$block.name}}"></label>
+ </div>
+ </td>
+ <td>
+ <div class='desc'>
+ Name: {{$block.name}}<br>
+ Title: {{$block.title}}<br>
+ Content File: {{$block.contentfile}}<br>
+ Type: {{$block.type}}<br>
+ </div>
+ </td>
+ <!-- TODO: Retrieve existing element information to avoid accidental overwriting
+ <td>
+ <div class='desc'>
+ Name: {{$block.curblock.name}}<br>
+ Title: {{$block.curblock.title}}<br>
+ Last edit: {{$block.curblock.edited}}<br>
+ Type: {{$block.curblock.type}}<br>
+ </div>
+ </td>
+ -->
+ </tr>
+ {{/foreach}}
+ </table>
+ </div>
+
+ </div>
+ <div class="clear"></div>
+ </form>
+</div>
+
diff --git a/view/tpl/website_import_tools.tpl b/view/tpl/website_import_tools.tpl
new file mode 100644
index 000000000..cb3e6b524
--- /dev/null
+++ b/view/tpl/website_import_tools.tpl
@@ -0,0 +1,37 @@
+<div id="website-import-tools" class="widget">
+ <h3>{{$title}}</h3>
+ <ul class="nav nav-pills nav-stacked">
+ <li>
+ <a href="#" onclick="openClose('import-form');
+ return false;"><i class="fa fa-cloud-upload generic-icons"></i> {{$import_label}}</a>
+ </li>
+ <li>
+ <form id="import-form" enctype="multipart/form-data" method="post" action="" style="display: none;" class="sub-menu">
+
+ <input type="hidden" name="action" value="scan">
+
+ <p style="margin-top: 20px;" class="descriptive-text">{{$file_import_text}}</p>
+ <div class="form-group">
+ <div class="input-group">
+ <input class="widget-input" type="text" name="path" title="{{$hint}}" placeholder="{{$desc}}" />
+ <div class="input-group-btn">
+ <button class="btn btn-default btn-sm" type="submit" name="cloudsubmit" value="{{$select}}"><i class="fa fa-folder-open generic-icons"></i></button>
+ </div>
+ </div>
+ </div>
+
+ <!-- Or upload a zipped file containing the website -->
+ <p class="descriptive-text">{{$file_upload_text}}</p>
+ <div class="form-group">
+
+ <div class="input-group">
+ <input class="widget-input" type="file" name="zip_file" />
+ <div class="input-group-btn">
+ <button class="btn btn-default btn-sm" type="submit" name="w_upload" value="w_upload"><i class="fa fa-file-archive-o generic-icons"></i></button>
+ </div>
+ </div>
+ </div>
+ </form>
+ </li>
+ </ul>
+</div>