scinote-web/app/views/user_my_modules/_index_edit.html.erb

57 lines
2 KiB
Text
Raw Normal View History

2016-02-12 23:52:43 +08:00
<ul class="no-style">
<% if @user_my_modules.size == 0 then %>
<li><em><%= t 'experiments.canvas.full_zoom.modal_manage_users.no_users' %></em></li>
2016-02-12 23:52:43 +08:00
<% else %>
<% @user_my_modules.each_with_index do |umm, i| user = umm.user %>
<li>
<% if i > 0 %><hr><% end %>
<div class="row">
<div class="col-xs-2">
<span class='global-avatar-container'>
<%= image_tag avatar_path(user, :icon_small), class: 'img-circle pull-left' %>
</span>
2016-02-12 23:52:43 +08:00
</div>
<div class="col-xs-4" style="line-height: 15px">
2016-02-12 23:52:43 +08:00
<span><%= user.full_name %></span>
<br><span class="text-muted" title="<%=t "experiments.canvas.full_zoom.modal_manage_users.user_join_full", user: user.full_name, date: l(umm.created_at, format: :full_date), time: l(umm.created_at, format: :time) %>">
<em><%=t "experiments.canvas.full_zoom.modal_manage_users.user_join", date: l(umm.created_at, format: :full_date) %></em>
2016-02-12 23:52:43 +08:00
</span>
</div>
<% if can_manage_my_module?(@my_module) %>
2016-02-12 23:52:43 +08:00
<div class="col-xs-2">
2023-06-19 21:45:22 +08:00
<%= link_to my_module_user_my_module_path(@my_module, umm, format: :json), method: :delete, remote: true, class: 'btn btn-light remove-user-link' do %>
2023-06-08 23:33:50 +08:00
<span class="sn-icon sn-icon-close"></span>
2016-02-12 23:52:43 +08:00
<% end %>
</div>
<% end %>
</div>
</li>
<% end %>
<% end %>
<% if can_manage_my_module?(@my_module) && @undesignated_users.any? %>
2016-02-12 23:52:43 +08:00
<li>
<hr>
<div class="row">
2023-08-09 21:47:33 +08:00
<%= form_with model: [@my_module, @new_um], data: { remote: true }, format: :json, html: { class: 'add-user-form' } do |f| %>
2016-02-12 23:52:43 +08:00
<div class="col-xs-4">
<%= collection_select(:user_my_module, :user_id, @undesignated_users, :id, :full_name, {}, { class: 'selectpicker' }) %>
2016-02-12 23:52:43 +08:00
</div>
<div class="col-xs-2">
<%= f.button class: 'btn btn-primary' do %>
2023-06-08 14:33:37 +08:00
<span class="sn-icon sn-icon-new-task"></span>
<span class="hidden-xs"><%= t("experiments.canvas.full_zoom.modal_manage_users.create") %></span>
2016-02-12 23:52:43 +08:00
<% end %>
</div>
<% end %>
</div>
</li>
<% end %>
</ul>