Skip to content

Commit

Permalink
Bugfix- in model assosiation relation not displaying names of objects
Browse files Browse the repository at this point in the history
  • Loading branch information
stuk88 committed Nov 13, 2022
1 parent e1b1981 commit 1089f1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sails-hook-cms",
"version": "0.0.23",
"version": "0.0.25",
"description": "A simple sails v0.12 admin panel",
"main": "index.js",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions partials/forms.jade
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ mixin input(name, attr, type, value)
fieldset.form-group
label.capitalize(for='#{name}') #{_.get(attr, "cms.label", name)}:
input.form-control(
type='#{type}',
name="#{name}",
type='#{type}',
name="#{name}",
value=(value ? value : (type == 'number' ? '0' : ''))
required=(attr.required ? "required" : undefined),
required=(attr.required ? "required" : undefined),

step=(attr.type === 'float'? "any" : undefined)
)

mixin select(name, attr, options, value)
fieldset.form-group
label.capitalize(for='#{name}') #{_.get(attr, "cms.label", name)}:
select.selectize_select(name="#{name}")
option(value="") Select one
each item, index in options
option(value="#{item.value}", selected=(item.value === value) ? "selected" : undefined) #{item.name}
option(value="#{item.value}", selected=(item.value === value) ? "selected" : undefined) #{item.title}
if attr.model
a(href='/admin/#{attr.model || name}/create',target="_blank")
= "New "+ name
Expand All @@ -28,7 +28,7 @@ mixin checkbox(name, attr, value)
label
input(type='checkbox', name="#{name}", checked=(value)? "checked" : undefined, value="true")
| #{_.get(attr, "cms.label", name)}

mixin datetime(name, attr, value)
.form-group
label #{_.get(attr, "cms.label", name)}:
Expand Down

0 comments on commit 1089f1f

Please sign in to comment.