Skip to content

Commit

Permalink
Various fixes and corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
ewoudj committed Sep 19, 2011
1 parent b8a552e commit 6d43455
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 11 deletions.
16 changes: 14 additions & 2 deletions examples/models/feed.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@ var feedModel = new model({
type: 'string', type: 'string',
view: { view: {
title: 'Title', title: 'Title',
required: true required: true,
special: {
summary: {
type: 'text',
role: 'title'
}
}
} }
}, },
description:{ description:{
Expand All @@ -49,7 +55,13 @@ var feedModel = new model({
type: 'string', type: 'string',
view: { view: {
title: 'URL', title: 'URL',
required: false required: true,
special: {
summary: {
type: 'text',
role: 'summary'
}
}
} }
} }
}, },
Expand Down
5 changes: 4 additions & 1 deletion public/controls/application.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -89,12 +89,15 @@ var application = function(config, session, clientData){
if(!currentModel || (config.model && config.model === registeredModel.name)){ if(!currentModel || (config.model && config.model === registeredModel.name)){
currentModel = registeredModel; currentModel = registeredModel;
} }
}
for(var s in registry){
var registeredModel = registry[s];
if(registeredModel.navigatable && registeredModel.canUserNavigate(session.user)){ if(registeredModel.navigatable && registeredModel.canUserNavigate(session.user)){
navigationItems.push({ navigationItems.push({
tag:'a', tag:'a',
controlValue: registeredModel.navigationTitle || registeredModel.friendlyName, controlValue: registeredModel.navigationTitle || registeredModel.friendlyName,
attributes: { attributes: {
cls: 'sidepanelbutton', cls: (registeredModel === currentModel) ? 'sidepanelbutton selected' : 'sidepanelbutton',
href: rest.toUrl({ href: rest.toUrl({
view: 'search', view: 'search',
model: registeredModel.name, model: registeredModel.name,
Expand Down
4 changes: 3 additions & 1 deletion public/controls/formtextcontrol.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ var form = require('./form').form;
* Text control * Text control
*/ */
var textControl = function(config){ var textControl = function(config){
config = config || {};
this.parentControl = config.parentControl; this.parentControl = config.parentControl;
if(config.mode === 'view'){ if(config.mode === 'view'){
merge( this, { merge( this, {
controlValue: config.value || '', controlValue: config.value || '',
attributes: { attributes: config.attributes || {
"class": 'valueview' "class": 'valueview'
} }
});; });;
Expand All @@ -36,6 +37,7 @@ control.registry['textControl'] = textControl;
form.registerControl('view', 'text', textControl, 'textControl'); form.registerControl('view', 'text', textControl, 'textControl');
form.registerControl('edit', 'text', textControl, 'textControl'); form.registerControl('edit', 'text', textControl, 'textControl');
form.registerControl('summary', 'text', textControl, 'textControl'); form.registerControl('summary', 'text', textControl, 'textControl');
form.registerControl('summary', 'title', textControl, 'textControl');


form.registerControl('view', 'hidden', textControl, 'textControl'); form.registerControl('view', 'hidden', textControl, 'textControl');
form.registerControl('edit', 'hidden', textControl, 'textControl'); form.registerControl('edit', 'hidden', textControl, 'textControl');
Expand Down
12 changes: 6 additions & 6 deletions public/controls/list.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ var listItem = function(config){
"class": view[s].role || '' "class": view[s].role || ''
}}); }});
this.items.push(controlConfig); this.items.push(controlConfig);
this.items.push({ // this.items.push({
controlValue: itemModel.getValue(this.itemData, s, this.session), // controlValue: itemModel.getValue(this.itemData, s, this.session),
attributes: { // attributes: {
"class": view[s].role || '' // "class": view[s].role || ''
} // }
}); // });
//} //}
} }
control.call(this); control.call(this);
Expand Down
4 changes: 3 additions & 1 deletion public/controls/topbar.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var form = require('./form').form;
var rest = require('./../net/rest').utils; var rest = require('./../net/rest').utils;


var topbar = function(config){ var topbar = function(config){
config = config || {};
var currentModelName = config.model ? config.model.name : '';
merge(this,{ merge(this,{
tag: 'header', tag: 'header',
items: [{ items: [{
Expand All @@ -30,7 +32,7 @@ var topbar = function(config){
tag: 'input', tag: 'input',
name: 'searchInput', name: 'searchInput',
attributes: { attributes: {
placeholder: 'Find a topic...', placeholder: currentModelName ? 'Find a ' + currentModelName + '...' : 'Search...',
cls: 'searchInput' cls: 'searchInput'
} }
},{ },{
Expand Down
3 changes: 3 additions & 0 deletions static/css/style.css
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ nav{


.sidepanelbutton:first-child{ .sidepanelbutton:first-child{
border-radius: 8px 0px 0px 0px; border-radius: 8px 0px 0px 0px;
}

.sidepanelbutton.selected{
color: #00F; color: #00F;
background: -moz-linear-gradient( background: -moz-linear-gradient(
top, top,
Expand Down

0 comments on commit 6d43455

Please sign in to comment.