Commit 98b7717d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Remove user decorator

parent 568ce1ed
...@@ -111,22 +111,10 @@ span.update-author { ...@@ -111,22 +111,10 @@ span.update-author {
} }
.label { .label {
padding: 0px 4px; padding: 1px 4px;
font-size: 10px; font-size: 12px;
font-style: normal; font-style: normal;
background-color: $link_color; font-weight: normal;
&.label-success {
background-color: #8D8;
color: #333;
text-shadow: 0 1px 1px white;
}
&.label-error {
background-color: #D88;
color: #333;
text-shadow: 0 1px 1px white;
}
} }
form { form {
......
class Admin::Teams::MembersController < Admin::Teams::ApplicationController class Admin::Teams::MembersController < Admin::Teams::ApplicationController
def new def new
@users = User.potential_team_members(user_team) @users = User.potential_team_members(user_team)
@users = UserDecorator.decorate_collection @users
end end
def create def create
......
...@@ -32,7 +32,7 @@ class MilestonesController < ProjectResourceController ...@@ -32,7 +32,7 @@ class MilestonesController < ProjectResourceController
def show def show
@issues = @milestone.issues @issues = @milestone.issues
@users = UserDecorator.decorate_collection(@milestone.participants) @users = @milestone.participants
@merge_requests = @milestone.merge_requests @merge_requests = @milestone.merge_requests
respond_to do |format| respond_to do |format|
......
...@@ -8,7 +8,6 @@ class Teams::MembersController < Teams::ApplicationController ...@@ -8,7 +8,6 @@ class Teams::MembersController < Teams::ApplicationController
def new def new
@users = User.potential_team_members(user_team) @users = User.potential_team_members(user_team)
@users = UserDecorator.decorate_collection @users
end end
def create def create
......
class UserDecorator < ApplicationDecorator
decorates :user
def avatar_image size = 16
h.image_tag h.gravatar_icon(self.email, size), class: "avatar #{"s#{size}"}", width: size
end
def tm_of(project)
project.team_member_by_id(self.id)
end
end
...@@ -373,4 +373,8 @@ class User < ActiveRecord::Base ...@@ -373,4 +373,8 @@ class User < ActiveRecord::Base
def name_with_username def name_with_username
"#{name} (#{username})" "#{name} (#{username})"
end end
def tm_of(project)
project.team_member_by_id(self.id)
end
end end
...@@ -34,6 +34,6 @@ ...@@ -34,6 +34,6 @@
= render 'votes/votes_inline', votable: issue = render 'votes/votes_inline', votable: issue
%span %span
- issue.labels.each do |label| - issue.labels.each do |label|
%span.label %span.label.label-info
%i.icon-tag %i.icon-tag
= label.name = label.name
...@@ -88,7 +88,6 @@ ...@@ -88,7 +88,6 @@
%div %div
- @users.each do |user| - @users.each do |user|
= link_to user, class: 'float-link' do = link_to user, class: 'float-link' do
= user.avatar_image = link_to_member(@project, user)
= user.name
.clearfix .clearfix
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment