app/views/user_accounts/sites.html.haml
- content_for :meta_title, "Sites #{@user.user_name} can access"
- content_for(:page_title) do
Sites
%small
accessible by
= image_tag @user.image.url(:spanhalf), alt: @user.user_name
= @user.user_name
- @info_bar = {title: t('baw.shared.links.profile_projects.title'), icon: 'map-marker'}
- set_current_menu_item(:my_profile, {href: sites_user_account_path(@user),
title: t('baw.shared.links.profile_sites.title'),
tooltip: t('baw.shared.links.profile_sites.description', user_name: @user.user_name),
icon: 'map-marker' })
= render partial: 'shared/sidebar_user', locals: {user_show: @user, user_current: current_user}
.col-sm-12
%p= page_entries_info @user_sites
= paginate @user_sites
%table.table.table-striped.table-hover
%thead
%tr
%th
%span.fa.fa-map-marker{aria: {hidden: 'true' }}
Site
%th
%span.fa.fa-calendar{aria: {hidden: 'true' }}
Recent Audio Upload
%th
%span.fa.fa-key{aria: {hidden: 'true' }}
Permission
%th
%span.fa.fa-bullseye{aria: {hidden: 'true' }}
Annotations
%tbody
- @user_sites.each do |site|
- projects = site.projects.to_a
- is_in_project = !projects.nil? && projects.size > 0
%tr
%td= site.name
%td
- recording = site.most_recent_recording
= recording.nil? ? '(none)' : format_sidebar_datetime(recording.recorded_date)
%td
- if is_in_project
- actual_levels = Access::Core.user_levels(@user, site.projects.includes(:creator).references(:creator))
- actual_level = Access::Core.highest(actual_levels)
- level_name = Access::Core.get_level_name(actual_level)
- if Access::Core.allowed?(:owner, actual_level)
= link_to level_name, project_permissions_path(site.projects[0])
- else
= level_name
- else
(not in a project)
%th
- if is_in_project
= link_to make_site_annotations_path(site.projects[0], site), target: '_self', class: 'btn btn-default btn-xs' do
%span.fa.fa-download{aria: {hidden: 'true'}}
Download