Skip to content

Commit 55cfc12

Browse files
committed
Merge pull request #3 from ember-admin/ember_2
Ember 2
2 parents aab8aff + 813259b commit 55cfc12

65 files changed

Lines changed: 676 additions & 405 deletions

Some content is hidden

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

.jshintrc

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"predef": [
3+
"server",
4+
"document",
5+
"window",
6+
"-Promise"
7+
],
8+
"browser": true,
9+
"boss": true,
10+
"curly": true,
11+
"debug": false,
12+
"devel": true,
13+
"eqeqeq": true,
14+
"evil": true,
15+
"forin": false,
16+
"immed": false,
17+
"laxbreak": false,
18+
"newcap": true,
19+
"noarg": true,
20+
"noempty": false,
21+
"nonew": false,
22+
"nomen": false,
23+
"onevar": false,
24+
"plusplus": false,
25+
"regexp": false,
26+
"undef": true,
27+
"sub": true,
28+
"strict": false,
29+
"white": false,
30+
"eqnull": true,
31+
"esnext": true,
32+
"unused": true
33+
}

.npmignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
bower_components/
2+
tests/
3+
tmp/
4+
dist/
5+
6+
.bowerrc
7+
.editorconfig
8+
.ember-cli
9+
.travis.yml
10+
.npmignore
11+
**/.gitkeep
12+
bower.json
13+
Brocfile.js
14+
testem.json

.watchmanconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ignore_dirs": ["tmp", "dist"]
3+
}

Brocfile.js

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

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

app/components/signout-link.js

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
import Ember from 'ember';
22

33
export default Ember.Component.extend({
4-
currentUserObserver: function() {
5-
if(this.get('currentUser')){
6-
var currentUser = this.get('currentUser');
7-
if(this.get('avatarAttribute.thumb_url')){
8-
this.setProperties({
9-
isAvatarPresent: !Ember.isEmpty(currentUser.get(this.get('avatarAttribute'))),
10-
avatarUrl: currentUser.get(this.get('avatarAttribute.thumb_url'))
11-
});
12-
}
13-
if (this.get('nameAttribute')){
14-
this.set('username', currentUser.get(this.get('nameAttribute')));
15-
}
16-
}
17-
}.observes('currentUser'),
4+
isAvatarEmpty: Ember.computed.empty('currentUser.avatarAttribute'),
185
actions:{
196
signout: function(){
207
this.sendAction('signoutAction');
218
}
22-
}
23-
});
9+
}
Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
1-
{{#if currentUser}}
2-
{{#if isAvatarPresent}}
3-
<ul class="nav navbar-nav navbar-right">
4-
<li class="dropdown">
5-
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
6-
<img {{bind-attr src=avatarUrl}} class="profile-image img-circle avatar"> {{username}} <b class="caret"></b></a>
7-
<ul class="dropdown-menu">
8-
<li>{{#link-to 'users.edit' currentUser}}<i class="glyphicon glyphicon-cog"></i> Account{{/link-to}}</li>
9-
<li class="divider"></li>
10-
<li><a {{ action 'signout' }} href="#"><i class="glyphicon glyphicon-log-out"></i> Sign-out</a></li>
11-
</ul>
12-
</li>
13-
</ul>
1+
{{#if session.isAuthenticated}}
2+
{{#unless isAvatarEmpty}}
3+
<div class="upper">
4+
<ul class="nav navbar-nav navbar-right">
5+
<li class="dropdown">
6+
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
7+
<img src={{currentUser.avatar.thumb_url}} class="profile-image img-circle avatar"> {{currentUser.name}} <b class="caret"></b></a>
8+
<ul class="dropdown-menu">
9+
<li>{{#link-to 'users.edit' currentUser.id}}<i class="glyphicon glyphicon-cog"></i> Account{{/link-to}}</li>
10+
<li class="divider"></li>
11+
<li><a {{ action 'signout' }} href="#"><i class="glyphicon glyphicon-log-out"></i> Sign-out</a></li>
12+
</ul>
13+
</li>
14+
</ul>
15+
</div>
1416
{{else}}
15-
<p class="navbar-text navbar-right">
16-
<a {{ action 'signout' }} href="#">
17-
Signout
18-
<i class="glyphicon glyphicon-log-out"></i>
19-
</a>
20-
</p>
21-
<p class="navbar-text navbar-right">
22-
Signed in as&nbsp;
23-
<span class='username'>{{username}}</span>
24-
</p>
25-
{{/if}}
26-
{{/if}}
17+
<div class="upper2">
18+
<p class="nav navbar-right navbar-nav">
19+
<a {{ action 'signout' }} href="#">
20+
Sign-out
21+
<i class="glyphicon glyphicon-log-out"></i>
22+
</a>
23+
</p>
24+
<p class="nav navbar-right navbar-nav">
25+
Signed in as&nbsp;
26+
{{#link-to 'users.edit' currentUser.id}}<span class='username'>{{currentUser.name}}</span><i class="glyphicon glyphicon-cog"></i>{{/link-to}}
27+
&nbsp;
28+
</p>
29+
</div>
30+
{{/unless}}
31+
{{/if}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Ember from 'ember';
2+
3+
export default Ember.Component.extend({
4+
session: Ember.inject.service('session'),
5+
store: Ember.inject.service(),
6+
currentUser: Ember.computed(function() {
7+
let id = this.get('session.data.authenticated.id');
8+
return this.get('store').find('user', id);
9+
}),
10+
isAvatarEmpty: Ember.computed.empty('currentUser.avatar'),
11+
actions:{
12+
signout: function(){
13+
this.get('session').invalidate();
14+
}
15+
}
16+
});
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import LoginControllerMixin from 'simple-auth/mixins/login-controller-mixin';
21
import Ember from 'ember';
32

4-
export default Ember.Controller.extend(LoginControllerMixin, {
5-
authenticator: 'simple-auth-authenticator:devise'
6-
});
3+
export default Ember.Controller.extend();

blueprints/ember-cli-admin-auth/files/app/initializers/init-shared.js

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

0 commit comments

Comments
 (0)