Initial commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
var $ = require('jquery');
|
||||
var template = require('./dropdown.tpl');
|
||||
var DropdownAdminView = require('dashboard/components/dropdown/dropdown-admin-view');
|
||||
|
||||
/**
|
||||
* The content of the dropdown menu opened by the user avatar in the top-right of the header, e.g.:
|
||||
* Explore, Learn, ♞
|
||||
* ______/\____
|
||||
* | |
|
||||
* | this |
|
||||
* |____________|
|
||||
*/
|
||||
|
||||
module.exports = DropdownAdminView.extend({
|
||||
className: 'CDB-Text Dropdown',
|
||||
|
||||
render: function () {
|
||||
var user = this.model;
|
||||
var userUrl = user.viewUrl();
|
||||
|
||||
this.$el.html(template({
|
||||
name: user.fullName() || user.get('username'),
|
||||
email: user.get('email'),
|
||||
isOrgOwner: user.isOrgOwner(),
|
||||
dashboardUrl: userUrl.dashboard(),
|
||||
publicProfileUrl: userUrl.publicProfile(),
|
||||
accountProfileUrl: userUrl.accountProfile(),
|
||||
logoutUrl: userUrl.logout()
|
||||
}));
|
||||
|
||||
// TODO: taken from existing code, how should dropdowns really be added to the DOM?
|
||||
$('body').append(this.el);
|
||||
|
||||
return this;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,20 @@
|
||||
<ul class="SettingsDropdown">
|
||||
<li>
|
||||
<div class="SettingsDropdown-sameline">
|
||||
<p class="CDB-Text CDB-Size-medium"><%- name %></p>
|
||||
</div>
|
||||
<p class="CDB-Text CDB-Size-medium u-altTextColor u-tSpace u-ellipsis">
|
||||
<%- email %>
|
||||
</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="BreadcrumbsDropdown-listItem is-dark CDB-Text CDB-Size-medium">
|
||||
<ul>
|
||||
<li class="u-bSpace--m"><a href="<%- dashboardUrl %>">Your dashboard</a></li>
|
||||
<li class="u-bSpace--m"><a href="<%- publicProfileUrl %>">Your public profile</a></li>
|
||||
<li class="u-bSpace--m"><a href="<%- accountProfileUrl %>">Account settings</a></li>
|
||||
<li><a href="<%- logoutUrl %>">Close session</a></li>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
Reference in New Issue
Block a user