From 7f7941c6e3576ddeb824ea32d994d04191a5a15a Mon Sep 17 00:00:00 2001 From: David Harrigan Date: Tue, 2 Jan 2018 12:55:31 +0000 Subject: [PATCH] Allow input fields to render as readonly. -=david=- --- .../mvc/app/views/layout_partials/base_dialog.volt | 1 + src/opnsense/mvc/app/views/layout_partials/base_form.volt | 1 + .../mvc/app/views/layout_partials/form_input_tr.volt | 7 ++++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/opnsense/mvc/app/views/layout_partials/base_dialog.volt b/src/opnsense/mvc/app/views/layout_partials/base_dialog.volt index 4db049084..2fef52a9d 100644 --- a/src/opnsense/mvc/app/views/layout_partials/base_dialog.volt +++ b/src/opnsense/mvc/app/views/layout_partials/base_dialog.volt @@ -90,6 +90,7 @@ label : dialog label {% set maxheight=false %} {% set width=false %} {% set allownew=false %} + {% set readonly=false %} {% if field['type'] == 'header' %} {# close table and start new one with header #} diff --git a/src/opnsense/mvc/app/views/layout_partials/base_form.volt b/src/opnsense/mvc/app/views/layout_partials/base_form.volt index c4711440e..dddcaff48 100644 --- a/src/opnsense/mvc/app/views/layout_partials/base_form.volt +++ b/src/opnsense/mvc/app/views/layout_partials/base_form.volt @@ -77,6 +77,7 @@ data_title : data-title to set on form {% set maxheight=false %} {% set width=false %} {% set allownew=false %} + {% set readonly=false %} {% if field['type'] == 'header' %} {# close table and start new one with header #} diff --git a/src/opnsense/mvc/app/views/layout_partials/form_input_tr.volt b/src/opnsense/mvc/app/views/layout_partials/form_input_tr.volt index 270867394..74e125394 100644 --- a/src/opnsense/mvc/app/views/layout_partials/form_input_tr.volt +++ b/src/opnsense/mvc/app/views/layout_partials/form_input_tr.volt @@ -38,6 +38,7 @@ style : css class to add maxheight : maximum height in rows if applicable width : width in pixels if applicable allownew : allow new items (for list) if applicable +readonly : if true, input fields will be readonly #} @@ -54,7 +55,7 @@ allownew : allow new items (for list) if applicable {% if type == "text" %} - + {% elseif type == "checkbox" %} {% elseif type == "select_multiple" %} @@ -63,9 +64,9 @@ allownew : allow new items (for list) if applicable {% elseif type == "dropdown" %} {% elseif type == "password" %} - + {% elseif type == "textbox" %} - + {% elseif type == "info" %} {% endif %}