From bc05340c84213b2771c012ff42ed2ff5d00974af Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Sun, 31 Aug 2014 12:55:51 +0200 Subject: =?UTF-8?q?Fix=20#11:=20Add=20=E2=80=98other=20templates=E2=80=99?= =?UTF-8?q?=20field?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MediaWikiExportServiceProvider.lua | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua') diff --git a/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua b/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua index 1a984bd..04e783a 100755 --- a/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua +++ b/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua @@ -90,11 +90,12 @@ MediaWikiExportServiceProvider.processRenderedPhotos = function(functionContext, end local author = exportSettings.info_author local license = exportSettings.info_license + local templates = exportSettings.info_templates local other = exportSettings.info_other local categories = exportSettings.info_categories local additionalCategories = photo:getPropertyForPlugin(Info.LrToolkitIdentifier, 'categories') or '' - local fileDescription = MediaWikiInterface.buildFileDescription(description, source, timestamp, author, license, other, categories, additionalCategories) + local fileDescription = MediaWikiInterface.buildFileDescription(description, source, timestamp, author, license, templates, other, categories, additionalCategories) MediaWikiInterface.uploadFile(pathOrMessage, fileDescription) LrFileUtils.delete(pathOrMessage) @@ -202,6 +203,19 @@ MediaWikiExportServiceProvider.sectionsForTopOfDialog = function(viewFactory, pr }, }, + viewFactory:row { + spacing = viewFactory:control_spacing(), + + viewFactory:static_text { + title = LOC '$$$/LrMediaWiki/Section/Licensing/OtherTemplates=Other templates', + }, + + viewFactory:edit_field { + value = bind 'info_templates', + immediate = true, + }, + }, + viewFactory:row { spacing = viewFactory:control_spacing(), @@ -240,7 +254,7 @@ MediaWikiExportServiceProvider.sectionsForTopOfDialog = function(viewFactory, pr viewFactory:push_button { title = LOC '$$$/LrMediaWiki/Section/Licensing/Preview=Preview generated wikitext', action = function(button) - local wikitext = MediaWikiInterface.buildFileDescription('', propertyTable.info_source, '', propertyTable.info_author, propertyTable.info_license, propertyTable.info_other, propertyTable.info_categories, '') + local wikitext = MediaWikiInterface.buildFileDescription('', propertyTable.info_source, '', propertyTable.info_author, propertyTable.info_license, propertyTable.info_templates, propertyTable.info_other, propertyTable.info_categories, '') LrDialogs.message(LOC '$$$/LrMediaWiki/Section/Licensing/Preview=Preview generated wikitext', wikitext, 'info') end, }, @@ -266,6 +280,7 @@ MediaWikiExportServiceProvider.exportPresetFields = { { key = 'info_source', default = '{{own}}' }, { key = 'info_author', default = '' }, { key = 'info_license', default = '{{Cc-by-sa-4.0}}' }, + { key = 'info_templates', default = '' }, { key = 'info_other', default = '' }, { key = 'info_categories', default = '' }, } -- cgit v1.2.1