-
Notifications
You must be signed in to change notification settings - Fork 60
/
nuxeo-document-page.html
176 lines (146 loc) · 4.85 KB
/
nuxeo-document-page.html
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<!--
@license
(C) Copyright Nuxeo Corp. (http://nuxeo.com/)
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.
-->
<link rel="import" href="../../bower_components/polymer/polymer.html">
<link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
<link rel="import" href="../../bower_components/nuxeo-ui-elements/nuxeo-layout-behavior.html">
<link rel="import" href="../../bower_components/nuxeo-ui-elements/widgets/nuxeo-tag-suggestion.html">
<link rel="import" href="../nuxeo-document-info-bar/nuxeo-document-info-bar.html">
<link rel="import" href="../nuxeo-document-info/nuxeo-document-info.html">
<link rel="import" href="../nuxeo-collections/nuxeo-document-collections.html">
<link rel="import" href="../nuxeo-document-activity/nuxeo-document-activity.html">
<link rel="import" href="nuxeo-document-view.html">
<link rel="import" href="nuxeo-document-metadata.html">
<!--
`nuxeo-document-page`
@group Nuxeo UI
@element nuxeo-document-page
-->
<dom-module id="nuxeo-document-page">
<template>
<style include="nuxeo-styles">
.page {
@apply --layout-horizontal;
}
.page .main {
@apply --layout-vertical;
@apply --layout-flex-2;
padding-right: 1.3rem;
max-width: 65%;
}
.page .side {
@apply --layout-vertical;
@apply --layout-flex;
position: relative;
margin-bottom: 16px;
min-height: 60vh;
}
.scroller {
@apply --nuxeo-card;
margin-bottom: 0;
left: 0;
top: 0;
right: 0;
bottom: 0;
overflow: auto;
position: absolute;
}
.section {
margin-bottom: 32px;
}
@media (max-width: 1024px) {
.page {
flex-direction: column;
}
.page .main {
padding: 0;
margin-bottom: 1rem;
max-width: initial;
}
.page .side {
padding: 0;
margin-bottom: 1rem;
max-width: initial;
display: block !important;
}
.scroller {
position: relative;
}
}
paper-icon-button {
@apply --nuxeo-action;
}
paper-icon-button:hover {
@apply --nuxeo-action-hover;
}
::content nuxeo-document-attachments {
margin-top: 32px;
}
</style>
<nuxeo-document-info-bar document="[[document]]"></nuxeo-document-info-bar>
<div class="page">
<div class="main">
<nuxeo-document-view document="[[document]]"></nuxeo-document-view>
</div>
<div class="side">
<div class="scroller">
<!-- info -->
<div class="section">
<nuxeo-document-info document="[[document]]"></nuxeo-document-info>
</div>
<!-- metadata -->
<div class="section">
<nuxeo-document-metadata document="[[document]]"></nuxeo-document-metadata>
</div>
<!-- collections -->
<div class="section" hidden$="[[!_hasCollections(document)]]">
<h3>[[i18n('documentPage.collections')]]</h3>
<nuxeo-document-collections document="[[document]]"></nuxeo-document-collections>
</div>
<!-- tags -->
<template is="dom-if" if="[[hasFacet(document, 'NXTag')]]">
<div class="section">
<h3>[[i18n('documentPage.tags')]]</h3>
<nuxeo-tag-suggestion document="[[document]]" allow-new-tags
placeholder="[[i18n('documentPage.tags.placeholder')]]"
readonly="[[!hasPermission(document, 'Write')]]">
</nuxeo-tag-suggestion>
</div>
</template>
<!-- activity -->
<div class="section">
<h3>[[i18n('documentPage.activity')]]</h3>
<nuxeo-document-activity document="[[document]]"></nuxeo-document-activity>
</div>
</div>
</div>
</div>
</template>
<script>
Polymer({
is: 'nuxeo-document-page',
behaviors: [Nuxeo.LayoutBehavior],
properties: {
document: {
type: Object
}
},
_isMutable: function(doc) {
return !this.hasFacet(doc, 'Immutable') && doc.type !== 'Root' && doc.state !== 'deleted';
},
_hasCollections: function(doc) {
return this.hasCollections(doc);
}
});
</script>
</dom-module>