Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
dd035734
Commit
dd035734
authored
Mar 05, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add standard table input template
parent
e9b5d28c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
form_input_tr.volt
...opnsense/mvc/app/views/layout_partials/form_input_tr.volt
+20
-0
opnsense.js
src/opnsense/www/js/opnsense.js
+5
-2
No files found.
src/opnsense/mvc/app/views/layout_partials/form_input_tr.volt
0 → 100644
View file @
dd035734
<tr for="{{ id }}">
<td >
<label class="control-label" for="{{ id }}">{{label}}</label>
</td>
<td >
{% if type == "text" %}
<input type="text" class="form-control" size="{{size|default("50")}}" id="{{ id }}" >
{% elseif type == "checkbox" %}
<input type="checkbox" id="{{ id }}" >
{% endif %}
{% if help|default(false) %}
<br/>
<small>{{help}}</small>
{% endif %}
</td>
<td>
<span class="help-block" for="{{ id }}"></span>
</td>
</tr>
\ No newline at end of file
src/opnsense/www/js/opnsense.js
View file @
dd035734
...
@@ -80,10 +80,13 @@ function setFormData(parent,data) {
...
@@ -80,10 +80,13 @@ function setFormData(parent,data) {
function
handleFormValidation
(
parent
,
validationErrors
)
{
function
handleFormValidation
(
parent
,
validationErrors
)
{
$
(
"
#
"
+
parent
+
"
input
"
).
each
(
function
(
index
)
{
$
(
"
#
"
+
parent
+
"
input
"
).
each
(
function
(
index
)
{
if
(
validationErrors
!=
undefined
&&
$
(
this
).
attr
(
'
id
'
)
in
validationErrors
)
{
if
(
validationErrors
!=
undefined
&&
$
(
this
).
attr
(
'
id
'
)
in
validationErrors
)
{
$
(
this
).
parent
().
addClass
(
"
has-error
"
);
//$(this).parent().addClass("has-error");
$
(
"
*[for='
"
+
$
(
this
).
attr
(
'
id
'
)
+
"
']
"
).
addClass
(
"
has-error
"
);
//$(this).addClass("has-error");
$
(
"
span[for='
"
+
$
(
this
).
attr
(
'
id
'
)
+
"
']
"
).
text
(
validationErrors
[
$
(
this
).
attr
(
'
id
'
)]);
$
(
"
span[for='
"
+
$
(
this
).
attr
(
'
id
'
)
+
"
']
"
).
text
(
validationErrors
[
$
(
this
).
attr
(
'
id
'
)]);
}
else
{
}
else
{
$
(
this
).
parent
().
removeClass
(
"
has-error
"
);
$
(
"
*[for='
"
+
$
(
this
).
attr
(
'
id
'
)
+
"
']
"
).
removeClass
(
"
has-error
"
);
//$(this).removeClass("has-error");
$
(
"
span[for='
"
+
$
(
this
).
attr
(
'
id
'
)
+
"
']
"
).
text
(
""
);
$
(
"
span[for='
"
+
$
(
this
).
attr
(
'
id
'
)
+
"
']
"
).
text
(
""
);
}
}
});
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment