US/904 logout & user photo in projects home
parent
4c354e1399
commit
c7fddedd87
|
@ -23,7 +23,6 @@ taiga = @.taiga
|
||||||
module = angular.module("taigaProject")
|
module = angular.module("taigaProject")
|
||||||
bindOnce = @.taiga.bindOnce
|
bindOnce = @.taiga.bindOnce
|
||||||
|
|
||||||
|
|
||||||
class ProjectsController extends taiga.Controller
|
class ProjectsController extends taiga.Controller
|
||||||
@.$inject = [
|
@.$inject = [
|
||||||
"$scope",
|
"$scope",
|
||||||
|
@ -37,12 +36,14 @@ class ProjectsController extends taiga.Controller
|
||||||
"tgLoader"
|
"tgLoader"
|
||||||
]
|
]
|
||||||
|
|
||||||
constructor: (@scope, @rs, @rootscope, @navurls, @auth, @location, @appTitle, @projectUrl, @tgLoader) ->
|
constructor: (@scope, @rs, @rootscope, @navurls, @auth, @location, @appTitle, @projectUrl, @tgLoader, @navUrls) ->
|
||||||
@appTitle.set("Projects")
|
@appTitle.set("Projects")
|
||||||
|
|
||||||
if !@auth.isAuthenticated()
|
if !@auth.isAuthenticated()
|
||||||
@location.path(@navurls.resolve("login"))
|
@location.path(@navurls.resolve("login"))
|
||||||
|
|
||||||
|
@.user = @auth.getUser()
|
||||||
|
|
||||||
@.projects = []
|
@.projects = []
|
||||||
@.loadInitialData()
|
@.loadInitialData()
|
||||||
.then () =>
|
.then () =>
|
||||||
|
@ -59,6 +60,10 @@ class ProjectsController extends taiga.Controller
|
||||||
newProject: ->
|
newProject: ->
|
||||||
@rootscope.$broadcast("projects:create")
|
@rootscope.$broadcast("projects:create")
|
||||||
|
|
||||||
|
logout: ->
|
||||||
|
@auth.logout()
|
||||||
|
@location.path(@navurls.resolve("login"))
|
||||||
|
|
||||||
module.controller("ProjectsController", ProjectsController)
|
module.controller("ProjectsController", ProjectsController)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,16 @@ block head
|
||||||
block content
|
block content
|
||||||
div.home-projects-list(ng-controller="ProjectsController as ctrl")
|
div.home-projects-list(ng-controller="ProjectsController as ctrl")
|
||||||
.home-projects-wrapper
|
.home-projects-wrapper
|
||||||
|
div.welcome-user
|
||||||
|
div.info
|
||||||
|
p
|
||||||
|
| Welcome
|
||||||
|
span(tg-bo-bind="ctrl.user.full_name_display")
|
||||||
|
a.logout(ng-click="ctrl.logout()" href="", title="Logout") logout
|
||||||
|
|
||||||
|
.avatar(href="", title="User preferences")
|
||||||
|
img(ng-src="{{ctrl.user.photo}}", alt="username")
|
||||||
|
|
||||||
.home-projects-list-inner
|
.home-projects-list-inner
|
||||||
div.recent-projects
|
div.recent-projects
|
||||||
ul
|
ul
|
||||||
|
|
|
@ -11,6 +11,35 @@
|
||||||
position: fixed;
|
position: fixed;
|
||||||
top: 0;
|
top: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
.welcome-user {
|
||||||
|
display: flex;
|
||||||
|
position: absolute;
|
||||||
|
right: 1rem;
|
||||||
|
top: 1rem;
|
||||||
|
p {
|
||||||
|
color: $whitish;
|
||||||
|
margin-bottom: 0;
|
||||||
|
span {
|
||||||
|
&:before {
|
||||||
|
content: ' ';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.logout {
|
||||||
|
@extend %small;
|
||||||
|
float: right;
|
||||||
|
&:hover {
|
||||||
|
color: $red-light;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.info {
|
||||||
|
padding: 10px 5px;
|
||||||
|
padding-right: 1rem;
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
width: 60px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.home-projects-wrapper {
|
.home-projects-wrapper {
|
||||||
@include table-flex-child(0, 1200px, 0, 1200px);
|
@include table-flex-child(0, 1200px, 0, 1200px);
|
||||||
|
|
Loading…
Reference in New Issue