diff --git a/app/models.py b/app/models.py index afa0e40c6ba5de14758965298c3c970646557e4c..2cc6f0e3e1f2acb15689ebbdfb9c6122ee7a86fe 100644 --- a/app/models.py +++ b/app/models.py @@ -271,7 +271,7 @@ class Avatar(HashidMixin, FileMixin, db.Model): def to_json_serializeable(self, backrefs=False, relationships=False): json_serializeable = { - 'id': self.id + 'id': self.hashid } return json_serializeable diff --git a/app/static/js/RessourceLists/PublicUserList.js b/app/static/js/RessourceLists/PublicUserList.js index 4597ed3e2b97b410a5fdd372190b17795343e82f..f00e145d44747a35318ef12532adbe3557f6abd4 100644 --- a/app/static/js/RessourceLists/PublicUserList.js +++ b/app/static/js/RessourceLists/PublicUserList.js @@ -7,7 +7,6 @@ class PublicUserList extends RessourceList { static options = { initialHtmlGenerator: (id) => { - console.log(id); return ` <div class="input-field"> <i class="material-icons prefix">search</i> @@ -19,6 +18,10 @@ class PublicUserList extends RessourceList { <tr> <th style="width:15%;"></th> <th>Username</th> + <th>Full name</th> + <th>Location</th> + <th>Organization</th> + <th>Corpora online</th> <th></th> </tr> </thead> @@ -29,8 +32,12 @@ class PublicUserList extends RessourceList { }, item: ` <tr class="clickable hoverable"> - <td><img alt="user-image" class="circle responsive-img avatar" style="width:80%"></td> - <td><span class="username"></span></td> + <td><img alt="user-image" class="circle responsive-img avatar" style="width:50%"></td> + <td><b><span class="username"></span><b></td> + <td><span class="full-name"></span></td> + <td><span class="location"></span></td> + <td><span class="organization"></span></td> + <td><span class="corpora-online"></span></td> <td class="right-align"> <a class="action-button btn-floating waves-effect waves-light" data-action="view"><i class="material-icons">send</i></a> </td> @@ -40,8 +47,12 @@ class PublicUserList extends RessourceList { return { 'id': user.id, 'member-since': user.member_since, - 'avatar': `/static/images/user_avatar.png`, - 'username': user.username + 'avatar': user.avatar ? `/profile/${user.id}/avatars/${user.avatar.id}` : '/static/images/user_avatar.png', + 'username': user.username, + 'full-name': user.full_name ? user.full_name : '', + 'location': user.location ? user.location : '', + 'organization': user.organization ? user.organization : '', + 'corpora-online': '0' }; }, sortArgs: ['member-since', {order: 'desc'}], @@ -49,7 +60,11 @@ class PublicUserList extends RessourceList { {data: ['id']}, {data: ['member-since']}, {name: 'avatar', attr: 'src'}, - 'username' + 'username', + 'full-name', + 'location', + 'organization', + 'corpora-online' ] }; diff --git a/app/templates/main/dashboard.html.j2 b/app/templates/main/dashboard.html.j2 index eb504cb3b2082cc56ba0853d380f1ea43043a9e5..a7d642b78997de0ec0c6e8077d83147fac202e09 100644 --- a/app/templates/main/dashboard.html.j2 +++ b/app/templates/main/dashboard.html.j2 @@ -44,7 +44,7 @@ </div> <div class="col s12" id="social"> <h3>Social</h3> - <div class="col s6"> + <div class="col s12"> <div class="card"> <div class="card-content"> <span class="card-title">Other users and groups</span> @@ -53,7 +53,7 @@ </div> </div> </div> - <div class="col s6"> + <div class="col s12"> <div class="card"> <div class="card-content"> <span class="card-title">Public corpora</span>