mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-28 11:14:24 +08:00
Merge pull request #2503 from aignatov-bio/ai-sci-4507-add-assigned-repositories-list
Add assigned repositories list [SCI-4507]
This commit is contained in:
commit
fc810b5524
5 changed files with 99 additions and 2 deletions
|
@ -74,3 +74,71 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#assigned-items-container {
|
||||||
|
.assigned-repository {
|
||||||
|
border: $border-default;
|
||||||
|
border-radius: $border-radius-modal;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
|
||||||
|
.assigned-repository-caret {
|
||||||
|
align-items: center;
|
||||||
|
color: inherit;
|
||||||
|
display: flex;
|
||||||
|
height: 52px;
|
||||||
|
padding: 0 18px;
|
||||||
|
text-decoration: none;
|
||||||
|
|
||||||
|
&:hover,
|
||||||
|
&:active {
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:not(.collapsed) .fa-caret-right {
|
||||||
|
@include rotate(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fa-caret-right {
|
||||||
|
flex-shrink: 0;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.assigned-repository-title {
|
||||||
|
@include font-h3;
|
||||||
|
overflow: hidden;
|
||||||
|
padding-right: 55px;
|
||||||
|
position: relative;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
color: $color-alto;
|
||||||
|
content: attr(data-rows-count);
|
||||||
|
display: inline-block;
|
||||||
|
line-height: 22px;
|
||||||
|
padding-left: 5px;
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
width: 55px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-buttons {
|
||||||
|
flex-grow: 1;
|
||||||
|
flex-shrink: 0;
|
||||||
|
text-align: right;
|
||||||
|
|
||||||
|
.fas {
|
||||||
|
cursor: pointer;
|
||||||
|
line-height: 36px;
|
||||||
|
text-align: center;
|
||||||
|
width: 36px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: $color-concrete;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -271,6 +271,7 @@ class MyModulesController < ApplicationController
|
||||||
current_team,
|
current_team,
|
||||||
Constants::RECENT_PROTOCOL_LIMIT
|
Constants::RECENT_PROTOCOL_LIMIT
|
||||||
).any?
|
).any?
|
||||||
|
@assigned_repositories = @my_module.assigned_repositories
|
||||||
current_team_switch(@protocol.team)
|
current_team_switch(@protocol.team)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -205,6 +205,10 @@ class MyModule < ApplicationRecord
|
||||||
.count
|
.count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def assigned_repositories
|
||||||
|
Repository.where(id: repository_rows.select('DISTINCT(repository_id)'))
|
||||||
|
end
|
||||||
|
|
||||||
def unassigned_users
|
def unassigned_users
|
||||||
User.find_by_sql(
|
User.find_by_sql(
|
||||||
"SELECT DISTINCT users.id, users.full_name FROM users " +
|
"SELECT DISTINCT users.id, users.full_name FROM users " +
|
||||||
|
|
|
@ -43,8 +43,8 @@
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="collapse" id="assigned-items-container">
|
<div class="collapse panel-group" id="assigned-items-container">
|
||||||
...
|
<%= render partial: "my_modules/repositories/repositories_list" %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Protocol -->
|
<!-- Protocol -->
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<% @assigned_repositories.each do |repository| %>
|
||||||
|
<div class="assigned-repository panel">
|
||||||
|
<a class="assigned-repository-caret collapsed"
|
||||||
|
role="button"
|
||||||
|
data-toggle="collapse"
|
||||||
|
href="#assigned-repository-items-container-<%= repository.id %>"
|
||||||
|
data-parent="#assigned-items-container"
|
||||||
|
>
|
||||||
|
<i class="fas fa-caret-right"></i>
|
||||||
|
<span class="assigned-repository-title" data-rows-count="[<%= @my_module.repository_rows_count(repository) %>]">
|
||||||
|
<%= repository.name %>
|
||||||
|
</span>
|
||||||
|
<div class="action-buttons">
|
||||||
|
<i class="fas fa-expand full-screen"></i>
|
||||||
|
<i class="fas fa-trash unassign-repository"></i>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
<div class="collapse"
|
||||||
|
id="assigned-repository-items-container-<%= repository.id %>"
|
||||||
|
>
|
||||||
|
Repository table
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<% end %>
|
Loading…
Reference in a new issue