Skip to content

Commit

Permalink
Merge pull request #6399 from nextcloud/app-navigation-flex
Browse files Browse the repository at this point in the history
App navigation flex
  • Loading branch information
skjnldsv authored Sep 21, 2017
2 parents 4d556a3 + eb00dbb commit e336283
Show file tree
Hide file tree
Showing 9 changed files with 375 additions and 225 deletions.
14 changes: 2 additions & 12 deletions apps/files/css/files.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@
.nav-icon-trashbin {
background-image: url('../img/delete.svg?v=1');
}
/* no icon for the quota bar */
.nav-icon-quota {
padding-left: 15px !important;
background-image: url('../img/quota.svg?v=1');
}

#app-navigation .nav-files a.nav-icon-files {
Expand Down Expand Up @@ -777,11 +776,7 @@ table.dragshadow td.size {
margin: 0 !important;
border: none;
border-radius: 0;
position: fixed !important;
bottom: 44px;
width: inherit !important;
background-color: #fff;
border-right: 1px solid #eee;
background-color: transparent;
z-index:1;

.quota-container {
Expand All @@ -795,11 +790,6 @@ table.dragshadow td.size {
}
}

/* increase the padding of the last item to not hide below the quota item */
.app-files #app-navigation > ul li:nth-last-child(1) {
margin-bottom: 44px;
}

#quotatext {
padding: 0;
height: 30px;
Expand Down
4 changes: 4 additions & 0 deletions apps/files/img/quota.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 12 additions & 9 deletions apps/files/templates/appnavigation.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
<div id="app-navigation">
<ul class="with-icon">
<li id="quota" class="section <?php
<?php $pinned = 0 ?>
<?php foreach ($_['navigationItems'] as $item) {
strpos($item['classes'], 'pinned')!==false ? $pinned++ : '';
?>
<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?> <?php p($item['classes']) ?> <?php p($pinned===1?'first-pinned':'') ?>">
<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg">
<?php p($item['name']);?>
</a>
</li>
<?php } ?>
<li id="quota" class="section pinned <?php
if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
?>has-tooltip" title="<?php p($_['usage_relative'] . '%');
} ?>">
Expand All @@ -18,14 +29,6 @@
</div>
</a>
</li>
<?php foreach ($_['navigationItems'] as $item) { ?>
<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>">
<a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg">
<?php p($item['name']);?>
</a>
</li>
<?php } ?>
</ul>
<div id="app-settings">
<div id="app-settings-header">
Expand Down
8 changes: 8 additions & 0 deletions apps/files/tests/Controller/ViewControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ public function testIndexWithRegularBrowser() {
'active' => false,
'icon' => '',
'type' => 'link',
'classes' => '',
],
[
'id' => 'recent',
Expand All @@ -152,6 +153,7 @@ public function testIndexWithRegularBrowser() {
'active' => false,
'icon' => '',
'type' => 'link',
'classes' => '',
],
[
'id' => 'favorites',
Expand All @@ -162,6 +164,7 @@ public function testIndexWithRegularBrowser() {
'active' => false,
'icon' => '',
'type' => 'link',
'classes' => '',
],
[
'id' => 'sharingin',
Expand All @@ -172,6 +175,7 @@ public function testIndexWithRegularBrowser() {
'active' => false,
'icon' => '',
'type' => 'link',
'classes' => '',
],
[
'id' => 'sharingout',
Expand All @@ -182,6 +186,7 @@ public function testIndexWithRegularBrowser() {
'active' => false,
'icon' => '',
'type' => 'link',
'classes' => '',
],
[
'id' => 'sharinglinks',
Expand All @@ -192,6 +197,7 @@ public function testIndexWithRegularBrowser() {
'active' => false,
'icon' => '',
'type' => 'link',
'classes' => '',
],
[
'id' => 'systemtagsfilter',
Expand All @@ -202,6 +208,7 @@ public function testIndexWithRegularBrowser() {
'active' => false,
'icon' => '',
'type' => 'link',
'classes' => '',
],
[
'id' => 'trashbin',
Expand All @@ -212,6 +219,7 @@ public function testIndexWithRegularBrowser() {
'active' => false,
'icon' => '',
'type' => 'link',
'classes' => 'pinned',
],
]);

Expand Down
1 change: 1 addition & 0 deletions apps/files_trashbin/appinfo/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
'script' => 'list.php',
'order' => 50,
'name' => $l->t('Deleted files'),
'classes' => 'pinned',
];
});
14 changes: 0 additions & 14 deletions apps/files_trashbin/css/trash.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,3 @@
display: none;
}

/* move Deleted Files to bottom of sidebar */
.nav-trashbin {
position: fixed !important;
bottom: 88px;
width: inherit !important;
background-color: #fff;
border-right: 1px solid #eee;
margin-bottom: 0px !important;
}
/* double padding to account for Deleted files entry, issue with Firefox */
.app-files #app-navigation > ul li:nth-last-child(2) {
margin-bottom: 88px;
}

Loading

0 comments on commit e336283

Please sign in to comment.