mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-25 08:06:23 +08:00
Started implementing permissions into schema view.
This commit is contained in:
@@ -181,15 +181,16 @@
|
||||
<script id="schema-view-template" type="html/template">
|
||||
<div class="twelve columns">
|
||||
<div class="panel">
|
||||
<h6><% print(name); %> Schema Description</h6>
|
||||
<h6><%= name %> Schema Description</h6>
|
||||
<p>
|
||||
Create and edit properties below to control the validation of objects added to the <%= name %> collection.
|
||||
</p>
|
||||
<p>
|
||||
<p style="color:#c00;">
|
||||
POST /...<br />
|
||||
GET /...
|
||||
</p>
|
||||
<hr />
|
||||
<% print(JSON.stringify(groups)); %>
|
||||
<form class="description nice custom">
|
||||
<input type="hidden" name="_id" value="<%= _id %>" />
|
||||
<% _.each(description, function (value, key, list){%>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
window.CollectionModel = Backbone.Model.extend({
|
||||
url: function () {
|
||||
console.log('/search/'+this.get('name')+'?find={}');
|
||||
return '/search/' + this.get("name") + '?find={}';
|
||||
// console.log('/search/'+this.get('name')+'?find={}');
|
||||
return '/' + this.get('plugin') + '/' + this.get("name");
|
||||
},
|
||||
getItemById: function (id) {
|
||||
var _items = this.get('results');
|
||||
|
||||
@@ -6,6 +6,21 @@ window.Plugin = Backbone.Model.extend({
|
||||
url: function () {
|
||||
return '/settings/' + this.get("name");
|
||||
},
|
||||
getObjectByName: function (name) {
|
||||
var _configObject = false;
|
||||
console.log('getting by name');
|
||||
console.log(name)
|
||||
this.get('objects').each(function (item, index, list){
|
||||
if (item.get('name') === name) {
|
||||
_configObject = item;
|
||||
return;
|
||||
}
|
||||
else {
|
||||
console.log(JSON.stringify(item));
|
||||
}
|
||||
});
|
||||
return _configObject;
|
||||
},
|
||||
initialize: function () {
|
||||
this.set({url: this.url()});
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ window.PluginView = Backbone.View.extend({
|
||||
var tabContent = _self.addTab(obj.get("name"), obj.get("_id"));
|
||||
if (obj.get("description")) {
|
||||
var _schemaModel = new SchemaModel(obj);
|
||||
_schemaModel.set({groups: app.get('plugins').getByPluginName('users').getObjectByName('groups')});
|
||||
var _schemaEl = $("<div />").attr("id", "id-"+obj.get('_id'));
|
||||
$(tabContent).append(_schemaEl);
|
||||
var _schemaView = new SchemaView({
|
||||
|
||||
Reference in New Issue
Block a user