From 27d786c979a07eddaa31a9f8fe291360b586b9cf Mon Sep 17 00:00:00 2001 From: marijus Date: Sun, 21 Dec 2014 20:11:30 +0100 Subject: files: make mod/filestorage.php load via ajax and some design work. work in progress... --- include/RedDAV/RedBrowser.php | 24 ++++++++++++---------- mod/filestorage.php | 3 ++- view/js/main.js | 12 +++++++++++ view/js/mod_filestorage.js | 1 + view/theme/redbasic/css/style.css | 10 ---------- view/tpl/attach_edit.tpl | 14 ++++++------- view/tpl/cloud_actionspanel.tpl | 42 +++++++++++++++------------------------ view/tpl/cloud_directory.tpl | 14 ++++++------- 8 files changed, 57 insertions(+), 63 deletions(-) diff --git a/include/RedDAV/RedBrowser.php b/include/RedDAV/RedBrowser.php index eb08fd79f..78aacf92b 100644 --- a/include/RedDAV/RedBrowser.php +++ b/include/RedDAV/RedBrowser.php @@ -238,11 +238,21 @@ class RedBrowser extends DAV\Browser\Plugin { $quota['limit'] = $limit; $quota['desc'] = $quotaDesc; - $html .= replace_macros(get_markup_template('cloud_directory.tpl'), array( + $output = ''; + if ($this->enablePost) { + $this->server->broadcastEvent('onHTMLActionsPanel', array($parent, &$output)); + } + + $html .= replace_macros(get_markup_template('cloud_header.tpl'), array( '$header' => t('Files') . ": " . $this->escapeHTML($path) . "/", + '$quota' => $quota, + '$total' => t('Total'), + '$actionspanel' => $output + )); + + $html .= replace_macros(get_markup_template('cloud_directory.tpl'), array( '$parentpath' => $parentpath, '$entries' => $f, - '$quota' => $quota, '$name' => t('Name'), '$type' => t('Type'), '$size' => t('Size'), @@ -250,15 +260,9 @@ class RedBrowser extends DAV\Browser\Plugin { '$parent' => t('parent'), '$edit' => t('Edit'), '$delete' => t('Delete'), - '$total' => t('Total') + '$nick' => $this->auth->getCurrentUser() )); - $output = ''; - if ($this->enablePost) { - $this->server->broadcastEvent('onHTMLActionsPanel', array($parent, &$output)); - } - $html .= $output; - get_app()->page['content'] = $html; load_pdl(get_app()); construct_page(get_app()); @@ -371,4 +375,4 @@ class RedBrowser extends DAV\Browser\Plugin { } return $id; } -} \ No newline at end of file +} diff --git a/mod/filestorage.php b/mod/filestorage.php index e27087a92..1767ea6bf 100644 --- a/mod/filestorage.php +++ b/mod/filestorage.php @@ -146,7 +146,8 @@ function filestorage_content(&$a) { '$submit' => t('Submit') )); - return $o; + echo $o; + killme(); } goaway(z_root() . '/cloud/' . $which); diff --git a/view/js/main.js b/view/js/main.js index a851e7e63..f49cea78c 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -208,6 +208,7 @@ var pageHasMoreContent = true; var updateCountsOnly = false; var divmore_height = 400; + var last_filestorage_id = null; $(function() { $.ajaxSetup({cache: false}); @@ -842,6 +843,17 @@ function updateConvItems(mode,data) { }); } + function filestorage(event,nick,id) { + $('#perms-panel-' + last_filestorage_id).html(''); + $('#file-edit-' + id).spin('tiny'); + delete acl; + $.get('filestorage/' + nick + '/' + id + '/edit', function(data) { + $('#perms-panel-' + id).html(data); + $('#file-edit-' + id).spin(false); + last_filestorage_id = id; + }); + } + function post_comment(id) { unpause(); commentBusy = true; diff --git a/view/js/mod_filestorage.js b/view/js/mod_filestorage.js index 88c1cf7d8..bee37767f 100644 --- a/view/js/mod_filestorage.js +++ b/view/js/mod_filestorage.js @@ -13,4 +13,5 @@ $(document).ready(function() { } }).trigger('change'); + }); diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 382bed90e..524db7899 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -2076,18 +2076,8 @@ nav .dropdown-menu>li>a:hover,nav .dropdown-menu>li>a:focus{ color: $nav_active_icon_colour; } -/* Files */ - -#attach-edit-perms { - margin-top: 25px; - margin-bottom: 20px; - font-weight: bold; - font-size: 17px; -} - /* bootstrap overrides */ - blockquote { font-size: $font_size; font-style: italic; diff --git a/view/tpl/attach_edit.tpl b/view/tpl/attach_edit.tpl index a2a4af16b..bf39e6158 100644 --- a/view/tpl/attach_edit.tpl +++ b/view/tpl/attach_edit.tpl @@ -1,16 +1,16 @@ - - -

{{$header}}

-
-{{$aclselect}} {{$file.filename}} +
+{{$aclselect}} + @@ -28,9 +28,7 @@
{{$cpldesc}}

-
- -
+ diff --git a/view/tpl/cloud_actionspanel.tpl b/view/tpl/cloud_actionspanel.tpl index 00f243c1e..d88bc94c4 100644 --- a/view/tpl/cloud_actionspanel.tpl +++ b/view/tpl/cloud_actionspanel.tpl @@ -1,27 +1,17 @@ -
- - - - - - - - - - -
{{$folder_header}}    -
- - - -
-
{{$upload_header}}    -
- - - - -
-
- +
+ +
+ + + +
+
+
+ +
+ + + + +
diff --git a/view/tpl/cloud_directory.tpl b/view/tpl/cloud_directory.tpl index 639a6bf61..f37895e09 100644 --- a/view/tpl/cloud_directory.tpl +++ b/view/tpl/cloud_directory.tpl @@ -1,5 +1,5 @@
-

{{$header}}

+ @@ -26,8 +26,9 @@ {{if $item.is_owner}} - - + + + {{else}} {{/if}} @@ -35,11 +36,8 @@ + {{/foreach}} - -
{{$item.displayName}}{{$item.attachIcon}}{{$item.sizeFormatted}} {{$item.lastmodified}}

-{{if $quota.limit || $quota.used}} -

{{$total}} {{$quota.desc}}

-{{/if}} +
-- cgit v1.2.3