scinote-web/app/views/user_my_modules/_index.html.erb
aignatov-bio 3ec49ec1a3
Fix helpers for designated users (#3621)
Co-authored-by: Anton <anton@scinote.net>
2021-10-29 12:49:38 +02:00

21 lines
1.1 KiB
Text

<div class="select-user-container">
<%= select_tag 'user_my_modules',
options_for_select(my_module.user_my_modules.map{ |um|
user = um.user
[
user.full_name,
user.id,
{'data-params' => {avatar_url: avatar_path(user, :icon_small), user_module_id: um.id }.to_json}
]
}),
{
id: 'module-assigned-users-selector',
'data-module-id': my_module.id,
'data-project-id': my_module.experiment.project_id,
'data-placeholder': t('my_modules.details.no_assigned_users'),
'data-users-create-url': my_module_user_my_modules_path(my_module_id: my_module.id),
'data-ajax-url': search_my_module_user_my_module_path(my_module),
'data-update-module-users-url': my_module_user_my_modules_url(my_module),
'data-view-mode': !can_manage_my_module?(my_module)
} %>
</div>