[issue #195] Fixed leave button. Added participant icons.
After Width: | Height: | Size: 941 B |
After Width: | Height: | Size: 939 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 667 B |
After Width: | Height: | Size: 667 B |
After Width: | Height: | Size: 818 B |
After Width: | Height: | Size: 818 B |
|
@ -670,3 +670,26 @@ table.tablesorter tr.search th input[type="text"] {
|
|||
width: 830px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
table.dataTable tr td.rights span.group {
|
||||
background: image-url('group16.png') no-repeat 0 0 transparent;
|
||||
}
|
||||
|
||||
table.dataTable tr td.rights span.user {
|
||||
background: image-url('user16.png') no-repeat 0 0 transparent;
|
||||
}
|
||||
|
||||
table.dataTable tr td.rights span.group_owner {
|
||||
background: image-url('group16g.png') no-repeat 0 0 transparent;
|
||||
}
|
||||
|
||||
table.dataTable tr td.rights span.user_owner {
|
||||
background: image-url('user16g.png') no-repeat 0 0 transparent;
|
||||
}
|
||||
|
||||
table.dataTable tr td.rights span.group_owner,
|
||||
table.dataTable tr td.rights span.user_owner,
|
||||
table.dataTable tr td.rights span.group,
|
||||
table.dataTable tr td.rights span.user {
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
|
|
@ -19,4 +19,16 @@ module ProjectsHelper
|
|||
def visibility_icon(visibility)
|
||||
visibility == 'open' ? 'unlock.png' : 'lock.png'
|
||||
end
|
||||
|
||||
def participant_class(alone_member, project)
|
||||
c = alone_member ? 'user' : 'group'
|
||||
c = 'user_owner' if project.owner == current_user
|
||||
c = 'group_owner' if project.owner.in? current_user.groups
|
||||
return c
|
||||
end
|
||||
|
||||
def alone_member?(project)
|
||||
urel = Relation.by_target(project).by_object(current_user)
|
||||
return urel.size == 0 ? false : true
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,8 +7,11 @@
|
|||
#{ ' / ' }
|
||||
= link_to project.name, project_path(project)
|
||||
%td.td2= project.description
|
||||
%td= t("layout.collaborators.role_names.#{project.relations.by_user_through_groups(current_user).first.role}")
|
||||
- alone_member = alone_member? project
|
||||
%td
|
||||
%span{:class => participant_class(alone_member, project)}
|
||||
= t("layout.collaborators.role_names.#{project.relations.by_user_through_groups(current_user).first.role}")
|
||||
%td.td5
|
||||
- unless project.owner == current_user
|
||||
- unless project.owner == current_user or !alone_member
|
||||
= link_to remove_user_project_path(project), :method => :delete, :confirm => t("layout.confirm") do
|
||||
%span.delete
|
||||
|
|
|
@ -7,7 +7,8 @@ json.project do |proj|
|
|||
|
||||
proj.role t("layout.collaborators.role_names.#{project.relations.by_user_through_groups(current_user).first.role}").force_encoding(Encoding::UTF_8)
|
||||
|
||||
proj.leave_link remove_user_project_path(project) unless project.owner == current_user
|
||||
proj.leave_link remove_user_project_path(project) unless project.owner == current_user or !alone_member? project
|
||||
proj.rights_class participant_class(alone_member?(project), project)
|
||||
|
||||
proj.owner do |owner|
|
||||
owner.name project.owner.uname
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
- columns = [{:type => 'html'},
|
||||
{:type => 'html', :sortable => false, :searchable => false},
|
||||
{:type => nil, :sortable => false, :searchable => false, :class => 'buttons'},
|
||||
{:type => nil, :sortable => false, :searchable => false, :class => 'rights'},
|
||||
{:type => nil, :sortable => false, :searchable => false, :class => 'buttons'}]
|
||||
-#= raw datatable(columns, {:sort_by => "[0, 'asc']", :search_label => t("layout.search_by_name"), :processing => t("layout.processing"),
|
||||
-# :pagination_labels => {:previous => t("datatables.previous_label"), :next => t("datatables.next_label")},
|
||||
|
@ -44,6 +44,12 @@
|
|||
'<div class="table-sort-right">' + owner + ' / ' + project + '<div>';
|
||||
}
|
||||
|
||||
var thirdColumn = function(row) {
|
||||
var project = row.project
|
||||
|
||||
return '<span class="' + project.rights_class + '">' + project.role + '</span>';
|
||||
}
|
||||
|
||||
var lastColumn = function(row) {
|
||||
var project = row.project
|
||||
var res = '';
|
||||
|
@ -63,7 +69,7 @@
|
|||
var inner = [];
|
||||
inner.push( firstColumn(data) );
|
||||
inner.push( data.project.description );
|
||||
inner.push( data.project.role );
|
||||
inner.push( thirdColumn(data) );
|
||||
inner.push( lastColumn(data) );
|
||||
res.push( inner );
|
||||
}
|
||||
|
@ -113,9 +119,7 @@
|
|||
return true;
|
||||
});
|
||||
$search.live('keyup', function() {
|
||||
if (this.value.length > 1) {
|
||||
oTable.fnFilter(this.value);
|
||||
}
|
||||
oTable.fnFilter(this.value);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
@ -39,6 +39,8 @@ en:
|
|||
message: Message
|
||||
author: Author
|
||||
|
||||
participant_type: Part. type
|
||||
|
||||
current_branch: Current branch/tag
|
||||
current_commit: Current commit
|
||||
files_in_project: Files in
|
||||
|
|
|
@ -39,6 +39,8 @@ ru:
|
|||
message: Сообщение
|
||||
author: Автор
|
||||
|
||||
participant_type: Тип участия
|
||||
|
||||
current_branch: Текущая ветка/тег
|
||||
current_commit: Текущий коммит
|
||||
files_in_project: Файлы в
|
||||
|
|