mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-08 21:06:24 +08:00
Update sql and add accordion effect
This commit is contained in:
parent
dd3f2cb219
commit
9a64ebdfd0
5 changed files with 32 additions and 31 deletions
|
@ -75,7 +75,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.my-module-assigned-repositories {
|
#assigned-items-container {
|
||||||
.assigned-repository {
|
.assigned-repository {
|
||||||
border: $border-default;
|
border: $border-default;
|
||||||
border-radius: $border-radius-modal;
|
border-radius: $border-radius-modal;
|
||||||
|
@ -136,5 +136,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background: $color-concrete;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -206,10 +206,7 @@ class MyModule < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def assigned_repositories
|
def assigned_repositories
|
||||||
assigned_repositories_ids = repository_rows.group('repository_id')
|
Repository.where(id: repository_rows.select('DISTINCT(repository_id)'))
|
||||||
.select('repository_id')
|
|
||||||
.pluck('repository_id')
|
|
||||||
Repository.where(id: assigned_repositories_ids)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def unassigned_users
|
def unassigned_users
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
<div class="my-module-assigned-repositories">
|
|
||||||
<% @assigned_repositories.each do |repository| %>
|
|
||||||
<div class="assigned-repository">
|
|
||||||
<a class="assigned-repository-caret collapsed" role="button"
|
|
||||||
data-toggle="collapse"
|
|
||||||
href="#assigned-repository-items-container-<%= repository.id %>"
|
|
||||||
aria-expanded="false"
|
|
||||||
aria-controls="assigned-repository-items-container-<%= repository.id %>"
|
|
||||||
>
|
|
||||||
<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 %>
|
|
||||||
</div>
|
|
|
@ -38,8 +38,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/inventories/inventories_list" %>
|
<%= 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…
Add table
Reference in a new issue