<% # Copyright (C) 2011 - present Instructure, Inc. # # This file is part of Canvas. # # Canvas is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, version 3 of the License. # # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see . %> <% provide :page_title do %><%= join_title t(:page_title, 'Course Groups'), @context.name %><% end %> <% if !@context.is_a?(Account) %> <% js_env :course_id => @context.id, :STUDENT_CAN_ORGANIZE_GROUPS_FOR_COURSE => @context.respond_to?(:allow_student_organized_groups) && @context.allow_student_organized_groups && can_do(@context.groups.temp_record, @current_user, :create), :CAN_VIEW_PAGES => @context.grants_right?(@current_user, :view_group_pages) %> <% js_bundle :groups %> <% else %>

<%= @context.is_a?(Account) ? t('account_groups', 'Account Groups') : t('course_groups', 'Course Groups') %>

<%= t 'group_explanation', <<~TEXT Groups are a good place to collaborate on projects or to figure out schedules for study sessions and the like. Every group gets a calendar, a wiki, discussions, and a little bit of space to store files. Groups can collaborate on documents, or even schedule web conferences. It's really like a mini-course where you can work with a smaller number of students on a more focused project. TEXT %>

    <%= render :partial => 'group', :collection => @user_groups, :locals => {:in_group => true} %> <%= render :partial => 'group', :object => nil, :locals => {:in_group => true} %>
<% if @available_groups && !@available_groups.empty? %>

<%= t 'headings.available_groups', "Available Groups" %>

    <%= render :partial => 'group', :collection => @available_groups, :locals => {:in_categories => @user_groups.map{ |g| g.group_category }.compact.uniq, :in_group => false} %>
<% end %> <%= form_for :group, :url => context_url(@context, :context_groups_url), :html => {:id => "add_group_form", :style => "display: none;"} do |f| %>

<%= t 'headings.new_group', 'Make a New Group' %>

<%= image_tag "warning.png", :alt => '' %> <%= t :student_group_warning, <<~TEXT If your teacher has talked about putting you into groups as part of an assignment, this is not the way to make that happen. Groups you organize yourself can't be used for grading... you can still form your own groups, but you won't be able to turn in an electric copy of any assignments unless your teacher builds the groups for you. TEXT %> <% if @context %> <% end %>
<%= f.blabel :name, :en => "Group Name" %> <%= f.text_field :name %>
<%= before_label :restrictions_for_joining_groups, 'Joining' %>
<%= before_label :users_to_invite, 'Invite' %>
    <% (@context.users - [@current_user]).each do |user| %>
  • <%= check_box :invitees, "#{user.id}".to_sym, :value => user.id %> <%= label :invitees, "#{user.id}".to_sym, context_user_name(@context, user) %>
  • <% end %>
<% end %> <% end %>