- breadcrumb :group, @group #group-area.panel.panel-default .panel-heading div style="display: flex; justify-content: space-between; align-items: center" h1.panel-title | Group name: = @group.name - if policy(@group).edit? = link_to 'edit', edit_group_path(@group), remote: true, class: 'btn btn-default' .panel-body#group-content-area section h2 | Introduction = simple_format @group.description section h3 | Member ul.list-group - @members.each do |m| li.list-group-item = m.nickname - if @group.member?(current_user) section h2 | Weekly Index - week_start_day = Date.today.at_beginning_of_week.yesterday table.table thead th.text-center | メンバー - 7.times do |d| th.text-center*{class: week_start_day == Date.today ? 'warning' : nil} = week_start_day + d tbody - # TODO: DRY tr.info td.text-center = current_user.nickname - 7.times do |d| - report = @group.reports.find_by(user: current_user, reported_at: week_start_day + d) td.text-center*{class: week_start_day + d === Date.today ? 'warning' : nil} - if report.present? = link_to '○', [@group, report] - else = link_to '×', new_group_report_path(group_id: @group.id, report: {reported_at: week_start_day + d}) - @group.members.where.not(id: current_user.id).each do |member| tr td.text-center = member.nickname - 7.times do |d| - report = @group.reports.find_by(user: member, reported_at: week_start_day + d) td.text-center*{class: week_start_day + d == Date.today ? 'warning' : nil} - if report.present? = link_to '○', [@group, report] - else | × section - if @group.member?(current_user) section h2 | recently activity ul.list-group - @reports.each do |report| li.list-group-item = link_to report.title, [@group, report] .btn-group = link_to 'more', group_reports_path(group_id: @group.id), class: 'btn btn-link' = link_to 'new report', new_group_report_path(group_id: @group.id), class: 'btn btn-link' section h2 | requests ul.list-group - @requests.each do |request| li.list-group-item id="request_#{request.id}" = request.user.nickname | = link_to 'accept', group_member_relation_accept_path(group_member_relation_id: request.id), method: :post, remote: true, id: "link-to-accept-request_#{request.id}" = link_to 'more', unaccepted_group_group_member_relations_path(group_id: @group.id), class: 'btn btn-link' = link_to 'invite_member', new_group_group_member_relation_path(group_id: @group.id), class: 'btn btn-link' - else h2 | Join us? = render 'link_to_join', group: @group, class: 'btn btn-link'