Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
17aba41b
Commit
17aba41b
authored
Nov 29, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Complete first iteration of link-to-member-avatar.
parent
4e15a927
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
app/assets/javascripts/vue_common_component/link_to_member_avatar.js.es6
...scripts/vue_common_component/link_to_member_avatar.js.es6
+56
-0
No files found.
app/assets/javascripts/vue_common_component/link_to_member_avatar.js.es6
0 → 100644
View file @
17aba41b
/* Analogue of link_to_member_avatar in app/helpers/projects_helper.rb
TODO: Support gravatar link generation, adding name text, username text
TODO: 1:1 configuration compared to link_to_member_avatar
TODO: Backport to CE
*/
Vue.component('link-to-member-avatar', {
props: {
avatarUrl: {
type: String,
required: false
},
username: {
type: String,
required: true
},
displayName: {
type: String,
required: true,
},
avatarClass: {
type: String,
default: 'avatar avatar-inline s48',
required: false,
},
linkClass: {
type: String,
default: 'author_link has-tooltip',
required: false,
},
size: {
type: Number,
default: 48,
required: false
}
},
data() {
return {
noAvatarUrl: '/assets/no_avatar.png'
};
},
computed: {
userProfileUrl() {
return `/${this.username}`;
},
preppedAvatarUrl() {
return this.avatarUrl || this.noAvatarUrl;
}
},
template: `
<a :href='userProfileUrl' :class='linkClass' :data-original-title='displayName' data-container='body'>
<img :class='avatarClass' :src='preppedAvatarUrl' :width='size' :height='size' :alt='displayName'/>
</a>
`
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment