mirror of
https://github.com/sismics/docs.git
synced 2025-12-27 16:41:39 +00:00
Closes #192: workflow active info + search criteria
This commit is contained in:
@@ -333,6 +333,7 @@ public class DocumentResource extends BaseResource {
|
||||
* @apiSuccess {Number} documents.create_date Create date (timestamp)
|
||||
* @apiSuccess {String} documents.language Language
|
||||
* @apiSuccess {Boolean} documents.shared True if the document is shared
|
||||
* @apiSuccess {Boolean} documents.active_route True if a route is active on this document
|
||||
* @apiSuccess {Number} documents.file_count Number of files in this document
|
||||
* @apiSuccess {Object[]} documents.tags List of tags
|
||||
* @apiSuccess {String} documents.tags.id ID
|
||||
@@ -397,6 +398,7 @@ public class DocumentResource extends BaseResource {
|
||||
.add("create_date", documentDto.getCreateTimestamp())
|
||||
.add("language", documentDto.getLanguage())
|
||||
.add("shared", documentDto.getShared())
|
||||
.add("active_route", documentDto.isActiveRoute())
|
||||
.add("file_count", documentDto.getFileCount())
|
||||
.add("tags", tags));
|
||||
}
|
||||
@@ -514,6 +516,12 @@ public class DocumentResource extends BaseResource {
|
||||
documentCriteria.setCreatorId(user.getId());
|
||||
}
|
||||
break;
|
||||
case "workflow":
|
||||
// New shared state criteria
|
||||
if (params[1].equals("me")) {
|
||||
documentCriteria.setActiveRoute(true);
|
||||
}
|
||||
break;
|
||||
case "full":
|
||||
// New full content search criteria
|
||||
fullQuery.add(params[1]);
|
||||
|
||||
@@ -200,6 +200,12 @@ angular.module('docs').controller('Document', function ($scope, $rootScope, $tim
|
||||
return s + 'tag:' + t.name + ' ';
|
||||
}, '');
|
||||
}
|
||||
if ($scope.advsearch.shared) {
|
||||
search += 'shared:yes ';
|
||||
}
|
||||
if ($scope.advsearch.workflow) {
|
||||
search += 'workflow:me ';
|
||||
}
|
||||
$scope.search = search;
|
||||
$scope.searchOpened = false;
|
||||
};
|
||||
|
||||
@@ -167,7 +167,7 @@
|
||||
</div>
|
||||
|
||||
<div class="row" ng-controller="Footer">
|
||||
<div class="col-md-12 footer text-center text-muted">
|
||||
<div class="col-md-12 footer text-center text-muted small">
|
||||
<div class="alert alert-danger" ng-show="app.global_storage_quota && app.global_storage_quota * 0.8 < app.global_storage_current"
|
||||
translate="index.global_quota_warning"
|
||||
translate-values="{ current: app.global_storage_current / 1000000, percent: app.global_storage_current / app.global_storage_quota * 100, total: app.global_storage_quota / 1000000 }">
|
||||
|
||||
@@ -46,6 +46,8 @@
|
||||
"search_before_date": "Before this date",
|
||||
"search_after_date": "After this date",
|
||||
"search_tags": "Tags",
|
||||
"search_shared": "Only shared documents",
|
||||
"search_workflow": "Workflow assigned to me",
|
||||
"search_clear": "Clear",
|
||||
"any_language": "Any language",
|
||||
"add_document": "Add a document",
|
||||
@@ -56,6 +58,7 @@
|
||||
"search": "Search",
|
||||
"search_empty": "No matches for <strong>\"{{ search }}\"</strong>",
|
||||
"shared": "Shared",
|
||||
"active_route": "Workflow assigned to me",
|
||||
"title": "Title",
|
||||
"description": "Description",
|
||||
"contributors": "Contributors",
|
||||
|
||||
@@ -118,6 +118,18 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="advsearch.shared"> {{ 'document.search_shared' | translate }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" ng-model="advsearch.workflow"> {{ 'document.search_workflow' | translate }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="form-group text-center">
|
||||
<button type="submit" ng-click="startSearch()" class="btn btn-primary">
|
||||
<span class="glyphicon glyphicon-search"></span> {{ 'document.search' | translate }}
|
||||
@@ -158,6 +170,7 @@
|
||||
<td colspan="2">
|
||||
{{ document.title }} ({{ document.file_count }})
|
||||
<span class="glyphicon glyphicon-share" ng-if="document.shared" uib-tooltip="{{ 'document.shared' | translate }}"></span>
|
||||
<span class="glyphicon glyphicon-random" ng-if="document.active_route" uib-tooltip="{{ 'document.active_route' | translate }}"></span>
|
||||
<a href="#/document/view/{{ document.id }}" target="_blank" ng-click="$event.stopPropagation()"><span class="glyphicon glyphicon-link"></span></a>
|
||||
|
||||
<div class="pull-right text-muted small">{{ document.create_date | timeAgo: dateFormat }}</div>
|
||||
|
||||
Reference in New Issue
Block a user