got everything to work

This commit is contained in:
David Baldwynn 2015-10-30 14:40:22 -07:00
parent 2e5ccc9869
commit 60aef4204b
28 changed files with 132 additions and 52 deletions

View file

@ -119,15 +119,18 @@ var FormSchema = new Schema({
colors:{
backgroundColor: {
type: String,
match: [/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/]
match: [/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/],
default: '#fff'
},
questionColor: {
type: String,
match: [/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/]
match: [/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/],
default: '#333',
},
answerColor: {
type: String,
match: [/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/]
match: [/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/],
default: '#333',
},
buttonColor: {
type: String,

View file

@ -29,7 +29,8 @@
"angular-busy": "~4.1.3",
"angular-permission": "~0.3.1",
"angular-input-stars": "*",
"file-saver.js": "~1.20150507.2"
"file-saver.js": "~1.20150507.2",
"angular-bootstrap-colorpicker": "~3.0.19"
},
"resolutions": {
"angular": "~1.3.17"

View file

@ -62,8 +62,6 @@ angular.module(ApplicationConfiguration.applicationModuleName).run(['$rootScope'
Auth.ensureHasCurrentUser(User);
user = Auth.currentUser;
console.log(user.roles);
if(user){
authenticator = new Authorizer(user);
console.log('access denied: '+!authenticator.canAccess(permissions));

View file

@ -4,6 +4,10 @@
border-width:3px;
}
section.public-form {
margin-top: -70px;
}
section.content p.breakwords {
word-break: break-all;
}
@ -120,20 +124,20 @@ form .row.field {
padding: 0.45em 0.9em;
width: 100%;
line-height: 160%;
border: 2px dashed #ddd;
border: 3px dashed #ddd;
}
form .field-input > input.hasDatepicker{
padding: 0.45em 0.9em;
width: 50%;
line-height: 160%;
border: 2px dashed #ddd;
border: 3px dashed #ddd;
}
form .field-input > input.text-field-input{
padding: 0.45em 0.9em;
width: 100%;
line-height: 160%;
border: 2px dashed #ddd;
border: 3px dashed #ddd;
}
form .field-input > input.text-field-input:focus{
border: 0;

View file

@ -67,7 +67,8 @@ angular.module('forms').directive('fieldDirective', ['$templateCache', '$http',
restrict: 'E',
scope: {
field: '=',
required: '&'
required: '&',
design: '='
},
link: linker
};

View file

@ -1,4 +1,4 @@
'use strict';
// Use Application configuration module to register a new module
ApplicationConfiguration.registerModule('forms', ['ngFileUpload', 'ui.date', 'ui.sortable', 'angular-input-stars', 'users']);
ApplicationConfiguration.registerModule('forms', ['ngFileUpload', 'colorpicker.module', 'ui.date', 'ui.sortable', 'angular-input-stars', 'users']);

View file

@ -70,10 +70,75 @@
<edit-form-directive myform="myform">
</edit-form-directive>
</tab>
<tab disabled="true">
<tab>
<tab-heading >
Edit Design
Design
</tab-heading>
<div class="config-form container">
<!-- Design Settings -->
<div class="row">
<div class="col-md-12 container">
<!-- Title -->
<div class="row">
<div class="col-sm-12">
<h2 class="hidden-sm hidden-xs">Change how your Form Looks</h2>
<h3 class="hidden-lg hidden-md">Change how your Form Looks</h3>
</div>
</div>
<!-- Background Color -->
<div class="row field">
<div class="field-title col-sm-6">
<h5>Form Background Color</h5>
</div>
<div class="field-input col-sm-6">
<input colorpicker="hex" type="text" ng-model="myform.design.colors.backgroundColor" ng-style="{ 'background-color': myform.design.colors.backgroundColor }"/>
<!-- <span class="required-error" ng-show="field.required && !field.fieldValue">* required</span> -->
</div>
</div>
<!-- Question Color -->
<div class="row field">
<div class="field-title col-sm-6">
<h5>Question Color</h5>
</div>
<div class="field-input col-sm-6">
<input colorpicker="hex" type="text" ng-model="myform.design.colors.questionColor" ng-style="{ 'background-color': myform.design.colors.questionColor }"/>
<!-- <span class="required-error" ng-show="field.required && !field.fieldValue">* required</span> -->
</div>
</div>
<!-- Answer Color -->
<div class="row field">
<div class="field-title col-sm-6">
<h5>Form Answer Color</h5>
</div>
<div class="field-input col-sm-6">
<input colorpicker="hex" type="text" ng-model="myform.design.colors.answerColor" ng-style="{ 'background-color': myform.design.colors.answerColor }"/>
<!-- <span class="required-error" ng-show="field.required && !field.fieldValue">* required</span> -->
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-offset-4 col-sm-2">
<button class="btn btn-primary btn-large" type="button" ng-click="update(false, null)"><i class="icon-arrow-left icon-white"></i> Save Changes</button>
</div>
<div class="col-sm-1">
<button class="btn btn-default" type="button" ng-click="resetForm()"><i class="icon-eye-open icon-white"></i> Cancel</button>
</div>
</div>
</div>
</tab>
<tab>
<tab-heading>

View file

@ -4,7 +4,7 @@
<div class="col-xs-12 field-input">
<div ng-repeat="option in field.fieldOptions" class="row-fluid">
<label class="btn btn-info col-xs-3">
<input ng-focus="setActiveField(field._id)"
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor}"
type="checkbox"
value="{{option.option_id}}"
ng-model="field.fieldValue"

View file

@ -1,5 +1,5 @@
<div class="field row" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title">
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
<h3>
<span class="fa fa-angle-double-right"></span>
{{field.title}}
@ -8,7 +8,7 @@
</div>
<div class="col-xs-12 field-input">
<div class="control-group input-append">
<input ng-focus="setActiveField(field._id)"ui-date="dateOptions" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled">
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" ui-date="dateOptions" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled">
</div>
</div>
</div>

View file

@ -1,5 +1,5 @@
<div class="field row dropdown" ng-click="setActiveField(field._id)" ng-if="field.fieldOptions.length > 0">
<div class="col-xs-12 field-title">
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
<h3>
<span class="fa fa-angle-double-right"></span>
{{field.title}}

View file

@ -1,7 +1,7 @@
<div class="field row" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
class="col-xs-12 field-title"<div class="field row" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-input">
<input ng-focus="setActiveField(field._id)"type="email"
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" type="email"
class="text-field-input"
placeholder="email@example.com"
value="{{field.fieldValue}}"

View file

@ -1 +1 @@
<input ng-focus="setActiveField(field._id)" type="hidden" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" value="{{field.fieldValue}}" ng-disabled="field.disabled">
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" type="hidden" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" value="{{field.fieldValue}}" ng-disabled="field.disabled">

View file

@ -1,5 +1,5 @@
<div class="field row radio legal" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title">
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
<h3>{{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3>
<br>
<p style="color:#ddd;">{{field.description}}</p>
@ -7,11 +7,11 @@
<div class="col-xs-6 field-input container">
<div class="row-fluid">
<label class="btn col-xs-4">
<input ng-focus="setActiveField(field._id)"type="radio" value="true" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" type="radio" value="true" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
<span> I accept </span>
</label>
<label class="btn col-xs-5 col-xs-offset-1">
<input ng-focus="setActiveField(field._id)"type="radio" value="false" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" type="radio" value="false" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
<span>I don't accept </span>
</label>
</div>

View file

@ -1,6 +1,6 @@
<div class="field row" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-input">
<input ng-focus="setActiveField(field._id)"type="url" class="text-field-input" placeholder="https://example.com/something" value="{{field.fieldValue}}" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" type="url" class="text-field-input" placeholder="https://example.com/something" value="{{field.fieldValue}}" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
</div>
</div>

View file

@ -1,7 +1,7 @@
<div class="field row textfield natural" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-input">
<input ng-focus="setActiveField(field._id)"type="text"
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" type="text"
class="text-field-input"
ng-model="field.fieldValue"
ng-model-options="{ debounce: 250 }"

View file

@ -1,6 +1,6 @@
<div class="field row" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-input">
<input ng-focus="setActiveField(field._id)"type="number" class="text-field-input" placeholder="" value="{{field.fieldValue}}" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" type="number" class="text-field-input" placeholder="" value="{{field.fieldValue}}" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
</div>
</div>

View file

@ -1,6 +1,6 @@
<div class="field row" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-input">
<input ng-focus="setActiveField(field._id)"type="password" class="text-field-input" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" value="{{field.fieldValue}}" ng-required="field.required" ng-disabled="field.disabled">
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}" type="password" class="text-field-input" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" value="{{field.fieldValue}}" ng-required="field.required" ng-disabled="field.disabled">
</div>
</div>

View file

@ -1,9 +1,9 @@
<div class="field row radio" ng-click="setActiveField(field._id)" ng-if="field.fieldOptions.length > 0">
<div class="col-xs-12 field-title"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-input">
<div ng-repeat="option in field.fieldOptions" class="row-fluid">
<label class="btn col-xs-3" ng-class="{activeBtn: field.fieldValue == field.fieldOptions[$index].option_id}">
<input ng-focus="setActiveField(field._id)"
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}"
type="radio"
value="{{option.option_value}}"
ng-model="field.fieldValue"

View file

@ -1,5 +1,5 @@
<div class="textfield field row" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title">
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
<h3>
<span class="fa fa-angle-double-right"></span>
{{field.title}}

View file

@ -1,5 +1,5 @@
<div class="field row" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}"><h3><span class="fa fa-angle-double-right"></span> {{field.title}} <span class="required-error" ng-show="field.required && !field.fieldValue">*(required)</span></h3></div>
<div class="col-xs-12 field-input">
<textarea type="text" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" value="{{field.fieldValue}}" ng-required="field.required" ng-disabled="field.disabled"></textarea>

View file

@ -1,5 +1,5 @@
<div class="textfield field row" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title">
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}" ng-style="{'color': design.colors.questionColor}">
<h3>
<span class="fa fa-angle-double-right"></span> {{field.title}}
<span class="required-error" ng-show="field.required && !field.fieldValue">
@ -8,7 +8,7 @@
</h3>
</div>
<div class="col-xs-12 field-input">
<input ng-focus="setActiveField(field._id)"
<input ng-focus="setActiveField(field._id)" ng-style="{'color': design.colors.answerColor, 'border-color': design.colors.answerColor}"
type="text"
class="text-field-input"
ng-model="field.fieldValue"

View file

@ -1,5 +1,5 @@
<div class="field row radio" ng-click="setActiveField(field._id)">
<div class="col-xs-12 field-title">
<div class="col-xs-12 field-title" ng-style="{'color': design.colors.questionColor}">
<h3 class="row">
<span class="fa fa-angle-double-right"></span> {{field.title}}
<span class="required-error" ng-show="field.required && !field.fieldValue">
@ -14,12 +14,12 @@
<div class="col-xs-12 field-input">
<div class="row-fluid">
<label class="btn btn-success col-xs-3">
<input ng-focus="setActiveField(field._id)"type="radio" value="true" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled" ng-init="field.fieldValue = true"/>
<input ng-focus="setActiveField(field._id)" type="radio" value="true" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled" ng-init="field.fieldValue = true"/>
<span>Yes</span>
</label>
<label class="btn btn-danger col-xs-3">
<input ng-focus="setActiveField(field._id)"type="radio" value="false" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
<input ng-focus="setActiveField(field._id)" type="radio" value="false" ng-model="field.fieldValue" ng-model-options="{ debounce: 250 }" ng-required="field.required" ng-disabled="field.disabled"/>
<span>No</span>
</label>
</div>

View file

@ -146,12 +146,12 @@
</div>
<div class="row field" ng-if="oscarhostAPI">
<div class="field-title col-sm-4">
<h5>Oscarhost API update type</h5>
<h5>Oscarhost API Update Type</h5>
</div>
<div class="col-sm-8">
<select ng-model="myform.plugins.oscarhost.settings.updateType">
<option ng-repeat="updateType in myform.plugins.oscarhost.settings.validUpdateTypes" ng-value="updateType">
<option ng-repeat="updateType in myform.plugins.oscarhost.settings.validUpdateTypes" ng-selected="myform.plugins.oscarhost.settings.updateType == updateType" ng-value="updateType">
{{updateType}}
</option>
</select>
@ -159,8 +159,8 @@
</div>
<!-- generate typeform from NodeForm yes/no field -->
<div class="row field">
<!-- Generate typeform from NodeForm yes/no field -->
<!-- <div class="row field">
<div class="col-sm-6 field-title">
<h5>Autogenerate into Typeform?</h5>
</div>
@ -196,7 +196,7 @@
<div class="col-sm-8">
<span type="text" ng-bind="myform.Typeform.url"></span>
</div>
</div>
</div> -->
<!-- !!!!!!DAVID: TODO: Finish this so we can upload pdfFieldMap!!!!!!!!! -->

View file

@ -52,10 +52,10 @@
<!-- <entryPage pageData="myform.startPage" pageType="startPage"></entryPage> -->
<div class="field row text-center">
<div class="col-xs-12 text-center">
<h1>{{pageData.introTitle}}</h1>
<h1>{{myform.startPage.introTitle}}</h1>
</div>
<div class="col-xs-10 col-xs-offset-1 text-left">
<p style="color:#ddd;">{{pageData.introParagraph}}</p>
<p style="color:#ddd;">{{myform.startPage.introParagraph}}</p>
</div>
</div>
<div class="row form-actions" style="padding-bottom:3em; padding-left: 1em; padding-right: 1em;">
@ -271,7 +271,7 @@
<div class="panel panel-default" style="border-style: dashed; border-color: #a9a9a9;">
<div class="panel-heading">
<h4 class="panel-title text-center" style="color: #a9a9a9;">
Drag and Drop new fields here
Click on Fields to add them here
</h4>
</div>
</div>

View file

@ -34,6 +34,9 @@
<th data-ng-repeat="(key, value) in myform.form_fields">
{{value.title}}
</th>
<th ng-if="myform.plugins.oscarhost.baseUrl">
OscarEMR User Profile
</th>
<th>
Percentage Complete
</th>
@ -60,6 +63,11 @@
<td data-ng-repeat="(key, value) in row.form_fields">
{{value.fieldValue}}
</td>
<td ng-if="myform.plugins.oscarhost.baseUrl">
<a href="{{myform.plugins.oscarhost.baseUrl.split('ws')[0]}}demographic/demographiccontrol.jsp?demographic_no={{row.oscarDemoNum}}&displaymode=edit">
User Profile #{{row.oscarDemoNum}}
</a>
</td>
<td>
{{row.percentageComplete}}%
</td>

View file

@ -39,7 +39,7 @@
<div class="row">
<form name="myForm" class="submission-form col-sm-12 col-md-offset-1 col-md-10">
<div ng-repeat="field in myform.form_fields" ng-if="!field.deletePreserved" ng-class="{activeField: selected == field._id }" class="row field-directive">
<field-directive field="field">
<field-directive field="field" design="myform.design">
</field-directive>
</div>
</form>

View file

@ -25,7 +25,7 @@
<div class="title-row row">
<div class="col-xs-5 field-title text-left"> Name </div>
<div class="col-xs-12 field-input">
<input type="text" name="title" required ng-pattern="/^[a-zA-Z0-9 \-.]*$/" ng-minlength="4"/>
<input type="text" name="title" required ng-model="formTitle" ng-pattern="/^[a-zA-Z0-9 \-.]*$/" ng-minlength="4"/>
</div>
</div>
<div class="details-row row">

View file

@ -1,4 +1,4 @@
<section class="public-form">
<section class="public-form" ng-style="{ 'background-color': myform.design.colors.backgroundColor }">
<submit-form-directive myform="myform"></submit-form-directive>