jingrow.ui.form.on("Version", "refresh", function (frm) {
	$(
		jingrow.render_template("version_view", { pg: frm.pg, data: JSON.parse(frm.pg.data) })
	).appendTo(frm.fields_dict.table_html.$wrapper.empty());

	frm.add_custom_button(__("Show all Versions"), function () {
		jingrow.set_route("List", "Version", {
			ref_pagetype: frm.pg.ref_pagetype,
			pagename: frm.pg.pagename,
		});
	});
});
