3434 name =" custom-classes-transition"
3535 tag =" ul" >
3636 <li v-for =" link in $_links" :key =" 'li-' + link.id" >
37- <oc-table midldle class =" files-file-links-link" >
38- <oc-table-row class =" files-file-links-link-table-row-info" >
39- <oc-table-cell shrink >
40- <oc-button :aria-label =" $_deleteButtonLabel" @click =" $_removePublicLink(link)" variation =" raw" class =" oc-files-file-link-delete" >
41- <oc-icon name =" close" />
42- </oc-button >
43- </oc-table-cell >
44- <oc-table-cell >
45- <a :href =" link.url" target =" _blank" :uk-tooltip =" $_tooltipTextLink" class =" uk-text-bold uk-text-truncate oc-files-file-link-url" >{{ link.name }}</a >
46- <br >
47- <span class =" uk-text-meta uk-text-break" >
48- <span class =" oc-files-file-link-role" >{{ link.description }}</span >
49- <template v-if =" link .expiration " > |
50- <span v-translate >Expires</span > {{ formDateFromNow(link.expiration) }}
51- </template >
52- <template v-if =" link .password " > |
53- <span v-translate >Password protected</span >
54- </template >
55- </span >
56- </oc-table-cell >
57- <oc-table-cell shrink class =" uk-text-nowrap" >
58- <oc-button :aria-label =" $_publicLinkCopyLabel" variation =" raw" class =" oc-files-file-link-copy-url" >
59- <oc-icon v-if =" !linksCopied[link.url]" name =" copy_to_clipboard" size =" small"
60- v-clipboard:copy =" link.url" v-clipboard:success =" $_clipboardSuccessHandler" />
61- <oc-icon v-else name =" ready" size =" small" class =" oc-files-file-link-copied-url _clipboard-success-animation" />
62- </oc-button >
63- <oc-button :aria-label =" $_editButtonLabel" @click =" $_editPublicLink(link)" variation =" raw" class =" oc-files-file-link-edit" >
64- <oc-icon name =" edit" size =" small" />
65- </oc-button >
66- </oc-table-cell >
67- </oc-table-row >
68- </oc-table >
37+ <public-link-list-item :link =" link"
38+ :modifiable =" true"
39+ :indirect =" false"
40+ :linksCopied =" linksCopied"
41+ @onCopy =" $_clipboardSuccessHandler"
42+ @onDelete =" $_removePublicLink"
43+ @onEdit =" $_editPublicLink" />
6944 </li >
7045 </transition-group >
7146 </section >
72- <section v-if =" $_indirectLinks.length > 0" class =" uk-margin-medium-bottom " >
47+ <section v-if =" $_indirectLinks.length > 0" class =" uk-margin-medium-top " >
7348 <div class =" uk-text-bold" >
7449 <translate >Public Links Via Parent</translate >
7550 </div >
7954 name =" custom-classes-transition"
8055 tag =" ul" >
8156 <li v-for =" link in $_indirectLinks" :key =" 'li-' + link.id" >
82- <div class =" uk-text-meta" >
83- <router-link :to =" $_getViaRouterParams(link)" :aria-label =" $gettext('Navigate to parent')"
84- class =" oc-files-file-link-via uk-flex uk-flex-middle" >
85- <oc-icon name =" exit_to_app" size =" small" class =" uk-preserve-width" />
86- <span class =" oc-file-name uk-padding-remove uk-text-truncate files-collaborators-collaborator-via-label" >{{ $_getViaLabel(link) }}</span >
87- </router-link >
88- </div >
89- <oc-table midldle class =" files-file-links-link" >
90- <oc-table-row class =" files-file-links-link-table-row-info" >
91- <oc-table-cell shrink >
92- <oc-icon name =" lock" />
93- </oc-table-cell >
94- <oc-table-cell >
95- <a :href =" link.url" target =" _blank" :uk-tooltip =" $_tooltipTextLink" class =" uk-text-bold uk-text-truncate oc-files-file-link-url" >{{ link.name }}</a >
96- <br >
97- <span class =" uk-text-meta uk-text-break" >
98- <span class =" oc-files-file-link-role" >{{ link.description }}</span >
99- <template v-if =" link .expiration " > |
100- <span v-translate >Expires</span > {{ formDateFromNow(link.expiration) }}
101- </template >
102- <template v-if =" link .password " > |
103- <span v-translate >Password protected</span >
104- </template >
105- </span >
106- </oc-table-cell >
107- <oc-table-cell shrink class =" uk-text-nowrap" >
108- <oc-button :aria-label =" $_publicLinkCopyLabel" variation =" raw" class =" oc-files-file-link-copy-url" >
109- <oc-icon v-if =" !linksCopied[link.url]" name =" copy_to_clipboard" size =" small"
110- v-clipboard:copy =" link.url" v-clipboard:success =" $_clipboardSuccessHandler" />
111- <oc-icon v-else name =" ready" size =" small" class =" oc-files-file-link-copied-url _clipboard-success-animation" />
112- </oc-button >
113- <oc-button :aria-label =" $_editButtonLabel" @click =" $_editPublicLink(link)" variation =" raw" class =" oc-files-file-link-edit" >
114- <oc-icon name =" edit" size =" small" />
115- </oc-button >
116- </oc-table-cell >
117- </oc-table-row >
118- </oc-table >
57+ <public-link-list-item :link =" link"
58+ :modifiable =" false"
59+ :indirect =" true"
60+ :linksCopied =" linksCopied"
61+ @onCopy =" $_clipboardSuccessHandler" />
11962 </li >
12063 </transition-group >
12164 </section >
@@ -137,18 +80,19 @@ import { mapGetters, mapActions, mapState } from 'vuex'
13780import moment from ' moment'
13881import mixins from ' ../mixins'
13982import { shareTypes } from ' ../helpers/shareTypes'
140- import { basename , dirname } from ' path'
14183import { getParentPaths } from ' ../helpers/path'
14284
14385const EditPublicLink = _ => import (' ./PublicLinksSidebar/EditPublicLink.vue' )
86+ const PublicLinkListItem = _ => import (' ./PublicLinksSidebar/PublicLinkListItem.vue' )
14487
14588const PANEL_SHOW = ' showLinks'
14689const PANEL_EDIT = ' editPublicLink'
14790
14891export default {
14992 mixins: [mixins],
15093 components: {
151- EditPublicLink
94+ EditPublicLink,
95+ PublicLinkListItem
15296 },
15397 title : ($gettext ) => {
15498 return $gettext (' Links' )
@@ -242,21 +186,9 @@ export default {
242186 enforced: expireDate .enforced === ' 1'
243187 }
244188 },
245- $_tooltipTextLink () {
246- return ` title: ${ this .$gettext (' Click to open the link' )} ; pos: bottom`
247- },
248189 $_addButtonLabel () {
249190 return this .$gettext (' Add public link' )
250191 },
251- $_deleteButtonLabel () {
252- return this .$gettext (' Delete public link' )
253- },
254- $_editButtonLabel () {
255- return this .$gettext (' Edit public link' )
256- },
257- $_publicLinkCopyLabel () {
258- return this .$gettext (' Copy public link url' )
259- },
260192 $_privateLinkCopyLabel () {
261193 return this .$gettext (' Copy private link url' )
262194 },
@@ -282,22 +214,6 @@ export default {
282214 expireDate: (this .$_expirationDate .days ) ? moment ().add (this .$_expirationDate .days , ' days' ).endOf (' day' ).toISOString () : null
283215 }
284216 },
285- $_getViaLabel (link) {
286- const translated = this .$gettext (' Via %{folderName}' )
287- return this .$gettextInterpolate (translated, { folderName: basename (link .info .path ) }, false )
288- },
289- $_getViaRouterParams (link) {
290- const viaPath = link .info .path
291- return {
292- name: ' files-list' ,
293- params: {
294- item: dirname (viaPath) || ' /'
295- },
296- query: {
297- scrollTo: basename (viaPath)
298- }
299- }
300- },
301217 $_removePublicLink (link) {
302218 this .removeLink ({
303219 client: this .$client ,
@@ -351,12 +267,6 @@ export default {
351267 }
352268 }
353269 </style >
354- <style scoped="scoped">
355- /* FIXME: Move to ODS somehow */
356- .files-file-links-link-table-row-info > td {
357- padding : 0 10px 0 0 ;
358- }
359- </style >
360270<style >
361271 /* FIXME: Move to design system (copied from FileSharingSidebar.vue) */
362272 .oc-app-side-bar .oc-label {
0 commit comments