Added app navigation for files app

- Added links to trashbin and shared dir
- Moved "WebDAV" settings block to the app nav's settings section
- Added sidebar support in trashbin app as well
This commit is contained in:
Vincent Petry 2013-12-09 13:32:28 +01:00
parent 04f73275ba
commit 9ccb3279dd
10 changed files with 55 additions and 14 deletions

View File

@ -84,6 +84,9 @@
}
#filestable tbody tr { background-color:#fff; height:51px; }
.app-files #controls {
left: 300px;
}
#filestable tbody tr:hover, tbody tr:active {
background-color: rgb(240,240,240);
}
@ -431,3 +434,7 @@ table.dragshadow td.size {
.mask.transparent{
opacity: 0;
}
.app-files #app-settings input {
width: 90%;
}

View File

@ -89,6 +89,11 @@ if ($trashEnabled) {
$trashEmpty = \OCA\Files_Trashbin\Trashbin::isEmpty($user);
}
$nav = new OCP\Template('files', 'appnavigation', '');
$nav->assign('trash', $trashEnabled);
$nav->assign('trashEmpty', $trashEmpty);
OCP\Util::addscript('files', 'fileactions');
OCP\Util::addscript('files', 'files');
OCP\Util::addscript('files', 'keyboardshortcuts');
@ -110,5 +115,6 @@ $tmpl->assign("mailNotificationEnabled", $config->getAppValue('core', 'shareapi_
$tmpl->assign("allowShareWithLink", $config->getAppValue('core', 'shareapi_allow_links', 'yes'));
$tmpl->assign("encryptionInitStatus", $encryptionInitStatus);
$tmpl->assign('disableSharing', false);
$tmpl->assign('appNavigation', $nav);
$tmpl->printPage();

View File

@ -254,6 +254,14 @@ $(document).ready(function() {
}
}
$('#app-settings-header').on('click', function() {
var $settings = $('#app-settings');
$settings.toggleClass('opened');
if ($settings.hasClass('opened')) {
$settings.find('input').focus();
}
});
//scroll to and highlight preselected file
if (getURLParameter('scrollto')) {
FileList.scrollTo(getURLParameter('scrollto'));

View File

@ -0,0 +1,19 @@
<div id="app-navigation">
<ul>
<li class="allfiles"><a href="<?php p(OC_Helper::linkTo('files', '')) ?>"><?php p($l->t('All Files'));?></a></li>
<li class="sep"></li>
<?php if ($_['trash'] ): ?>
<li class="trash"><a href="<?php p(OC_Helper::linkTo('files_trashbin', 'index.php')) ?>"><?php p($l->t('Deleted files'));?></a></li>
<?php endif; ?>
</ul>
<div id="app-settings">
<div id="app-settings-header">
<button class="settings-button"></button>
</div>
<div id="app-settings-content">
<h2><?php p($l->t('WebDAV'));?></h2>
<div><input id="webdavurl" type="text" readonly="readonly" value="<?php p(OC_Helper::linkToRemote('webdav')); ?>"></input></div>
<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</div>
</div>
</div>

View File

@ -1,4 +1,6 @@
<?php /** @var $l OC_L10N */ ?>
<?php $_['appNavigation']->printPage(); ?>
<div id="app-content">
<div id="controls">
<div class="actions creatable hidden">
<?php if(!isset($_['dirToken'])):?>
@ -37,9 +39,6 @@
data-url="<?php print_unescaped(OCP\Util::linkTo('files', 'ajax/upload.php')); ?>" />
<a href="#" class="svg icon-upload"></a>
</div>
<?php if ($_['trash']): ?>
<input id="trash" type="button" value="<?php p($l->t('Deleted files'));?>" class="button" <?php $_['trashEmpty'] ? p('disabled') : '' ?> />
<?php endif; ?>
<div id="uploadprogresswrapper">
<div id="uploadprogressbar"></div>
<input type="button" class="stop" style="display:none"
@ -112,6 +111,8 @@
</p>
</div>
</div><!-- closing app-content -->
<!-- config hints for javascript -->
<input type="hidden" name="filesApp" id="filesApp" value="1" />
<input type="hidden" name="allowZipDownload" id="allowZipDownload" value="<?php p($_['allowZipDownload']); ?>" />

View File

@ -39,4 +39,9 @@ if ($isIE8 && isset($_GET['dir'])){
$tmpl->assign('dir', $dir);
$tmpl->assign('disableSharing', true);
$nav = new OCP\Template('files', 'appnavigation', '');
$nav->assign('trash', true);
$tmpl->assign('appNavigation', $nav);
$tmpl->printPage();

View File

@ -1,4 +1,6 @@
<?php /** @var $l OC_L10N */ ?>
<?php $_['appNavigation']->printPage(); ?>
<div id="app-content">
<div id="controls">
<div id="file_action_panel"></div>
</div>
@ -44,3 +46,4 @@
<tfoot>
</tfoot>
</table>
</div>

View File

@ -178,6 +178,9 @@
bottom: 0;
border-top: 1px solid #ccc;
}
#app-settings.opened #app-settings-content {
display: block;
}
#app-settings-header {
background-color: #eee;
}

View File

@ -302,11 +302,6 @@ input[type="submit"].enabled {
border-bottom: 1px solid #e7e7e7;
z-index: 50;
}
/* account for shift of controls bar due to app navigation */
#body-user #controls,
#body-settings #controls {
padding-left: 80px;
}
#controls .button,
#controls button,
#controls input[type='submit'],

View File

@ -133,12 +133,6 @@ if($_['passwordChangeSupported']) {
<?php endif; ?>
</form>
<div class="section">
<h2><?php p($l->t('WebDAV'));?></h2>
<code><?php print_unescaped(OC_Helper::linkToRemote('webdav')); ?></code><br />
<em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
</div>
<?php foreach($_['forms'] as $form) {
print_unescaped($form);
};?>