|
|
| שורה 143: |
שורה 143: |
| ]] | | ]] |
| function Infobox:renderEditLinks() | | function Infobox:renderEditLinks() |
| local wbEdit='' -- link to wikidata
| |
| if self.args.usingWikidata then
| |
| wbEdit = '[[File:Wikidata-logo S.svg|22px|link=d:'..self.args.entityId..'|לעריכה בוויקינתונים שמשמש מקור לחלק מהמידע בתבנית]]'
| |
| wbEdit = wbEdit .. mw.ustring.format(' [[File:OOjs UI icon info big.svg|16px|link=%s]]', 'עזרה:תבנית מידע')
| |
| end
| |
| if #wbEdit > 0 then
| |
| self.root:tag('tr')
| |
| :tag('td')
| |
| :attr('colspan', 2)
| |
| :css('text-align','left')
| |
| :wikitext(wbEdit)
| |
| end
| |
| end | | end |
|
| |
|
| שורה 259: |
שורה 247: |
| function Infobox:renderInfobox() | | function Infobox:renderInfobox() |
| self:removeEmptyHeaders() | | self:removeEmptyHeaders() |
| -- error if there is no data/structure given to template from wiki page or wikidata
| | |
| if ((#self.templateStructure)==0) and not self.args.subtemplate then
| |
| local templateTitle = mw.getCurrentFrame():getParent():getTitle()
| |
| errors = {}
| |
|
| |
| local templateName = mw.ustring.gsub(templateTitle, 'תבנית:', '', 1)
| |
| if mw.title.getCurrentTitle().namespace==0 then
| |
| table.insert(errors, '[[קטגוריה:שגיאות פרמטריות בתבנית '..templateName..']]')
| |
| table.insert(errors, '[[קטגוריה:שגיאות פרמטריות בתבנית מידע]]')
| |
| table.insert(errors, '[[קטגוריה:שגיאות פרמטריות]]' )
| |
| else
| |
| table.insert(errors, '[[קטגוריה:שגיאות פרמטריות מחוץ למרחב הערכים]]')
| |
| end
| |
| local report = 'תבנית {{' .. templateName .. '}} ריקה מתוכן. יש להזין פרמטרים בערך או בוויקינתונים. ' .. table.concat(errors, '')
| |
| local ParamValidator = require('Module:ParamValidator')
| |
| return ParamValidator.wrapReport(report, templateName, {})
| |
| end
| |
|
| |
| -- sub infobox | | -- sub infobox |
| if self.args.subtemplate then | | if self.args.subtemplate then |
| שורה 579: |
שורה 550: |
| local templateStructure = {} | | local templateStructure = {} |
| args.subtemplate = frame.args['תת-תבנית'] | | args.subtemplate = frame.args['תת-תבנית'] |
| args.entityId = templateArgs['qid'] or templateParams['qid'] or mw.wikibase.getEntityIdForCurrentPage() | | args.entityId = templateArgs['qid'] or templateParams['qid'] |
| -- disable wikidata fetching | | -- disable wikidata fetching |
| if args.entityId == '' or args.entityId == '-' then args.entityId = nil end | | if args.entityId == '' or args.entityId == '-' then args.entityId = nil end |