Permalink
Browse files

new scaffolding partial stuff

  • Loading branch information...
1 parent ec419f1 commit 3b72978d3501060b308c1eb78203d53a6b87b4c0 Techwraith committed Nov 3, 2012
@@ -11,40 +11,12 @@
</ul>
</div>
<%% } %>
-<% for(var i in properties) { -%>
-<% if(properties[i].name !== 'id') { -%>
- <div class="control-group">
- <label for="<%= properties[i].name %>" class="control-label"><%= properties[i].name %></label>
- <div class="controls">
-<% if(properties[i].type === 'string') { -%>
-<% if(properties[i].name === 'password') { -%>
- <@- contentTag('input', '', {type:'password', class:'span6', name:'<%= properties[i].name %>'}) @>
-<% } else { -%>
- <@- contentTag('input', '', {type:'text', class:'span6', name:'<%= properties[i].name %>'}) @>
-<% } -%>
-<% } else if(properties[i].type === 'text') { -%>
- <@- contentTag('textarea', '', {class: 'span6', name: '<%= properties[i].name %>', rows: 10}) @>
-<% } else if(properties[i].type === 'number' || properties[i].type === 'int') { -%>
- <@- contentTag('input', '', {type:'number', class:'span2', name:'<%= properties[i].name %>'}) @>
-<% } else if(properties[i].type === 'boolean') { -%>
- <select name="<%= properties[i].name %>", class="span1">
- <option selected>false</option>
- <option>true</option>
- </select>
-<% } else if(properties[i].type === 'datetime') { -%>
- <@- contentTag('input', '', {type:'datetime', class:'span3', name:'<%= properties[i].name %>'}) @>
-<% } else if(properties[i].type === 'date') { -%>
- <@- contentTag('input', '', {type:'date', class:'span2', name:'<%= properties[i].name %>'}) @>
-<% } else { -%>
- <%= properties[i].type %>
-<% } -%>
- </div>
+
+ <@- partial('form', {user: {}}) @>
+
+ <div class="form-actions">
+ <@- contentTag('input', 'Add', {type: 'submit', class: 'btn btn-primary'}) @>
</div>
-<% } -%>
-<% } -%>
- <div class="form-actions">
- <@- contentTag('input', 'Add', {type: 'submit', class: 'btn btn-primary'}) @>
- </div>
</fieldset>
</form>
</div>
@@ -11,46 +11,13 @@
</ul>
</div>
<%% } %>
-<% for(var i in properties) { -%>
-<% if(properties[i].name !== 'id') { -%>
- <div class="control-group">
- <label for="<%= properties[i].name %>" class="control-label"><%= properties[i].name %></label>
- <div class="controls">
-<% if(properties[i].type === 'string') { -%>
-<% if(properties[i].name === 'password') { -%>
- <@- contentTag('input', '', {type:'password', class:'span6', name:'<%= properties[i].name %>'}) @>
-<% } else { -%>
- <@- contentTag('input', <%= names.property.singular %>.<%= properties[i].name %>, {type:'text', class:'span6', name:'<%= properties[i].name %>'}) @>
-<% } -%>
-<% } else if(properties[i].type === 'text') { -%>
- <@- contentTag('textarea', '', {class: 'span6', name: '<%= properties[i].name %>', rows: 10}) @>
-<% } else if(properties[i].type === 'number' || properties[i].type === 'int') { -%>
- <@- contentTag('input', <%= names.property.singular %>.<%= properties[i].name %>, {type:'number', class:'span2', name:'<%= properties[i].name %>'}) @>
-<% } else if(properties[i].type === 'boolean') { -%>
- <select name="<%= properties[i].name %>", class="span1">
- <@ if(<%= names.property.singular %>.<%= properties[i].name %>) { -@>
- <option>false</option>
- <option selected>true</option>
- <@ } else { -@>
- <option selected>false</option>
- <option>true</option>
- <@ } -@>
- </select>
-<% } else if(properties[i].type === 'datetime') { -%>
- <@- contentTag('input', <%= names.property.singular %>.<%= properties[i].name %>, {type:'datetime', class:'span3', name:'<%= properties[i].name %>'}) @>
-<% } else if(properties[i].type === 'date') { -%>
- <@- contentTag('input', <%= names.property.singular %>.<%= properties[i].name %>, {type:'date', class:'span2', name:'<%= properties[i].name %>'}) @>
-<% } else { -%>
- <%= properties[i].type %>
-<% } -%>
- </div>
+
+ <@- partial('form', {user: user}) @>
+
+ <div class="form-actions">
+ <@- contentTag('input', 'Save', {type: 'submit', class: 'btn btn-primary'}) @>
+ <@- contentTag('button', 'Remove', {type: 'submit', formaction: '/<%= names.filename.plural %>/' + params.id + '?_method=DELETE', formmethod: 'POST', class: 'btn btn-danger'}) @>
</div>
-<% } -%>
-<% } -%>
- <div class="form-actions">
- <@- contentTag('input', 'Save', {type: 'submit', class: 'btn btn-primary'}) @>
- <@- contentTag('button', 'Remove', {type: 'submit', formaction: '/<%= names.filename.plural %>/' + params.id + '?_method=DELETE', formmethod: 'POST', class: 'btn btn-danger'}) @>
- </div>
</fieldset>
</form>
</div>
@@ -0,0 +1,36 @@
+<% for(var i in properties) { -%>
+<% if(properties[i].name !== 'id') { -%>
+<div class="control-group">
+ <label for="<%= properties[i].name %>" class="control-label"><%= properties[i].name %></label>
+ <div class="controls">
+<% if(properties[i].type === 'string') { -%>
+<% if(properties[i].name === 'password') { -%>
+ <@- contentTag('input', '', {type:'password', class:'span6', name:'<%= properties[i].name %>'}) @>
+<% } else { -%>
+ <@- contentTag('input', <%= names.property.singular %>.<%= properties[i].name %>, {type:'text', class:'span6', name:'<%= properties[i].name %>'}) @>
+<% } -%>
+<% } else if(properties[i].type === 'text') { -%>
+ <@- contentTag('textarea', '', {class: 'span6', name: '<%= properties[i].name %>', rows: 10}) @>
+<% } else if(properties[i].type === 'number' || properties[i].type === 'int') { -%>
+ <@- contentTag('input', <%= names.property.singular %>.<%= properties[i].name %>, {type:'number', class:'span2', name:'<%= properties[i].name %>'}) @>
+<% } else if(properties[i].type === 'boolean') { -%>
+ <select name="<%= properties[i].name %>", class="span1">
+ <@ if(<%= names.property.singular %>.<%= properties[i].name %>) { -@>
+ <option>false</option>
+ <option selected>true</option>
+ <@ } else { -@>
+ <option selected>false</option>
+ <option>true</option>
+ <@ } -@>
+ </select>
+<% } else if(properties[i].type === 'datetime') { -%>
+ <@- contentTag('input', <%= names.property.singular %>.<%= properties[i].name %>, {type:'datetime', class:'span3', name:'<%= properties[i].name %>'}) @>
+<% } else if(properties[i].type === 'date') { -%>
+ <@- contentTag('input', <%= names.property.singular %>.<%= properties[i].name %>, {type:'date', class:'span2', name:'<%= properties[i].name %>'}) @>
+<% } else { -%>
+ <%= properties[i].type %>
+<% } -%>
+ </div>
+</div>
+<% } -%>
+<% } -%>

0 comments on commit 3b72978

Please sign in to comment.