aboutsummaryrefslogtreecommitdiff
path: root/mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua
diff options
context:
space:
mode:
authorRobin Krahl <me@robin-krahl.de>2014-08-31 12:55:51 +0200
committerRobin Krahl <me@robin-krahl.de>2014-08-31 12:55:51 +0200
commitbc05340c84213b2771c012ff42ed2ff5d00974af (patch)
tree518b4a8efebbca7e0f1fdfb80eefd33d50c6c12f /mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua
parent66e62f684ae128955ae2d6fb109bae48006b483b (diff)
downloadLrMediaWiki-bc05340c84213b2771c012ff42ed2ff5d00974af.tar.gz
LrMediaWiki-bc05340c84213b2771c012ff42ed2ff5d00974af.tar.bz2
Fix #11: Add ‘other templates’ field
Diffstat (limited to 'mediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua')
-rwxr-xr-xmediawiki.lrdevplugin/MediaWikiExportServiceProvider.lua19
1 files changed, 17 insertions, 2 deletions
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)
@@ -206,6 +207,19 @@ MediaWikiExportServiceProvider.sectionsForTopOfDialog = function(viewFactory, pr
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(),
+
+ viewFactory:static_text {
title = LOC '$$$/LrMediaWiki/Section/Licensing/Other=Other fields',
},
@@ -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('<!-- description -->', propertyTable.info_source, '<!-- date -->', propertyTable.info_author, propertyTable.info_license, propertyTable.info_other, propertyTable.info_categories, '<!-- per-file categories -->')
+ local wikitext = MediaWikiInterface.buildFileDescription('<!-- description -->', propertyTable.info_source, '<!-- date -->', propertyTable.info_author, propertyTable.info_license, propertyTable.info_templates, propertyTable.info_other, propertyTable.info_categories, '<!-- per-file 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 = '' },
}