Skip to content
This repository was archived by the owner on Oct 5, 2020. It is now read-only.

Commit db7de39

Browse files
Nishad BakshiNishad Bakshi
authored andcommitted
Fixed routes and updated pages
1 parent 063762b commit db7de39

File tree

6 files changed

+14
-35
lines changed

6 files changed

+14
-35
lines changed

app/templates/ui/app/create/create.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="create" ng-show="ctrl.currentUser && !ctrl.currentUser.disallowUpdates">
1+
<div class="create" ng-show="$ctrl.currentUser && !$ctrl.currentUser.disallowUpdates">
22
<div class="row">
33
<div class="col-sm-2"></div>
44
<h2 class="col-sm-10">Create a Document</h2>
@@ -112,7 +112,7 @@ <h2 class="col-sm-10">Create a Document</h2>
112112

113113
<div class="row">
114114
<a class="col-sm-offset-10 btn btn-default" ui-sref="root.landing">Cancel</a>
115-
<button class="btn btn-primary" ng-click="ctrl.submit()">Create</button>
115+
<button class="btn btn-primary" ng-click="$ctrl.submit()">Create</button>
116116
</div>
117117
</form>
118118
</div>

app/templates/ui/app/root/root.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<ul class="nav navbar-nav">
1616
<li><a href="/">Home</a></li>
1717
<li><a href="/search">Search</a></li>
18-
<li ng-show="ctrl.currentUser && !ctrl.currentUser.disallowUpdates"><a href="/create">Create</a></li>
18+
<li ng-show="$ctrl.currentUser && !$ctrl.currentUser.disallowUpdates"><a href="/create">Create</a></li>
1919
</ul>
2020
<ml-user mode="inline"></ml-user>
2121
</div><!-- /.navbar-collapse -->

app/templates/ui/app/route/routes.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,7 @@
4141
.state('root', {
4242
url: '',
4343
// abstract: true,
44-
component: 'root',
45-
resolve: {
46-
user: function(userService) {
47-
return userService.getUser();
48-
}
49-
}
44+
component: 'root'
5045
})
5146
.state('root.landing', {
5247
url: '/',

app/templates/ui/app/user/profile.html

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div ng-if="$ctrl.user" class="profile">
22
<div class="row">
33
<div class="col-md-2"></div>
4-
<h2 class="col-md-10">Edit profile of {{ctrl.user.username}}</h2>
4+
<h2 class="col-md-10">Edit profile of {{$ctrl.user.username}}</h2>
55
</div>
66
<form class="form-horizontal" name="profileForm">
77
<div class="form-group">
@@ -10,7 +10,7 @@ <h2 class="col-md-10">Edit profile of {{ctrl.user.username}}</h2>
1010
<label class="control-label">Full name</label>
1111
</div>
1212
<div class="col-md-2">
13-
<input type="text" class="form-control" placeholder="full name of user" ng-model="ctrl.user.profile.fullname" ng-disabled="ctrl.user.disallowUpdates">
13+
<input type="text" class="form-control" placeholder="full name of user" ng-model="$ctrl.user.profile.fullname" ng-disabled="$ctrl.user.disallowUpdates">
1414
</div>
1515
</div>
1616
</div>
@@ -21,10 +21,10 @@ <h2 class="col-md-10">Edit profile of {{ctrl.user.username}}</h2>
2121
<label class="control-label">E-mail(s)</label>
2222
</div>
2323
<div class="col-md-6">
24-
<input type="email" name="newEmail" class="form-control" placeholder="e-mail of user" ng-model="ctrl.newEmail" ng-disabled="ctrl.user.disallowUpdates">
24+
<input type="email" name="newEmail" class="form-control" placeholder="e-mail of user" ng-model="$ctrl.newEmail" ng-disabled="$ctrl.user.disallowUpdates">
2525
</div>
2626
<div class="col-md-1">
27-
<button class="btn btn-primary" ng-click="ctrl.addEmail()" ng-show="!ctrl.user.disallowUpdates">
27+
<button class="btn btn-primary" ng-click="$ctrl.addEmail()" ng-show="!$ctrl.user.disallowUpdates">
2828
<span class="glyphicon glyphicon-plus"></span>
2929
</button>
3030
</div>
@@ -34,21 +34,21 @@ <h2 class="col-md-10">Edit profile of {{ctrl.user.username}}</h2>
3434
</div>
3535
<!-- always show add button -->
3636
<!-- repeat if there are emails -->
37-
<div class="row" ng-repeat="email in ctrl.user.profile.emails track by $index">
37+
<div class="row" ng-repeat="email in $ctrl.user.profile.emails track by $index">
3838
<div class="col-md-offset-2 col-md-6">
3939
<div class="input-group additional-email">
40-
<input type="text" class="form-control" placeholder="e-mail of user" ng-model="ctrl.user.profile.emails[$index]" ng-disabled="ctrl.user.disallowUpdates">
41-
<span class="input-group-addon btn-danger" ng-click="ctrl.removeEmail($index)" ng-show="!ctrl.user.disallowUpdates">
40+
<input type="text" class="form-control" placeholder="e-mail of user" ng-model="$ctrl.user.profile.emails[$index]" ng-disabled="$ctrl.user.disallowUpdates">
41+
<span class="input-group-addon btn-danger" ng-click="$ctrl.removeEmail($index)" ng-show="!$ctrl.user.disallowUpdates">
4242
<span class="glyphicon glyphicon-remove"></span>
4343
</span>
4444
</div>
4545
</div>
4646
</div>
4747
</div>
48-
<div class="row" ng-show="!ctrl.user.disallowUpdates">
48+
<div class="row" ng-show="!$ctrl.user.disallowUpdates">
4949
<div class="col-md-offset-7 col-md-5">
5050
<a class="btn btn-default" ui-sref="root.landing">Cancel</a>
51-
<button class="btn btn-primary" ng-click="ctrl.submit(profileForm)">Submit</button>
51+
<button class="btn btn-primary" ng-click="$ctrl.submit(profileForm)">Submit</button>
5252
</div>
5353
</div>
5454
</form>

app/templates/ui/app/user/user-component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!-- display the logged in user -->
88
<div class="welcome" ng-if="$ctrl.currentUser">
99
<div class="navbar-collapse collapse">
10-
<span class="glyphicon glyphicon-user"></span> {{ $ctrl.currentUser.fullname || $ctrl.currentUser.name }} | <span class="profile-link"><a href="/profile">Account</a></span>
10+
<span class="glyphicon glyphicon-user"></span> {{ $ctrl.currentUser.profile.fullname || $ctrl.currentUser.username }} | <span class="profile-link"><a href="/profile">Account</a></span>
1111

1212
<button class="btn btn-danger btn-xs" type="button" ng-click="$ctrl.loginService.logout()">Logout</button>
1313

app/templates/ui/app/user/user-dir.html

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)