-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathnuxeo-collapsible-document-page.js
More file actions
140 lines (119 loc) · 4.37 KB
/
Copy pathnuxeo-collapsible-document-page.js
File metadata and controls
140 lines (119 loc) · 4.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/**
@license
©2023 Hyland Software, Inc. and its affiliates. All rights reserved.
All Hyland product names are registered or unregistered trademarks of Hyland Software, Inc. or its affiliates.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import '@polymer/polymer/polymer-legacy.js';
import '@polymer/paper-icon-button/paper-icon-button.js';
import { LayoutBehavior } from '@nuxeo/nuxeo-ui-elements/nuxeo-layout-behavior.js';
import '@nuxeo/nuxeo-ui-elements/widgets/nuxeo-tag-suggestion.js';
import '@nuxeo/nuxeo-ui-elements/widgets/nuxeo-card.js';
import '../nuxeo-document-info-bar/nuxeo-document-info-bar.js';
import '../nuxeo-document-info/nuxeo-document-info.js';
import '../nuxeo-collections/nuxeo-document-collections.js';
import '../nuxeo-document-activity/nuxeo-document-activity.js';
import './nuxeo-document-view.js';
import './nuxeo-document-metadata.js';
import { Polymer } from '@polymer/polymer/lib/legacy/polymer-fn.js';
import { html } from '@polymer/polymer/lib/utils/html-tag.js';
/**
`nuxeo-collapsible-document-page`
@group Nuxeo UI
@element nuxeo-collapsible-document-page
*/
Polymer({
_template: html`
<style include="nuxeo-styles">
.page {
@apply --layout-vertical;
background-color: var(--nuxeo-app-header-background);
padding: 16px;
}
#detailsCard {
border-bottom: 1px solid var(--divider-color);
box-shadow: none;
}
.details {
@apply --layout-horizontal;
@apply --layout-wrap;
@apply --layout-justified;
}
.details .section {
@apply --layout-flex;
margin: 16px;
min-width: 256px;
max-width: 320px;
}
paper-icon-button {
@apply --nuxeo-action;
}
paper-icon-button:hover {
@apply --nuxeo-action-hover;
}
nuxeo-document-view {
--nuxeo-document-content-height: calc(100vh - 237px - var(--nuxeo-app-top));
}
</style>
<nuxeo-document-info-bar document="[[document]]"></nuxeo-document-info-bar>
<div class="page">
<nuxeo-card id="detailsCard" heading="[[i18n('documentPage.details')]]" collapsible>
<div class="details">
<div class="section">
<h5>[[i18n('documentPage.info')]]</h5>
<nuxeo-document-info document="[[document]]"></nuxeo-document-info>
</div>
<!-- metadata -->
<div class="section">
<h5>[[i18n('documentPage.metadata')]]</h5>
<nuxeo-document-metadata document="[[document]]"></nuxeo-document-metadata>
</div>
<!-- collections -->
<div class="section" hidden$="[[!_hasCollections(document)]]">
<h5>[[i18n('documentPage.collections')]]</h5>
<nuxeo-document-collections document="[[document]]"></nuxeo-document-collections>
</div>
<!-- tags -->
<template is="dom-if" if="[[hasFacet(document, 'NXTag')]]">
<div class="section">
<h5>[[i18n('documentPage.tags')]]</h5>
<nuxeo-tag-suggestion
document="[[document]]"
allow-new-tags
placeholder="[[i18n('documentPage.tags.placeholder')]]"
readonly="[[!hasPermission(document, 'WriteProperties')]]"
>
</nuxeo-tag-suggestion>
</div>
</template>
<!-- activity -->
<div class="section">
<h5>[[i18n('documentPage.activity')]]</h5>
<nuxeo-document-activity document="[[document]]"></nuxeo-document-activity>
</div>
</div>
</nuxeo-card>
<div class="main">
<nuxeo-document-view document="[[document]]"></nuxeo-document-view>
</div>
</div>
`,
is: 'nuxeo-collapsible-document-page',
behaviors: [LayoutBehavior],
properties: {
document: {
type: Object,
},
},
_hasCollections(doc) {
return this.hasCollections(doc);
},
});