filebrowser.tpl 9.79 KB
Newer Older
Naomi Guyer's avatar
Naomi Guyer committed
1 2 3 4
{if $config.select}
{include file="artefact:file:form/selectedlist.tpl" selectedlist=$selectedlist prefix=$prefix highlight=$highlight selectfolders=$config.selectfolders}
{/if}

5
<script type="application/javascript">
Naomi Guyer's avatar
Naomi Guyer committed
6 7 8 9 10 11 12 13
{$initjs|safe}
</script>

<input type="hidden" name="folder" id="{$prefix}_folder" value="{$folder}" />
<input type="hidden" name="{$prefix}_changefolder" id="{$prefix}_changefolder" value="" />
<input type="hidden" name="{$prefix}_foldername" id="{$prefix}_foldername" value="{$foldername}" />

{if $config.select}
14
<div id="{$prefix}_open_upload_browse_container" class="form-condensed">
15

16 17 18 19
    {if $config.selectmodal}
        <div id="{$prefix}_upload_browse" class="filebrowser in-collapsible">
    {else}
        <button type="button" class="btn btn-default" data-toggle="modal" data-target="#{$prefix}_upload_browse">
20
            <span class="icon icon-paperclip icon-lg left" role="presentation" aria-hidden="true"></span>
21 22 23 24
            {str tag=addafile section=artefact.file}
        </button>
        <div id="{$prefix}_upload_browse" class="modal fade js-filebrowser" tabindex="-1" role="dialog" aria-labelledby="" aria-hidden="true">
    {/if}
Naomi Guyer's avatar
Naomi Guyer committed
25

26
{else}
27
    <div id="{$prefix}_upload_browse" class="form-condensed upload_browse select">
Naomi Guyer's avatar
Naomi Guyer committed
28 29
{/if}

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
        {if $config.select && !$config.alwaysopen}
            <button type="button" class="close" data-dismiss="modal">
                <span class="sr-only">{str tag=Close}</span>
                <span aria-hidden="true">&times;</span>
            </button>
        {/if}

        {if $tabs}
            <input type="hidden" name="{$prefix}_owner" id="{$prefix}_owner" value="{$tabs.owner}" />
            <input type="hidden" name="{$prefix}_ownerid" id="{$prefix}_ownerid" value="{$tabs.ownerid}" />
            <input type="hidden" name="{$prefix}_changeowner" id="{$prefix}_changeowner" value="" />

            <div id="{$prefix}_ownertabs">
                {include file="artefact:file:form/ownertabs.tpl" tabs=$tabs prefix=$prefix querybase=$querybase}
            </div>

            <div id="artefactchooser-body">
                <div id="{$prefix}_ownersubtabs" {if !$tabs.subtabs}class="hidden"{/if}>
                {if $tabs.subtabs}
                    {include file="artefact:file:form/ownersubtabs.tpl" tabs=$tabs prefix=$prefix querybase=$querybase}
                {/if}
                </div>
        {/if}

        {if $config.upload}
55 56 57 58 59
        <div id="{$prefix}_upload_container" class="clearfix {if $config.selectone || $config.selectmodal} panel-fake{else} panel panel-default fileupload {/if} {if ($tabs && !$tabs.upload) || $uploaddisabled} hidden{/if}">
            {* config.uploadagreement: disable the file chooser unless the agreement is checked *}
            {* config.simpleupload: the form only contains a file chooser *}
            {* config.submitbutton: add submit button even if js is enabled & don't start uploading as soon as a file is chosen *}

60 61 62 63
            {* config.uploadagreement: disable the file chooser unless the agreement is checked *}
            {* config.simpleupload: the form only contains a file chooser *}
            {* config.submitbutton: add submit button even if js is enabled & don't start uploading as soon as a file is chosen *}

64
            <input type="hidden" name="{$prefix}_uploadnumber" id="{$prefix}_uploadnumber" value="1"/>
65 66
            <input type="hidden" name="MAX_FILE_SIZE" value="{$phpmaxfilesize}" />
            <div id="{$prefix}_upload_messages"></div>
67 68 69 70 71 72 73 74 75 76 77 78
            <h3 class="title">{str tag='uploadfile' section='artefact.file'}</h3>

            <div class="row">
                {if $config.uploadagreement || $licenseform}
                <div class="fileupload-container col-md-6">
                    {if $config.uploadagreement}
                    <div id="{$prefix}_agreement" class="uploadform">
                        <label for="{$prefix}_notice">
                            <input type="checkbox" name="{$prefix}_notice" id="{$prefix}_notice" />
                            {$agreementtext|clean_html|safe}
                        </label>
                    </div>
79
                    {/if}
80 81 82
                    <div class="fileuploadlicense">
                        {$licenseform|safe}
                    </div>
83
                </div>
84
                {/if}
85

86 87 88 89 90 91 92 93 94
                <div class="fileupload-container {if $config.uploadagreement || $licenseform}col-md-6{else}col-md-12{/if}">
                    {if $config.resizeonuploaduseroption}
                    <p id="{$prefix}_resizeonuploaduseroption" class="resize-image">
                        <label>
                            <input type="checkbox" name="{$prefix}_resizeonuploaduserenable" id="{$prefix}_resizeonuploaduserenable" {if $resizeonuploadenable && $config.resizeonuploaduserdefault}checked{/if} />
                            {str tag='resizeonuploadenablefilebrowser1' section='artefact.file' arg1=$resizeonuploadmaxwidth arg2=$resizeonuploadmaxheight}
                        </label>
                        {contextualhelp plugintype='artefact' pluginname='file' form='files_filebrowser' element='resizeonuploaduseroption'}
                    </p>
95 96
                    {/if}

97 98 99 100
                    <div class="uploadform userfile">
                        <label class="lead" for="{$prefix}_userfile">
                            {str tag='File' section='artefact.file'}
                        </label>
101

102 103 104 105 106 107 108 109 110 111 112 113
                        <span id="{$prefix}_userfile_container">
                            <input type="file" class="file"  {$accepts|safe} id="{$prefix}_userfile" name="userfile[]" multiple size="20" />
                        </span>

                        <span id="{$prefix}_userfile_maxuploadsize" class="file-description">
                            ({str tag=maxuploadsize section=artefact.file} {$maxuploadsize})
                        </span>

                        {if $config.uploadagreement}
                            <script>setNodeAttribute('{$prefix}_userfile', 'disabled', true);</script>
                        {/if}
                    </div>
114

115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
                    <div id="file_dropzone_container" class="{$prefix}">
                        <div id="fileDropzone" class="dropzone-previews" style="display:none;">
                            <div class="dz-message">{str tag=dragdrophere section=artefact.file}</div>
                        </div>
                    </div>

                    <div class="uploadform">
                        <div id="{$prefix}_uploadsubmit_container">
                            {* filebrowser.js may add a submit button in here even if config.submitbutton is off *}

                            {if $config.submitbutton}
                                <input type="submit" class="submit nojs-hidden-block" name="{$prefix}_uploadsubmit" id="{$prefix}_uploadsubmit" value="{str tag=upload section=artefact.file}" />
                            {/if}

                            <noscript><input class="submit btn btn-primary" type="submit" name="{$prefix}_upload" id="{$prefix}_upload" value="{str tag=upload section=artefact.file}" /></noscript>
                        </div>
                    </div>
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
                </div>
            </div>
        </div>
        {/if}

        {if $config.upload}
        <div id="{$prefix}_upload_disabled" class="uploaddisabled{if !$uploaddisabled} hidden{/if}">
            {str tag="cannoteditfolder" section=artefact.file}
        </div>
        {/if}

        {if $config.edit}
            <input type="hidden" name="{$prefix}_move" id="{$prefix}_move" value="" />
            <input type="hidden" name="{$prefix}_moveto" id="{$prefix}_moveto" value="" />
        {/if}

        {if $config.createfolder}
            <div id="createfolder" class="{if $uploaddisabled}hidden{/if} form-group">
                <div id="{$prefix}_createfolder_messages"></div>
                <label for="{$prefix}_createfolder_name" class="accessible-hidden sr-only">
                    {str tag=createfolder section=artefact.file}
                </label>
                <span class="input-group">
                    <input type="text" class="text form-control" name="{$prefix}_createfolder_name" id="{$prefix}_createfolder_name" size="40" />
                    <span class="input-group-btn">
                        <button type="submit" class="btn btn-primary" name="{$prefix}_createfolder" id="{$prefix}_createfolder" value="{str tag=createfolder section=artefact.file}">
158
                            <span class="icon icon-folder-open" role="presentation" aria-hidden="true"></span>
159 160 161 162 163 164 165
                            {str tag=createfolder section=artefact.file}
                        </button>
                    </span>
                </span>
            </div>
        {/if}

166 167
        <div class="filelist-wrapper panel panel-secondary">
            <h3 id="{$prefix}_foldernav" class="panel-heading">
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
            {include file="artefact:file:form/folderpath.tpl" path=$path querybase=$querybase owner=$tabs.owner ownerid=$tabs.ownerid}
            </h3>

            <div id="{$prefix}_filelist_container">
                {include file="artefact:file:form/filelist.tpl" prefix=$prefix filelist=$filelist folderdownload=$folderdownload folderparams=$folderparams editable=$config.edit selectable=$config.select highlight=$highlight edit=$edit querybase=$querybase groupinfo=$groupinfo owner=$tabs.owner ownerid=$tabs.ownerid selectfolders=$config.selectfolders showtags=$config.showtags editmeta=$config.editmeta}
            </div>
        </div>

        {* Edit form used when js is available *}
        {if $edit <= 0}
        <table class="hidden">
            <tbody id="{$prefix}_edit_placeholder">
            {include file="artefact:file:form/editfile.tpl" prefix=$prefix groupinfo=$groupinfo}
            </tbody>
        </table>
        {/if}
184
        {include file="pagemodal.tpl"}
185 186 187
    {if $tabs}
    </div>
    {/if}
Naomi Guyer's avatar
Naomi Guyer committed
188
</div>
189
{if $config.select}
Naomi Guyer's avatar
Naomi Guyer committed
190 191
</div>
{/if}