Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Moving to ng-bind fixing submenus
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed May 20, 2014
1 parent 5c6efe2 commit 75a9eda
Show file tree
Hide file tree
Showing 11 changed files with 125 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1>New Article</h1>
<input type="submit" class="btn btn-default">
</div>
<div data-ng-show="error" class="text-danger">
<strong>{{error}}</strong>
<strong data-ng-bind="error"></strong>
</div>
</fieldset>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h1>Edit Article</h1>
<input type="submit" value="Update" class="btn btn-default">
</div>
<div data-ng-show="error" class="text-danger">
<strong>{{error}}</strong>
<strong data-ng-bind="error"></strong>
</div>
</fieldset>
</form>
Expand Down
8 changes: 4 additions & 4 deletions public/modules/articles/views/list-articles.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ <h1>Articles</h1>
</div>
<div class="list-group">
<a data-ng-repeat="article in articles" data-ng-href="#!/articles/{{article._id}}" class="list-group-item">
<small class="list-group-item-text">{{article.created | date:'medium'}} / {{article.user.displayName}}</small>
<h4 class="list-group-item-heading">{{article.title}}</h4>
<p class="list-group-item-text">{{article.content}}</p>
<small class="list-group-item-text">Posted on <span data-ng-bind="article.created | date:'mediumDate'"></span> by <span data-ng-bind="article.user.displayName"></span></small>
<h4 class="list-group-item-heading" data-ng-bind="article.title"></h4>
<p class="list-group-item-text" data-ng-bind="article.content"></p>
</a>
</div>
<div class="alert alert-warning text-center" data-ng-hide="!articles.$resolved || articles.length">
<div class="alert alert-warning text-center" data-ng-if="articles.$resolved && !articles.length">
No articles yet, why don't you <a href="/#!/articles/create">create one</a>?
</div>
</section>
9 changes: 3 additions & 6 deletions public/modules/articles/views/view-article.client.view.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<section data-ng-controller="ArticlesController" data-ng-init="findOne()">
<div class="page-header">
<h1>{{article.title}}</h1>
<h1 data-ng-bind="article.title"></h1>
</div>

<div class="pull-right" data-ng-show="authentication.user._id == article.user._id">
<a class="btn btn-primary" href="/#!/articles/{{article._id}}/edit">
<i class="glyphicon glyphicon-edit"></i>
Expand All @@ -12,9 +11,7 @@ <h1>{{article.title}}</h1>
</a>
</div>
<small>
<em class="text-muted">Posted on {{article.created | date:'mediumDate'}} by {{article.user.displayName}}</em>
<em class="text-muted">Posted on <span data-ng-bind="article.created | date:'mediumDate'"></span> by <span data-ng-bind="article.user.displayName"></span></em>
</small>
<p class="lead">
{{article.content}}
</p>
<p class="lead" data-ng-bind="article.content"></p>
</section>
12 changes: 6 additions & 6 deletions public/modules/core/services/menus.client.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ angular.module('core').service('Menus', [
this.menus[menuId].items.push({
title: menuItemTitle,
link: menuItemURL,
mClass: menuClass || '',
menuClass: menuClass || '',
uiRoute: menuItemUIRoute || ('/' + menuItemURL),
isPublic: isPublic || this.menus[menuId].isPublic,
roles: roles || this.defaultRoles,
subitems: [],
items: [],
shouldRender: shouldRender
});

Expand All @@ -103,7 +103,7 @@ angular.module('core').service('Menus', [
for (var itemIndex in this.menus[menuId].items) {
if (this.menus[menuId].items[itemIndex].link === rootMenuItemURL) {
// Push new submenu item
this.menus[menuId].items[itemIndex].subitems.push({
this.menus[menuId].items[itemIndex].items.push({
title: menuItemTitle,
link: menuItemURL,
uiRoute: menuItemUIRoute || ('/' + menuItemURL),
Expand Down Expand Up @@ -141,9 +141,9 @@ angular.module('core').service('Menus', [

// Search for menu item to remove
for (var itemIndex in this.menus[menuId].items) {
for (var subitemIndex in this.menus[menuId].items[itemIndex].subitems) {
if (this.menus[menuId].items[itemIndex].subitems[subitemIndex].link === submenuItemURL) {
this.menus[menuId].items[itemIndex].subitems.splice(subitemIndex, 1);
for (var subitemIndex in this.menus[menuId].items[itemIndex].items) {
if (this.menus[menuId].items[itemIndex].items[subitemIndex].link === submenuItemURL) {
this.menus[menuId].items[itemIndex].items.splice(subitemIndex, 1);
}
}
}
Expand Down
25 changes: 12 additions & 13 deletions public/modules/core/views/header.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
<ul class="nav navbar-nav" data-ng-if="menu.shouldRender(authentication.user);">
<li data-ng-repeat="item in menu.items" data-ng-if="item.shouldRender(authentication.user);" ng-switch="item.mClass" class="{{item.mClass}}" ui-route="{{item.uiRoute}}" ng-class="{active: $uiRoute}">
<a ng-switch-when="dropdown" href="#" class="dropdown-toggle" data-toggle="dropdown">
{{item.title}}
<b class="caret"></b>
</a>
<ul ng-switch-when="dropdown" class="dropdown-menu">
<li data-ng-repeat="subitem in item.subitems" data-ng-if="subitem.shouldRender(authentication.user);" ui-route="{{subitem.uiRoute}}" ng-class="{active: $uiRoute}">
<a href="/#!/{{subitem.link}}">{{subitem.title}}</a>
</li>
</ul>

<a ng-switch-default href="/#!/{{item.link}}">{{item.title}}</a>
<span data-ng-bind="item.title"></span>
<b class="caret"></b>
</a>
<ul ng-switch-when="dropdown" class="dropdown-menu">
<li data-ng-repeat="subitem in item.items" data-ng-if="subitem.shouldRender(authentication.user);" ui-route="{{subitem.uiRoute}}" ng-class="{active: $uiRoute}">
<a href="/#!/{{subitem.link}}" data-ng-bind="subitem.title"></a>
</li>
</ul>
<a ng-switch-default href="/#!/{{item.link}}" data-ng-bind="item.title"></a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right" data-ng-hide="authentication.user">
Expand All @@ -36,8 +35,8 @@
<ul class="nav navbar-nav navbar-right" data-ng-show="authentication.user">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
{{authentication.user.displayName}} <b class="caret"></b>
</a>
<span data-ng-bind="authentication.user.displayName"></span> <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<li>
<a href="/#!/settings/profile">Edit Profile</a>
Expand All @@ -56,4 +55,4 @@
</li>
</ul>
</nav>
</div>
</div>
153 changes: 94 additions & 59 deletions public/modules/core/views/home.client.view.html
Original file line number Diff line number Diff line change
@@ -1,61 +1,96 @@
<section data-ng-controller="HomeController">

<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
<div class="jumbotron">
<h1>
That's some<br><img alt="140x140" src="http://meanjs.org/img/logo.png" />
</h1>
<p>
Open-Source Full-Stack Solution For MEAN Applications
</p>
<p>
<a class="btn btn-primary btn-large" href="http://meanjs.org" target="_blank">Learn more</a>
</p>
</div>
</div>
</div>
<h2>Congrats! You've configured and run the sample application.</h2>
<p>MEAN.JS is a web application boilerplate. That means start changing everything :-)</p>
<p>This sample application tracks users and articles. Click <em>Signup</em> to get started. To configure your app to work with your social accounts, edit the <em>/config/strategies/*.js</em> files.</p>
<div id="techTable" class="row clearfix">
<div class="col-md-3 column">
<h2><em>M</em>ongoDB</h2>
<p><a target="_blank" href="http://mongodb.org/">MongoDB</a> is a database. MongoDB's <a target="_blank" href="http://docs.mongodb.org/manual/">great manual</a>, to get started with NoSQL and MongoDB.</p>
</div>
<div class="col-md-3 column">
<h2><em>E</em>xpress</h2>
<p><a target="_blank" href="http://expressjs.com/"> Express</a> is an app server. Check out <a target="_blank" href="http://expressjs.com/guide.html">The Express Guide</a> or <a target="_blank" href="http://stackoverflow.com/questions/8144214/learning-express-for-node-js">StackOverflow</a> for more info.</p>
</div>
<div class="col-md-3 column">
<h2><em>A</em>ngularJS</h2>
<p>AngularJS is web app framework. <a target="_blank" href="http://angularjs.org/">Angular's webiste</a> offers alot. The <a target="_blank" href="http://www.thinkster.io/">Thinkster Popular Guide</a> and <a target="_blank" href="https://egghead.io/">Egghead Videos</a> are great resources.</p>
</div>
<div class="col-md-3 column">
<h2><em>N</em>ode.js</h2>
<p><a target="_blank" href="http://nodejs.org/">Node.js</a> is a web server. Node's website and this <a target="_blank" href="http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js">stackOverflow thread</a>, are great resources.</p>
</div>
</div>
<br>
<div class="well">
<h2>MEAN.JS Documentation</h2>
<p>
Once you're familiar with the foundation technology, check out the MEAN.JS Documentation:
<ul>
<li><a target="_blank" href="http://meanjs.org/docs.html">MEAN.JS Documentation</a></li>
<li><a target="_blank" href="http://meanjs.org/generator.html">Yoeman Generator</a></li>
<li><a target="_blank" href="http://meanjs.org/modules.html">Modules</a></li>
<li><a target="_blank" href="http://meanjs.org/changelog.html">Changelog</a></li>
<li><a target="_blank" href="http://meanjs.org/community.html">Community</a></li>
<li><a target="_blank" href="http://blog.meanjs.org">Blog</a></li>
</ul>
</p>
</div>
<br>Enjoy &amp; Keep Us Updated,
<br>The MEAN.JS Team.
<br>
<br>
<br>
</div>
</section>
<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
<div class="jumbotron text-center">
<h1>
<img alt="140x140" src="http://meanjs.org/img/logo.png" />
</h1>
<p>
Open-Source Full-Stack Solution For MEAN Applications
</p>
<p>
<a class="btn btn-primary btn-lg" href="http://meanjs.org" target="_blank">Learn more</a>
</p>
</div>
</div>
</div>
<h2>Congrats! You've configured and run the sample application.</h2>
<p>MEAN.JS is a web application boilerplate, which means you should start changing everything :-)</p>
<p>This sample application tracks users and articles.</p>
<ul>
<li>
Click
<em>Signup</em>
to get started.
</li>
<li>
Configure your app to work with your social accounts, by editing the
<em>/config/env/*.js</em>
files.
</li>
<li>
Edit your users module.
</li>
<li>
Add new CRUD modules.
</li>
<li>
Have fun...
</li>
</ul>
<div id="techTable" class="row clearfix">
<div class="col-md-3 column">
<h2>
<strong>M</strong>ongoDB
</h2>
<p><a target="_blank" href="http://mongodb.org/">MongoDB</a> is a database. MongoDB's <a target="_blank" href="http://docs.mongodb.org/manual/">great manual</a>, to get started with NoSQL and MongoDB.</p>
</div>
<div class="col-md-3 column">
<h2>
<strong>E</strong>xpress
</h2>
<p><a target="_blank" href="http://expressjs.com/"> Express</a> is an app server. Check out <a target="_blank" href="http://expressjs.com/guide.html">The Express Guide</a> or <a target="_blank" href="http://stackoverflow.com/questions/8144214/learning-express-for-node-js">StackOverflow</a> for more info.</p>
</div>
<div class="col-md-3 column">
<h2>
<strong>A</strong>ngularJS
</h2>
<p>AngularJS is web app framework. <a target="_blank" href="http://angularjs.org/">Angular's webiste</a> offers alot. The <a target="_blank" href="http://www.thinkster.io/">Thinkster Popular Guide</a> and <a target="_blank" href="https://egghead.io/">Egghead Videos</a> are great resources.</p>
</div>
<div class="col-md-3 column">
<h2>
<strong>N</strong>ode.js
</h2>
<p><a target="_blank" href="http://nodejs.org/">Node.js</a> is a web server. Node's website and this <a target="_blank" href="http://stackoverflow.com/questions/2353818/how-do-i-get-started-with-node-js">stackOverflow thread</a>, are great resources.</p>
</div>
</div>
<br>
<div class="well">
<h2>MEAN.JS Documentation</h2>
<p>
Once you're familiar with the foundation technology, check out the MEAN.JS Documentation:
<ul>
<li><a target="_blank" href="http://meanjs.org/docs.html">MEAN.JS Documentation</a>
</li>
<li><a target="_blank" href="http://meanjs.org/generator.html">Yoeman Generator</a>
</li>
<li><a target="_blank" href="http://meanjs.org/modules.html">Modules</a>
</li>
<li><a target="_blank" href="http://meanjs.org/changelog.html">Changelog</a>
</li>
<li><a target="_blank" href="http://meanjs.org/community.html">Community</a>
</li>
<li><a target="_blank" href="http://blog.meanjs.org">Blog</a>
</li>
</ul>
</p>
</div>
<br>Enjoy &amp; Keep Us Updated,
<br>The MEAN.JS Team.
<br>
<br>
<br>
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h3 class="col-md-12 text-center">Change your password</h3>
<strong>Password Changed Successfully</strong>
</div>
<div data-ng-show="error" class="text-center text-danger">
<strong>{{error}}</strong>
<strong data-ng-bind="error"></strong>
</div>
</fieldset>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h3 class="col-md-12 text-center">Edit your profile</h3>
<strong>Profile Saved Successfully</strong>
</div>
<div data-ng-show="error" class="text-center text-danger">
<strong>{{error}}</strong>
<strong data-ng-bind="error"></strong>
</div>
</fieldset>
</form>
Expand Down
2 changes: 1 addition & 1 deletion public/modules/users/views/signin.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3 class="col-md-12 text-center">Or with your account</h3>
<a href="/#!/signup">Sign up</a>
</div>
<div data-ng-show="error" class="text-center text-danger">
<strong>{{error}}</strong>
<strong data-ng-bind="error"></strong>
</div>
</fieldset>
</form>
Expand Down
2 changes: 1 addition & 1 deletion public/modules/users/views/signup.client.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ <h3 class="col-md-12 text-center">Or with your email</h3>
<a href="/#!/signin" class="show-signup">Sign in</a>
</div>
<div data-ng-show="error" class="text-center text-danger">
<strong>{{error}}</strong>
<strong data-ng-bind="error"></strong>
</div>
</fieldset>
</form>
Expand Down

0 comments on commit 75a9eda

Please sign in to comment.