2011-06-28 07:53:07 +08:00
<% content_for :page_title do %><%= join_title t(:page_title, "Collaboration"), @context.name %><% end %>
2011-02-01 09:57:29 +08:00
<% jammit_js :collaborations %>
<% content_for :right_side do %>
<div class="rs-margin-all">
2011-07-07 00:58:12 +08:00
<p><%= mt :description_rs, <<-HEREDOC, :google_url => "http://docs.google.com", :etherpad_url => "http://www.etherpad.org"
Free online web tools like [Google Docs](%{google_url}) and [EtherPad](%{etherpad_url})
2011-06-17 01:11:21 +08:00
are an excellent place for students to work on group projects or papers, take shared notes, etc.
Teacher *or* students can set up group collaborations.
HEREDOC
%>
2011-02-01 09:57:29 +08:00
</p>
<% if can_do(@context, @current_user, :create_collaborations) %>
2011-06-17 01:11:21 +08:00
<a href="#" class="add_collaboration_link button button-sidebar-wide"><%= image_tag "add.png" %> <%= t 'links.new', "Start a New Collaboration" %></a>
2011-02-01 09:57:29 +08:00
<% end %>
</div>
<% end %>
<a href="#" class="external_link" target="_blank" style="display: none;"> </a>
2011-06-17 01:11:21 +08:00
<h2><%= t 'titles.current', "Current Collaborations" %></h2>
2011-02-01 09:57:29 +08:00
<div id="no_collaborations_message" style="<%= hidden unless @collaborations.empty? %>">
<% if can_do(@context, @current_user, :manage_content) %>
2011-10-19 13:54:58 +08:00
<p><%= mt :description_teacher, <<-HEREDOC, :google_url => "http://docs.google.com", :etherpad_url => "http://www.etherpad.org"
2011-06-17 01:11:21 +08:00
**What do we mean by collaborations?** We're talking about web-based tools that most
likely your students are already familiar with. Students can use resources like
2011-07-07 00:58:12 +08:00
[Google Docs](%{google_url}) and [EtherPad](%{etherpad_url})
2011-06-17 01:11:21 +08:00
to work collaboratively on tasks like group papers or note-taking. This page gives them
(and you) an easy place to keep track of those collaborations, and also to set them
up without having to swap emails.
HEREDOC
2011-10-19 13:54:58 +08:00
%></p>
2011-02-01 09:57:29 +08:00
<% else %>
2011-10-19 13:54:58 +08:00
<p><%= mt :description_student, <<-HEREDOC, :google_url => "http://docs.google.com", :etherpad_url => "http://www.etherpad.org"
2011-06-17 01:11:21 +08:00
**What do we mean by collaborations?** We're talking about web-based tools for
working together on a shared document. You can use resources like
2011-07-07 00:58:12 +08:00
[Google Docs](%{google_url}) and [EtherPad](%{etherpad_url})
2011-06-17 01:11:21 +08:00
to work collaboratively on tasks like group papers or note-taking. This page is
an easy place to keep track of those collaborations, and also to set them
up without having to swap emails.
HEREDOC
2011-10-19 13:54:58 +08:00
%></p>
<% end %>
<% if can_do(@context, @current_user, :create_collaborations) %>
<p>
<%= t :how_to_start_a_new_collaboration, 'To find out more about a particular type of collaboration, click "Start a New Collaboration" and then choose that type in the dropdown list.' %>
</p>
2011-02-01 09:57:29 +08:00
<% end %>
</div>
<div id="collaborations">
<% @collaborations.each do |collaboration| %>
<% if can_do(collaboration, @current_user, :read) %>
2011-10-19 02:32:11 +08:00
<div class="collaboration <%= collaboration.style_class %> collaboration_<%= collaboration.id %>">
2011-02-01 09:57:29 +08:00
<% if can_do(collaboration, @current_user, :delete) %>
<div class="links">
2011-06-17 01:11:21 +08:00
<a href="<%= context_url(@context, :context_collaboration_url, collaboration.id) %>" title="<%= t 'links.edit', "Edit this Collaboration" %>" class="edit_collaboration_link no-hover"><%= image_tag "edit.png" %></a>
<a href="<%= context_url(@context, :context_collaboration_url, collaboration.id) %>" title="<%= t 'links.delete', "Delete this Collaboration" %>" class="delete_collaboration_link no-hover"><%= image_tag "delete.png" %></a>
2011-02-01 09:57:29 +08:00
</div>
<% end %>
<h3><a href="<%= context_url(@context, :context_collaboration_url, collaboration.id) %>" target="_blank" class="title"><%= collaboration.title %></a></h3>
<div style="margin-bottom: 5px;" class="description">
<%= collaboration.description %>
</div>
2011-10-19 05:54:42 +08:00
<%= t :collaborators_count, { :one => "*1 Collaborator* on %{service}", :other => "*%{count} Collaborators* on %{service}" },
2011-06-17 01:11:21 +08:00
:count => (collaboration.users + [collaboration.user]).compact.uniq.length,
2011-06-17 05:51:47 +08:00
:service => collaboration.service_name,
2011-06-17 01:11:21 +08:00
:wrapper => '<a href="#" class="toggle_collaborators_link">\1</a>' %>
<br/>
<span style="font-size: 0.8em;"><%= t :started_by, "Started by *%{user}*, %{at}",
:user => context_user_name(@context, collaboration.user),
2011-10-19 02:32:39 +08:00
:wrapper => "<a href=\"#{context_url(@context, :context_user_url, collaboration.user_id)}\" class=\"collaborator_link\">\\1</a>",
2011-06-17 01:11:21 +08:00
:at => datetime_string(collaboration.created_at) %></span>
2011-02-01 09:57:29 +08:00
<ul class="collaborators">
<li><b><%= context_user_name(@context, collaboration.user) %></b></li>
<% (collaboration.users.uniq - [collaboration.user]).each do |user| %>
<li>
<%= context_user_name(@context, user) %>
<span class="id" style="display: none;"><%= user.id %></span>
</li>
<% end %>
</ul>
</div>
<% end %>
<% end %>
</div>
<% if can_do(@context, @current_user, :create_collaborations) %>
<%= render :partial => 'collaborations/forms' %>
2011-10-19 05:54:42 +08:00
<% end %>