We need to move from hand made HTML templates to generated ones to avoid breaking the tool in case of wikidata UI changes.
|Resolved||Kiailandi||T168239 Port the HTML templating code into a MediaWiki extension structure|
|Declined||Kiailandi||T168247 Translate hand made HTML templates into JS generated ones|
|Resolved||Kiailandi||T172375 Understand how and if jQuery.wikibase can be used to generate the template|
We will probably need to extend the available templates with the ones we need for the Primary Sources tool.
A possible solution could be to add a mw.psTemplates object or even extending the wbTemplates object directly.
Another possible path could be adding our templates to the templates.php file in wikibase-view which declares the same templates.
I am still trying to understand which way is the best one as far as maintainability and best practices are concerned.
Another part in the UI is played by jQuery.wikibase, I still need to understand if and how this library is partially responsible for the templates generation or if it is just used to manipulate the DOM objects at later stages.
I'll try to add some more comments when I'll understand how to leverage both to obtain our final template.
@Kiailandi triaged this task as Unbreak Now! priority.
@Kiailandi: This task has been open for nearly two months. If this task has suddenly become a super urgent crucial task that needs to be fixed immediately, setting anything else aside (see the definition of the "Unbreak now!" priority), please elaborate why. If not, please decrease the task priority. Thanks!