Skip to content

Commit a542013

Browse files
committed
Working towards 0.3
1 parent f2e0802 commit a542013

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2364
-801
lines changed

app/code/f_nested_schema.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var FSchema = new Schema({
1616
forename: {type: String, index: true, list: true},
1717
aTest: { type: Schema.Types.ObjectId, ref: 'b_using_options'},
1818

19-
// exams: [ExamsSchema] // defaults to horizontal compact form
19+
// exams: [ExamsSchema] // defaults to horizontal compact form
2020
// or
2121
exams: {type: [ExamsSchema], form: {formStyle: 'inline'}}
2222
});

app/css/forms-angular-bs2.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6589,7 +6589,6 @@ select.select2 {
65896589
font-weight: bold;
65906590
color: inherit;
65916591
font-size: 17.5px;
6592-
border-bottom: 2px solid inherit;
65936592
min-height: 40px;
65946593
}
65956594
.fixed-header {

app/css/forms-angular-bs2.less

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
font-weight: @headingsFontWeight;
2222
color: @headingsColor;
2323
font-size: @fontSizeLarge;
24-
border-bottom: 2px solid @headingsColor;
2524
min-height: @navbarHeight;
2625
}
2726

app/demo/css/demo-bs2.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6590,7 +6590,6 @@ select.select2 {
65906590
font-weight: bold;
65916591
color: #317eac;
65926592
font-size: 17.5px;
6593-
border-bottom: 2px solid #317eac;
65946593
min-height: 50px;
65956594
}
65966595
.fixed-header {

app/partials/get-started.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,12 @@ <h3>Create your front end</h3>
145145
&lt;link rel=&quot;stylesheet&quot; href=&quot;/bower_components/forms-angular/forms-angular-bs2.css&quot;&gt;
146146
&lt;script type=&quot;text/javascript&quot; src=&quot;/bower_components/forms-angular/forms-angular.js&quot;&gt;&lt;/script&gt;
147147
&lt;script src=&quot;/myapp.js&quot;&gt;&lt;/script&gt;
148-
148+
&lt;style type=&quot;text/css&quot; media=&quot;all&quot;&gt;
149+
.brandpluslogo {
150+
font-size: x-large;
151+
font-weight: bold;
152+
}
153+
&lt;/style&gt;
149154
&lt;/head&gt;
150155

151156
&lt;!--The NavCtrl controller is responsible for parsing the URL and loading the menu for the model and form--&gt;

app/partials/get-started/get-started-create.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ mkdir myapp
44
cd myapp
55
express
66
npm install
7+
78
npm install forms-angular --save
89
npm install mongoose --save
910
cd public

app/partials/get-started/get-started.sh

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,12 @@ fi
1717

1818
echo Setting up example app for branch $branch
1919
wget https://raw.github.com/mchapman/forms-angular/$branch/app/partials/get-started/get-started-create.sh
20-
bash get-started-create.sh
20+
bash get-started-create.sh $2
2121
echo "Sub script complete...."
2222
pwd
2323
cd myapp
2424
pwd
2525

26-
# We use this next option when we want to use the bower.json from git rather than the
27-
# live forms-angular bower download
28-
if [ $3 = "bower" ]; then
29-
echo Updating Packages
30-
cd public
31-
wget https://raw.github.com/mchapman/forms-angular/$branch/bower.json
32-
bower install --allow-root
33-
bower update --allow-root
34-
cd ..
35-
fi
36-
3726
wget https://raw.github.com/mchapman/forms-angular/$branch/app/partials/get-started/adds-app.js
3827
cat app.js adds-app.js > tempapp.js
3928
mv tempapp.js app.js

bower.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "forms-angular",
3-
"version": "0.2.4",
3+
"version": "0.2.6",
44
"homepage": "https://github.com/mchapman/forms-angular",
55
"description": "No nonsense forms for the MEAN stack",
66
"keywords": [
@@ -22,11 +22,11 @@
2222
"Do not upgrade ng-grid to anything less than 2.0.10 (https://github.com/angular-ui/ng-grid/issues/1142)"
2323
],
2424
"dependencies": {
25-
"angular": "1.3.0-beta.7",
26-
"angular-route": "1.3.0-beta.7",
27-
"angular-mocks": "1.3.0-beta.7",
25+
"angular": "1.3.0-beta.8",
26+
"angular-route": "1.3.0-beta.8",
27+
"angular-mocks": "1.3.0-beta.8",
2828
"angular-ui-bootstrap-bower": "0.8.0",
29-
"angular-sanitize": "1.3.0-beta.7",
29+
"angular-sanitize": "1.3.0-beta.8",
3030
"angular-ui-select2": "0.0.4",
3131
"bootstrap": "2.3.2",
3232
"html5shiv-dist": "3.6.2",
@@ -44,6 +44,6 @@
4444
"ckeditor": "*"
4545
},
4646
"resolutions": {
47-
"angular": "1.3.0-beta.7"
47+
"angular": "1.3.0-beta.8"
4848
}
4949
}

dist/favicon.ico

3.64 KB
Binary file not shown.

dist/index.html

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<base href="/">
7+
<title>forms-angular</title>
8+
9+
<style>[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
10+
display: none !important;
11+
}</style>
12+
13+
<link rel="stylesheet" href="styles/295f7ff2.main.css"/>
14+
</head>
15+
<body ng-app="myDemoApp" ng-controller="NavCtrl" ng-keyup="globalShortcuts($event)">
16+
<div class="visible-lg visible-desktop">
17+
<a href="https://github.com/mchapman/forms-angular"><img src="/img/forkme_right_darkblue_121621.png" style="position: fixed; right: 0; top: 0; z-index: 1032"></a>
18+
</div>
19+
20+
<div class="navbar navbar-default navbar-fixed-top">
21+
<div class="navbar-inner">
22+
<div class="container-fluid" ng-cloak="">
23+
<button type="button" class="navbar-toggle btn btn-navbar" data-toggle="collapse" data-target=".navbar-collapse">
24+
<span class="glyphicon glyphicon-bar icon-bar"></span>
25+
<span class="glyphicon glyphicon-bar icon-bar"></span>
26+
<span class="glyphicon glyphicon-bar icon-bar"></span>
27+
</button>
28+
<div class="pull-left">
29+
<a class="navbar-brandpluslogo brandpluslogo" ng-href="{{buildUrl('index')}}"><img src="/img/Home_icon_black.png" width="45" alt="Click on logo to go to home page" class="img-responsive"></a>
30+
</div>
31+
<div class="visible-lg visible-desktop pull-right col-md-2 span2"></div> <!-- Leave some space for github flash -->
32+
<global-search class="global-search"></global-search>
33+
<div class="pull-right" style="padding-top: 14px"><iframe src="http://ghbtns.com/github-btn.html?user=mchapman&repo=forms-angular&type=watch&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe><iframe src="http://ghbtns.com/github-btn.html?user=mchapman&repo=forms-angular&type=fork&count=true" allowtransparency="true" frameborder="0" scrolling="0" width="110" height="20"></iframe></div>
34+
<div class="navbar-collapse collapse nav-collapse">
35+
<ul class="nav navbar-nav">
36+
<li><a ng-href="{{buildUrl('get-started')}}">Get Started</a></li>
37+
<li><a ng-href="{{buildUrl('schemas')}}">Schemas</a></li>
38+
<li><a ng-href="{{buildUrl('forms')}}">Forms</a></li>
39+
<li><a ng-href="{{buildUrl('reporting')}}">Reporting</a></li>
40+
<li class="dropdown"><a class="dropdown-toggle">More</a>
41+
<ul class="dropdown-menu">
42+
<li><a class="dropdown-option" ng-href="{{buildUrl('examples')}}">Examples</a></li>
43+
<li><a class="dropdown-option" ng-href="{{buildUrl('api-docs')}}">API Documentation</a></li>
44+
<li><a class="dropdown-option" href="https://github.com/mchapman/forms-angular/issues?state=open">Issues</a></li>
45+
<li><a class="dropdown-option" href="https://github.com/mchapman/forms-angular/releases">Changelog</a></li>
46+
<li><a class="dropdown-option" ng-href="{{buildUrl('in-the-wild')}}">Who Uses It?</a></li>
47+
</ul>
48+
</li>
49+
<li ng-show="items.length > 0" class="dropdown">
50+
<a class="dropdown-toggle">
51+
{{contextMenu}}
52+
</a>
53+
<ul class="dropdown-menu">
54+
<li ng-repeat="choice in items">
55+
<a class="dropdown-option" ng-hide="isHidden($index)" ng-href="{{choice.url}}" ng-click="doClick($index)">{{choice.text}}</a>
56+
</li>
57+
</ul>
58+
</li>
59+
</ul>
60+
</div>
61+
</div>
62+
</div>
63+
</div>
64+
<div ng-view=""></div>
65+
<footer class="footer">
66+
<p>Code licensed under <a href="http://opensource.org/licenses/MIT" target="_blank">MIT License</a>, documentation under <a href="http://creativecommons.org/licenses/by/3.0/">CC BY 3.0</a>.</p>
67+
<ul class="footer-links">
68+
<li><a href="https://github.com/mchapman/forms-angular/issues?state=open">Issues</a></li>
69+
<li class="muted">·</li>
70+
<li><a href="https://github.com/mchapman/forms-angular/releases">Changelog</a></li>
71+
</ul>
72+
</footer>
73+
<!-- what forms-angular depends on -->
74+
<!-- *** Section must be copied to partials/get-started/index.html if it is changed *** -->
75+
<script src="scripts/d7995ff0.plugins.js"></script>
76+
<!--[if lt IE 9]>
77+
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7/html5shiv.js"></script>
78+
<![endif]-->
79+
80+
<script type="text/javascript" src="/bower_components/ckeditor/ckeditor.js"></script>
81+
<!--<script>-->
82+
<!--var CKEDITOR_BASEPATH = '//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.3.2/';-->
83+
<!--</script>-->
84+
<!--<script src="//cdnjs.cloudflare.com/ajax/libs/ckeditor/4.3.2/ckeditor.min.js"></script>-->
85+
86+
<!-- forms-angular stuff -->
87+
<!--This section needs to stay in sync with the concat section of the Gruntfile-->
88+
<script src="scripts/cfb56e9f.lib.js"></script>
89+
90+
<!--Demo application stuff-->
91+
<script src="scripts/c34a3ff9.app.js"></script>
92+
93+
<script type="text/javascript">
94+
if (window.location.hostname != '0.0.0.0') {
95+
var _gaq = _gaq || [];
96+
_gaq.push(['_setAccount', 'UA-3037487-9']);
97+
_gaq.push(['_trackPageview']);
98+
99+
(function () {
100+
var ga = document.createElement('script');
101+
ga.type = 'text/javascript';
102+
ga.async = true;
103+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
104+
var s = document.getElementsByTagName('script')[0];
105+
s.parentNode.insertBefore(ga, s);
106+
})();
107+
}
108+
</script>
109+
110+
</body>
111+
</html>

dist/partials/404.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<div class="span6">
2+
<h1>Dang!</h1>
3+
4+
<p>Something went wrong. Probably one of:</p>
5+
<ol><li>You can't type very well</li>
6+
<li>We can't program properly</li>
7+
<li>There is a problem with the intertubes</li></ol>
8+
9+
<p>Try again. If it keeps happening and you can access other internet sites OK then it is probably our problem.
10+
If that is the case <em><strong>please</strong></em> let us know. That way we can fix it and hopefully we won't waste
11+
your time again.</p>
12+
</div>

dist/partials/api-docs.html

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<div class="container-fluid">
2+
<div class="row-fluid">
3+
<div class="page-header">
4+
<h1>API</h1>
5+
</div>
6+
</div>
7+
<div class="row-fluid">
8+
<ul>
9+
<li>Models
10+
<ul>
11+
<li><strong>/api/models</strong> returns an array of all the models that are available to forms-angular</li>
12+
<li><strong>/api/schema/:model</strong> returns the schema for a model</li>
13+
<li><strong>/api/schema/:model/:customForm</strong> returns the schema for a model</li>
14+
<li><strong>/api/:model</strong> returns an array of all the documents in a model (needs pagination)</li>
15+
<li><strong>/api/:model/:id</strong> returns a single document from the collection</li>
16+
<li><strong>/api/:model/:id/list</strong> returns how a document should appear in a list</li>
17+
</ul>
18+
19+
The calls that return data will strip out any fields that are defined as <strong>secure</strong> - for example
20+
<pre><code>passwordHash: {type: String, secure:true, form: {hidden: true}}</code></pre>
21+
</li>
22+
<li>Search
23+
<ul>
24+
<li><strong>/api/search?q=string</strong> returns documents where the string is found at the beginning of an
25+
indexed field
26+
</li>
27+
<li><strong>/api/search/:model?q=string</strong> returns documents in the specified collection where the string
28+
is found at the beginning of an indexed field. Note that the search is case insensitive, so will be
29+
inefficient (and to be avoided on large datasets) until Mongo 2.5 comes out. (See issue <a
30+
href="https://jira.mongodb.org/browse/SERVER-90" target="_blank">here</a>)
31+
</li>
32+
<li><strong>/api/search?q=string&f={<span><em>filterjson</em></span>}</strong> returns documents where the
33+
string is found at the beginning of an indexed field which satisfy the conditions in the filter.
34+
</li>
35+
</ul>
36+
</li>
37+
</ul>
38+
</div>
39+
</div>

dist/partials/base-analysis.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<div ng-controller="AnalysisCtrl">
2+
<div class="container-fluid page-header report-header">
3+
<div class="row-fluid">
4+
<div class="header-lhs span7">
5+
<h1>{{ reportSchema.title }}</h1>
6+
</div>
7+
<div class="header-rhs span4">
8+
<form-input schema="paramSchema" name="paramForm" ng-show="paramSchema" formstyle="horizontalCompact"></form-input>
9+
</div>
10+
</div>
11+
</div>
12+
<div class="container-fluid page-body report-body">
13+
<div ng-show="errorMessage" class="row-fluid">
14+
<div class="span6 offset3 alert alert-error">
15+
<button type="button" class="close" ng-click="dismissError()">&times;</button>
16+
<h4>{{alertTitle}}</h4>
17+
<div ng-bind-html="errorMessage"></div>
18+
</div>
19+
</div>
20+
<div class="row-fluid">
21+
<div class="gridStyle" ng-grid="gridOptions"></div>
22+
</div>
23+
</div>
24+
</div>
25+

dist/partials/base-edit.html

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<div ng-controller="BaseCtrl">
2+
<!--This is the header section-->
3+
<div ng-class="css('rowFluid')" class="page-header edit-header">
4+
<!--The left hand side contains important fields from the data-->
5+
<div class="header-lhs col-sm-8 span8">
6+
<h4>{{modelNameDisplay}} :
7+
<span ng-repeat="field in listSchema">{{getListData(record, field.name)}} </span>
8+
</h4>
9+
</div>
10+
<!--The right hand side contains buttons to Save, Cancel, Delete and create New-->
11+
<div class="header-rhs col-sm-2 span2">
12+
<div form-buttons></div>
13+
</div>
14+
</div>
15+
<div class="container-fluid page-body edit-body">
16+
<!--This section only appears when there is an error message to display-->
17+
<div id="display-error" ng-show="errorMessage" ng-class="css('rowFluid')">
18+
<div class="alert alert-error col-lg-offset-3 offset3 col-sm-6 span6 alert-warning alert-dismissable">
19+
<button type="button" class="close" ng-click="dismissError()">×</button>
20+
<h4>{{alertTitle}}</h4>
21+
<div ng-bind-html="errorMessage"></div>
22+
</div>
23+
</div>
24+
<form-input name="baseForm" schema="baseSchema()" formstyle="compact"></form-input>
25+
</div>
26+
</div>

dist/partials/base-list.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--BaseCtrl is used for listing data in the database as well-->
2+
<div ng-controller="BaseCtrl">
3+
<div ng-class="css('rowFluid')" class="page-header list-header">
4+
<div class="header-lhs col-sm-8 span8">
5+
<h1>{{modelNameDisplay}}</h1>
6+
</div>
7+
<div class="header-rhs col-sm-2 span2">
8+
<button class="btn btn-default" ng-click="new()"><i class="icon-plus"></i> New</button>
9+
</div>
10+
</div>
11+
<div class="page-body list-body">
12+
<div ng-show="errorMessage" ng-class="css('rowFluid')">
13+
<div class="alert alert-error col-lg-offset-3 offset3 col-xs-6 span6 alert-warning alert-dismissable">
14+
<button type="button" class="close" ng-click="dismissError()">×</button>
15+
<h4>{{alertTitle}}</h4>
16+
<div ng-bind-html="errorMessage"></div>
17+
</div>
18+
</div>
19+
20+
<div ng-class="css('rowFluid')" infinite-scroll="scrollTheList()">
21+
<a ng-repeat="record in recordList" ng-href="{{generateEditUrl(record)}}">
22+
<div class="list-item">
23+
<div ng-class="css('span',12/listSchema.length)" ng-repeat="field in listSchema">{{getListData(record, field.name)}} </div>
24+
</div>
25+
</a>
26+
</div>
27+
</div>
28+
</div>

dist/partials/custom-edit.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div data-ng-controller="BaseCtrl">
2+
<div class="row">
3+
<div class="span8 well">
4+
<h3>This is a custom form to edit data</h3>
5+
</div>
6+
</div>
7+
<div class="row">
8+
<form-input name="customEditForm" schema="formSchema" formStyle="horizontalCompact"></form-input>
9+
</div>
10+
<div class="form-actions">
11+
<button type="button" class="btn btn-primary" ng-click="save({'redirect':'/demo/thank-you.html'})">Submit</button>
12+
</div>
13+
</div>
14+
15+

0 commit comments

Comments
 (0)