Skip to content

Commit

Permalink
pkp/pkp-lib#988 Support the new single file upload component
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWr authored and asmecher committed Feb 22, 2016
1 parent 44a9264 commit c06f070
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 13 deletions.
2 changes: 1 addition & 1 deletion plugins/importexport/users/templates/index.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<input type="hidden" name="temporaryFileId" id="temporaryFileId" value="" />
{fbvFormArea id="file"}
{fbvFormSection title="common.file"}
<div id="plupload"></div>
{include file="controllers/fileUploadContainer.tpl" id="plupload"}
{/fbvFormSection}
{/fbvFormArea}

Expand Down
20 changes: 12 additions & 8 deletions templates/controllers/grid/issueGalleys/form/issueGalleyForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,24 @@
</script>
<form class="pkp_form" id="issueGalleyForm" method="post" action="{url op="update" issueId=$issueId issueGalleyId=$issueGalleyId}">
{fbvFormArea id="file"}
{fbvFormSection title="editor.issues.galley"}
<div id="plupload"></div>
{fbvFormSection title="editor.issues.galley" required="true"}
{include file="controllers/fileUploadContainer.tpl" id="plupload"}
<input type="hidden" name="temporaryFileId" id="temporaryFileId" value="" />
{if $issueGalley}
<a href="{url op="download" issueId=$issueId issueGalleyId=$issueGalleyId}" target="_blank">{$issueGalley->getOriginalFileName()|escape}</a>
{/if}
{/fbvFormSection}

{fbvFormSection title="submission.layout.galleyFileData"}
{fbvElement type="text" label="submission.layout.galleyLabel" value=$label id="label"}
{if $enablePublicGalleyId}
{fbvElement type="text" label="submission.layout.publicGalleyId" value=$publicGalleyId id="publicGalleyId" size=$fbvStyles.size.MEDIUM}
{/if}
{fbvElement type="select" id="galleyLocale" label="common.language" from=$supportedLocales selected=$galleyLocale|default:$formLocale size=$fbvStyles.size.MEDIUM translate=false}
{fbvFormSection title="submission.layout.galleyLabel" required="true"}
{fbvElement type="text" value=$label id="label"}
{/fbvFormSection}
{if $enablePublicGalleyId}
{fbvFormSection title="submission.layout.publicGalleyId" required="true"}
{fbvElement type="text" value=$publicGalleyId id="publicGalleyId"}
{/fbvFormSection}
{/if}
{fbvFormSection title="common.language" required="true"}
{fbvElement type="select" id="galleyLocale" from=$supportedLocales selected=$galleyLocale|default:$formLocale translate=false}
{/fbvFormSection}
{/fbvFormArea}

Expand Down
11 changes: 9 additions & 2 deletions templates/controllers/grid/issues/form/coverForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
$uploader: $('#pluploadimage'),
uploaderOptions: {ldelim}
uploadUrl: {url|json_encode op="uploadFile" escape=false},
baseUrl: {$baseUrl|json_encode}
baseUrl: {$baseUrl|json_encode},
filters: {ldelim}
mime_types : [
{ldelim} title : "Image files", extensions : "jpg,jpeg,png" {rdelim}
]
{rdelim}
{rdelim}
{rdelim}
);
Expand All @@ -31,11 +36,13 @@
{/fbvFormArea}
{fbvFormArea id="coverFile"}
{fbvFormSection title="editor.issues.coverPage"}
<div id="pluploadimage"></div>
{include file="controllers/fileUploadContainer.tpl" id="pluploadimage"}
<input type="hidden" name="temporaryFileId" id="temporaryFileId" value="" />
{if $fileName.$formLocale}
<img src="{$publicFilesDir}/{$fileName.$formLocale|escape}?random=$issueId|uniqid}" alt="{$coverPageAltText.$formLocale|escape}"/>
{/if}
{/fbvFormSection}
{fbvFormSection}
{fbvElement type="text" id="coverPageAltText" label="common.altText" value=$coverPageAltText multilingual=true size=$fbvStyles.size.MEDIUM}
{/fbvFormSection}
{/fbvFormArea}
Expand Down
11 changes: 9 additions & 2 deletions templates/controllers/grid/issues/form/issueForm.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
$uploader: $('#pluploadcss'),
uploaderOptions: {ldelim}
uploadUrl: {url|json_encode op="uploadFile" escape=false},
baseUrl: {$baseUrl|json_encode}
baseUrl: {$baseUrl|json_encode},
filters: {ldelim}
mime_types : [
{ldelim} title : "CSS files", extensions : "css" {rdelim}
]
{rdelim}
{rdelim}
{rdelim}
);
Expand Down Expand Up @@ -72,7 +77,9 @@

{fbvFormArea id="file"}
{fbvFormSection title="editor.issues.styleFile"}
<div id="pluploadcss"></div>
{include file="controllers/fileUploadContainer.tpl" id="pluploadcss"}
{/fbvFormSection}
{fbvFormSection}
{if $styleFileName}
{translate key="common.currentStyleSheet"}: <a href="{$publicFilesDir}/{$styleFileName|escape}" target="_blank">{$originalStyleFileName|escape}</a>
{/if}
Expand Down

0 comments on commit c06f070

Please sign in to comment.