docs/docs-web/src/main/webapp/src/partial/docs/document.html
2018-02-27 19:02:23 +01:00

207 lines
11 KiB
HTML

<script type="text/ng-template" id="tag-tree-item">
<span class="btn" ng-style="{ 'background-color': tag.color }"></span>
<span class="btn btn-link" ng-click="setSearch('tag:' + tag.name)">
{{ tag.name }}
</span>
<ul class="list-unstyled">
<li ng-repeat="tag in getChildrenTags(tag.id)" ng-include="'tag-tree-item'"></li>
</ul>
</script>
<div class="row">
<div class="col-md-4">
<div class="well well-3d">
<div class="text-center mb-19">
<div class="btn-group" uib-dropdown>
<a href="#/document/add" class="btn btn-primary">
<span class="glyphicon glyphicon-plus"></span> {{ 'document.add_document' | translate }}
</a>
<button type="button" class="btn btn-primary" uib-dropdown-toggle>
<span class="caret"></span>
</button>
<ul uib-dropdown-menu>
<li><a href ngf-select="importEml($file)">{{ 'document.import_eml' | translate }}</a></li>
</ul>
</div>
</div>
<div class="row search-dropdown-anchor">
<div class="col-xs-2 tag-tree-dropdown" uib-dropdown>
<button class="btn btn-block btn-default" uib-dropdown-toggle ng-disabled="disabled">
{{ 'document.tags' | translate }} <span class="caret"></span>
</button>
<ul uib-dropdown-menu class="tag-tree">
<li ng-if="getChildrenTags().length == 0">{{ 'document.no_tags' | translate }}</li>
<li ng-repeat="tag in getChildrenTags()" ng-include="'tag-tree-item'"></li>
</ul>
</div>
<div class="col-xs-10 input-group">
<input type="search" class="form-control" ng-attr-placeholder="{{ 'document.search' | translate }}" ng-model="search" />
<span class="input-group-addon pointer" ng-click="openSearch()">
<div uib-dropdown
auto-close="disabled" is-open="searchOpened" dropdown-append-to="searchDropdownAnchor">
<span class="btn-open-search">
<span class="glyphicon glyphicon-search"></span>
<span class="caret"></span>
</span>
<div uib-dropdown-menu class="search-dropdown-menu col-xs-12" ng-click="$event.stopPropagation()">
<form class="form-horizontal" name="searchForm" novalidate>
<div class="form-group">
<label class="control-label sr-only" for="inputSearchSimple">{{ 'document.search_simple' | translate }}</label>
<div class="col-sm-12">
<input type="text" id="inputSearchSimple" class="form-control" ng-attr-placeholder="{{ 'document.search_simple' | translate }}" ng-model="advsearch.search_simple" />
</div>
</div>
<div class="form-group">
<label class="control-label sr-only" for="inputSearchFulltext">{{ 'document.search_fulltext' | translate }}</label>
<div class="col-sm-12">
<input type="text" id="inputSearchFulltext" class="form-control" ng-attr-placeholder="{{ 'document.search_fulltext' | translate }}" ng-model="advsearch.search_fulltext" />
</div>
</div>
<div class="form-group">
<label class="control-label sr-only" for="inputSearchCreator">{{ 'document.search_creator' | translate }}</label>
<div class="col-sm-12">
<input type="text" id="inputSearchCreator" class="form-control" ng-model="advsearch.creator"
ng-attr-placeholder="{{ 'document.search_creator' | translate }}"
uib-typeahead="user for user in getUserTypeahead($viewValue)"
typeahead-wait-ms="200" typeahead-editable="false" autocomplete="off" />
</div>
</div>
<div class="form-group">
<label class="control-label sr-only" for="inputSearchLanguage">{{ 'document.search_language' | translate }}</label>
<div class="col-sm-12">
<select class="form-control" id="inputSearchLanguage" ng-model="advsearch.language">
<option value="">{{ 'document.any_language' | translate }}</option>
<option ng-repeat="language in acceptedLanguages" value="{{ language.key }}">{{ language.label }}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="control-label sr-only" for="inputSearchAfterDate">{{ 'document.search_after_date' | translate }}</label>
<div class="col-sm-12">
<input type="text" id="inputSearchAfterDate"
ng-attr-placeholder="{{ 'document.search_after_date' | translate }}"
current-text="{{ 'directive.datepicker.current' | translate }}"
clear-text="{{ 'directive.datepicker.clear' | translate }}"
close-text="{{ 'directive.datepicker.close' | translate }}"
datepicker-append-to-body="true"
ng-readonly="true" uib-datepicker-popup="{{ dateFormat }}" class="form-control"
ng-model="advsearch.after_date" datepicker-options="{ startingDay:1, showWeeks: false }"
ng-click="datepickerAfterOpened = !datepickerAfterOpened" is-open="datepickerAfterOpened" />
</div>
</div>
<div class="form-group">
<label class="control-label sr-only" for="inputSearchBeforeDate">{{ 'document.search_before_date' | translate }}</label>
<div class="col-sm-12">
<input type="text" id="inputSearchBeforeDate"
ng-attr-placeholder="{{ 'document.search_before_date' | translate }}"
current-text="{{ 'directive.datepicker.current' | translate }}"
clear-text="{{ 'directive.datepicker.clear' | translate }}"
close-text="{{ 'directive.datepicker.close' | translate }}"
datepicker-append-to-body="true"
ng-readonly="true" uib-datepicker-popup="{{ dateFormat }}" class="form-control"
ng-model="advsearch.before_date" datepicker-options="{ startingDay:1, showWeeks: false }"
ng-click="datepickerBeforeOpened = !datepickerBeforeOpened" is-open="datepickerBeforeOpened" />
</div>
</div>
<div class="form-group">
<label class="control-label sr-only" for="inputSearchTags">{{ 'document.search_tags' | translate }}</label>
<div class="col-sm-12">
<select-tag tags="advsearch.tags" ref="inputSearchTags"></select-tag>
</div>
</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 }}
</button>
<button class="btn" ng-click="clearSearch()">
{{ 'document.search_clear' | translate }}
</button>
</div>
</form>
</div>
</div>
</span>
</div>
</div>
<table class="row table table-hover table-documents">
<thead>
<tr>
<th class="col-xs-6" ng-click="sortDocuments(1)">{{ 'document.title' | translate }} <span class="glyphicon glyphicon-chevron-{{ sortColumn == 1 ? (asc ? 'down' : 'up') : '' }}"></span></th>
<th class="col-xs-3" ng-click="sortDocuments(3)">{{ 'document.creation_date' | translate }} <span class="glyphicon glyphicon-chevron-{{ sortColumn == 3 ? (asc ? 'down' : 'up') : '' }}"></span></th>
</tr>
</thead>
<tbody>
<tr ng-if="!documents">
<td colspan="2" class="text-center">
<img src="img/loader.gif" />
</td>
</tr>
<tr ng-if="totalDocuments == 0">
<td colspan="2" class="text-center">
<span ng-if="search.length == 0">{{ 'document.no_documents' | translate }}</span>
<span ng-if="search.length > 0" translate="document.search_empty" translate-values="{ search: search }"></span>
</td>
</tr>
<tr ng-click="viewDocument(document.id)" ng-repeat="document in documents" ng-class="{ active: $stateParams.id == document.id }">
<td colspan="2">
{{ document.title }} ({{ document.file_count }})
<span class="glyphicon glyphicon-share" ng-if="document.shared" uib-tooltip="{{ 'document.shared' | 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>
<div class="tags small">
<span class="label label-info" ng-repeat="tag in document.tags" ng-style="{ 'background': tag.color }">
{{ tag.name }}
</span>
</div>
</td>
</tr>
</tbody>
</table>
<div class="text-center pagination-box">
<ul uib-pagination
ng-if="paginationShown"
previous-text="{{ 'pagination.previous' | translate }}"
next-text="{{ 'pagination.next' | translate }}"
first-text="{{ 'pagination.first' | translate }}"
last-text="{{ 'pagination.last' | translate }}"
total-items="totalDocuments" items-per-page="$parent.limit" max-size="5" ng-model="$parent.currentPage"></ul>
<label class="sr-only" for="pagesizeSelect">{{ 'document.page_size' | translate }}</label>
<select ng-model="limit" id="pagesizeSelect" class="form-control">
<option value="10">{{ 'document.page_size_10' | translate }}</option>
<option value="20">{{ 'document.page_size_20' | translate }}</option>
<option value="30">{{ 'document.page_size_30' | translate }}</option>
</select>
</div>
<div class="pull-left" title="{{ 'document.upgrade_quota' | translate }}"
translate="document.quota"
translate-values="{ current: userInfo.storage_current / 1000000, percent: userInfo.storage_current / userInfo.storage_quota * 100, total: userInfo.storage_quota / 1000000 }">
</div>
<div class="text-right" >
<span ng-if="totalDocuments" translate="document.count" translate-values="{ count: totalDocuments }"></span>
<span ng-if="!totalDocuments">&nbsp;</span>
</div>
</div>
</div>
<div class="col-md-8">
<div ui-view="document"></div>
</div>
</div>