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

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