// Copyright (c) 2016, JINGROW
// For license information, please see license.txt

jingrow.ui.form.on("Page", {
	refresh: function (frm) {
		if (!jingrow.boot.developer_mode && jingrow.session.user != "Administrator") {
			// make the document read-only
			frm.set_read_only();
		}
		if (!frm.is_new() && !frm.pg.istable) {
			frm.add_custom_button(__("Go to {0} Page", [frm.pg.title || frm.pg.name]), () => {
				jingrow.set_route(frm.pg.name);
			});
		}
	},
});
