Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' into feature/socket.io-mvc

  • Loading branch information...
commit ec419f1d49f05897bd1bbdd9b685a0f7b0510119 2 parents ad15957 + 1cdd577
@Techwraith Techwraith authored
View
5 lib/init/model.js
@@ -112,11 +112,6 @@ module.exports = new (function () {
adapter.connect();
}
model.loadedAdapters[name] = adapter;
- if (typeof adapter.createTable == 'function') {
- // FIXME -- fire-and-forget bad, need to make this
- // recursive
- adapter.createTable(name, function () {});
- }
}
model.adapters[name] = adapter;
}
View
2  package.json
@@ -7,7 +7,7 @@
"REST",
"MVC"
],
- "version": "0.5.6",
+ "version": "0.5.7",
"author": "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
"dependencies": {
"jake": "0.5.x",
View
2  templates/Jakefile
@@ -675,7 +675,7 @@ namespace('gen', function () {
jake.mkdirP('app/views/layouts');
// Add views for the other CRUD actions when doing a full-on resource
- ['index', 'add', 'show', 'edit'].forEach(function (action) {
+ ['index', 'add', 'show', 'edit', 'form'].forEach(function (action) {
addActionView(action);
});
View
17 templates/locales/ru-ru.json
@@ -0,0 +1,17 @@
+{
+ "model.validatesPresent": "\"{name}\" обязательное поле."
+, "model.validatesAbsent": "\"{name}\" должно быть пустым"
+, "model.validatesConfirmed": "\"{name}\" и \"{qual}\" должны соответствовать."
+, "model.validatesFormat": "\"{name}\" содержит не верный формат."
+, "model.validatesExactLength": "\"{name}\" должно быть {qual} символов."
+, "model.validatesMinLength": "\"{name}\" должно быть не менее {min} символов."
+, "model.validatesMaxLength": "\"{name}\" должно быть не более {max} символов."
+, "model.validatesWithFunction": "\"{name}\" имеет не верное значение."
+, "model.validatesNumber": "\"{name}\" должно быть числом."
+, "model.validatesInteger": "\"{name}\" должно быть целым числом."
+, "model.validatesObject": "\"{name}\" должно быть объектом."
+, "model.validatesArray": "\"{name}\" должно быть массивом."
+, "model.validatesDate": "\"{name}\" содержит не верный формат даты."
+, "model.validatesDatetime": "\"{name}\" содержит не верный формат даты и времени."
+, "model.validatesTime": "\"{name}\" содержит не верный формат времени."
+}
View
38 templates/scaffold/views/ejs/add.html.ejs.ejs
@@ -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>
View
45 templates/scaffold/views/ejs/edit.html.ejs.ejs
@@ -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>
View
36 templates/scaffold/views/ejs/form.html.ejs.ejs
@@ -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>
+<% } -%>
+<% } -%>
View
30 templates/scaffold/views/jade/add.html.jade.ejs
@@ -8,33 +8,7 @@
for err in params.errors
li= err
-<% for(var i in properties) { -%>
-<% if(properties[i].name !== 'id') { -%>
- .control-group
- label(for="<%= properties[i].name %>", class="control-label") <%= properties[i].name %>
- .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.span1(name="<%= properties[i].name %>")
- option(selected) false
- option true
-<% } 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 %>
-<% } -%>
-<% } -%>
-<% } -%>
+ != partial('form', {user: {}})
+
.form-actions
!= contentTag('input', 'Add', {type: 'submit', class: 'btn btn-primary'})
View
34 templates/scaffold/views/jade/edit.html.jade.ejs
@@ -8,38 +8,8 @@
for err in params.errors
li= err
-<% for(var i in properties) { -%>
-<% if(properties[i].name !== 'id') { -%>
- .control-group
- label(for="<%= properties[i].name %>", class="control-label") <%= properties[i].name %>
- .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.span1(name="<%= properties[i].name %>")
- if <%= names.property.singular %>.<%= properties[i].name %>
- option false
- option(selected) true
- else
- option(selected) false
- option true
-<% } 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 %>
-<% } -%>
-<% } -%>
-<% } -%>
+ != partial('form', {user: user})
+
.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'})
View
32 templates/scaffold/views/jade/form.html.jade.ejs
@@ -0,0 +1,32 @@
+<% for(var i in properties) { -%>
+<% if(properties[i].name !== 'id') { -%>
+.control-group
+ label(for="<%= properties[i].name %>", class="control-label") <%= properties[i].name %>
+ .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.span1(name="<%= properties[i].name %>")
+ if <%= names.property.singular %>.<%= properties[i].name %>
+ option false
+ option(selected) true
+ else
+ option(selected) false
+ option true
+<% } 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 %>
+<% } -%>
+<% } -%>
+<% } -%>
Please sign in to comment.
Something went wrong with that request. Please try again.