[%# View a list of your uploaded media Authors: Afuna Copyright (c) 2015 by Dreamwidth Studios, LLC. This program is free software; you may redistribute it and/or modify it under the same terms as Perl itself. For a copy of the license, please reference 'perldoc perlartistic' or 'perldoc perlgpl'. %] [% sections.title = '.title2' | ml %] [%- CALL dw.active_resource_group( "foundation" ) -%] [% dw.need_res( { group => "foundation" } "stc/media.css" ) %] [% sections.head = BLOCK %] [% END # sections.head %] [%- IF adminmode %]

[% form.textbox( maxlength = site.maxlength_user, size = site.maxlength_user, label = dw.ml( '.user' ), name = 'user', value = user ); form.submit( value = dw.ml( '.user.submit' ) ) %]

[%- END %] [%- IF user -%]

[% '.intro.admin' | ml(user => user) %]

[%- ELSE -%]

[% '.intro2' | ml(aopts1 => '/file/edit', aopts2 => '/file/new') %]

[% '.usage' | ml( usage => usage, percentage => percentage, quota => quota ) %]

[%- END -%] [% IF media.size %]

[% IF view_type == 'grid' %] [% '.view.list' | ml %] | [% '.view.grid' | ml %] [% ELSE %] [% '.view.list' | ml %] | [% '.view.grid' | ml %] [% END %]

[% IF maxpage > 1 %]
[%- INCLUDE components/pagination.tt current => page, total_pages => maxpage, -%]
[% END %] [% first_index = (page - 1) * 20 %] [% last_index = page * 20 - 1 < media.size ? page * 20 - 1 : media.max %] [% media_page = media.slice(first_index, last_index) %] [% IF view_type == 'grid' %] [% ELSE %]
[%- FOREACH obj IN media_page -%]
[% obj.prop(
[% obj.prop('title') != '' ? obj.prop('title') : obj.displayid _ "." _ obj.ext %]
[% convert_time(obj.logtime, "1") %] UTC
[% obj.orig_filesize / 1000 | format('%d') %] kb | [% obj.orig_width %] x [% obj.orig_height %] px
[% IF obj.prop('description') != '' %]
[% obj.prop('description') %]
[% END %]
[%- INCLUDE 'media/field-row.tt' label = dw.ml(".embed.full") id = "embed-full-$obj.displayid" value = make_embed_url(obj) type="text" labelSize=3 %]
[%- form.textbox( id = "embed-thumb-$obj.displayid" value = make_embed_url(obj, 'type', 'thumbnail', 'size', 100)) -%]
[%- END -%]
[% END %] [% IF maxpage > 1 %]
[%- INCLUDE components/pagination.tt current => page, total_pages => maxpage, -%]
[% END %] [% END %]