#32 : Comments layout

+ fix file viewer navigation
This commit is contained in:
jendib 2015-11-17 02:48:07 +01:00
parent 9afd52108b
commit c365c6f6e0
5 changed files with 39 additions and 32 deletions

View File

@ -173,6 +173,14 @@ angular.module('docs',
} }
} }
}) })
.state('document.view.content.file', {
url: '/file/:fileId',
views: {
'file': {
controller: 'FileView'
}
}
})
.state('document.view.permissions', { .state('document.view.permissions', {
url: '/permissions', url: '/permissions',
views: { views: {
@ -191,14 +199,6 @@ angular.module('docs',
} }
} }
}) })
.state('document.view.file', {
url: '/file/:fileId',
views: {
'file': {
controller: 'FileView'
}
}
})
.state('login', { .state('login', {
url: '/login', url: '/login',
views: { views: {

View File

@ -38,7 +38,7 @@ angular.module('docs').controller('DocumentViewContent', function ($scope, $stat
* Navigate to the selected file. * Navigate to the selected file.
*/ */
$scope.openFile = function (file) { $scope.openFile = function (file) {
$state.go('document.view.file', { id: $stateParams.id, fileId: file.id }) $state.go('document.view.content.file', { id: $stateParams.id, fileId: file.id })
}; };
/** /**

View File

@ -15,7 +15,7 @@
<a ng-href="#/document/view/{{ log.target }}">{{ log.message }}</a> <a ng-href="#/document/view/{{ log.target }}">{{ log.message }}</a>
</span> </span>
<span ng-switch-when="File"> <span ng-switch-when="File">
<a ng-href="#/document/view/{{ log.message }}/file/{{ log.target }}">Open</a> <a ng-href="#/document/view/{{ log.message }}/content/file/{{ log.target }}">Open</a>
</span> </span>
<span ng-switch-when="Comment"> <span ng-switch-when="Comment">
<a ng-href="#/document/view/{{ log.message }}/comments">See</a> <a ng-href="#/document/view/{{ log.message }}/comments">See</a>

View File

@ -3,7 +3,7 @@
<div ng-file-drop drag-over-class="bg-success" ng-multiple="true" allow-dir="false" ng-model="dropFiles" <div ng-file-drop drag-over-class="bg-success" ng-multiple="true" allow-dir="false" ng-model="dropFiles"
accept="image/*,application/pdf,application/zip" ng-file-change="fileDropped($files, $event, $rejectedFiles)"> accept="image/*,application/pdf,application/zip" ng-file-change="fileDropped($files, $event, $rejectedFiles)">
<div class="row upload-zone" ui-sortable="fileSortableOptions" ng-model="files"> <div class="row upload-zone" ui-sortable="fileSortableOptions" ng-model="files">
<div class="col-xs-6 col-sm-4 col-md-3 col-lg-2 text-center" ng-repeat="file in files"> <div class="col-xs-6 col-sm-4 col-md-4 col-lg-3 text-center" ng-repeat="file in files">
<div class="thumbnail" ng-if="file.id"> <div class="thumbnail" ng-if="file.id">
<a ng-click="openFile(file)"> <a ng-click="openFile(file)">
<img class="thumbnail-file" ng-src="../api/file/{{ file.id }}/data?size=thumb" tooltip="{{ file.mimetype }}" tooltip-placement="top" /> <img class="thumbnail-file" ng-src="../api/file/{{ file.id }}/data?size=thumb" tooltip="{{ file.mimetype }}" tooltip-placement="top" />
@ -34,4 +34,6 @@
Drag &amp; drop files here to upload Drag &amp; drop files here to upload
</p> </p>
</div> </div>
</div> </div>
<div ui-view="file"></div>

View File

@ -38,24 +38,29 @@
</ul> </ul>
</div> </div>
<ul class="nav nav-tabs"> <div class="row">
<li ng-class="{ active: $state.current.name == 'document.view.content' }"> <div class="col-md-9">
<a href="#/document/view/{{ document.id }}/content"> <ul class="nav nav-tabs">
<span class="glyphicon glyphicon-file"></span> Content <li ng-class="{ active: $state.current.name == 'document.view.content' }">
</a> <a href="#/document/view/{{ document.id }}/content">
</li> <span class="glyphicon glyphicon-file"></span> Content
<li ng-class="{ active: $state.current.name == 'document.view.permissions' }"> </a>
<a href="#/document/view/{{ document.id }}/permissions"> </li>
<span class="glyphicon glyphicon-user"></span> Permissions <li ng-class="{ active: $state.current.name == 'document.view.permissions' }">
</a> <a href="#/document/view/{{ document.id }}/permissions">
</li> <span class="glyphicon glyphicon-user"></span> Permissions
<li ng-class="{ active: $state.current.name == 'document.view.activity' }"> </a>
<a href="#/document/view/{{ document.id }}/activity"> </li>
<span class="glyphicon glyphicon-tasks"></span> Activity <li ng-class="{ active: $state.current.name == 'document.view.activity' }">
</a> <a href="#/document/view/{{ document.id }}/activity">
</li> <span class="glyphicon glyphicon-tasks"></span> Activity
</ul> </a>
</li>
<div ui-view="tab"></div> </ul>
<div ui-view="file"></div> <div ui-view="tab"></div>
</div>
<div class="col-md-3">
Comments
</div>
</div>
</div> </div>