getting started i18n

Change-Id: I46273d11738a5fe74174017f78adc9658757233b
Reviewed-on: https://gerrit.instructure.com/4153
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
This commit is contained in:
JT Olds 2011-06-10 10:05:45 -06:00
parent ef719f39a6
commit 17f75954aa
12 changed files with 159 additions and 227 deletions

View File

@ -29,12 +29,13 @@ class GettingStartedController < ApplicationController
def require_course_creation_auth
if params[:getting_started_code] && (auth_code = @domain_root_account.authorization_codes.find_by_authorization_code(params[:getting_started_code]))
session[:course_creation_auth] = true
# TODO i18n
session[:course_creation_account_id] = auth_code.associated_account_id || @domain_root_account.sub_accounts.find_or_create_by_name("Manually-Created Courses").id rescue nil
end
if session[:course_creation_auth] != true && @domain_root_account.require_authorization_code
respond_to do |format|
format.html { render :action => "authorization_code" }
format.json { render :json => {:errors => {:base => "Unauthorized"}}.to_json }
format.json { render :json => {:errors => {:base => t(:unauthorized, "Unauthorized")}}.to_json }
end
return false
end
@ -81,7 +82,7 @@ class GettingStartedController < ApplicationController
redirect_to course_url(@context)
else
session[:return_to] = course_url(@context)
flash[:notice] = "Course created! You'll need to log in or register to claim this course."
flash[:notice] = t :course_created_notice, "Course created! You'll need to log in or register to claim this course."
redirect_to course_url(@context)
end
end
@ -104,6 +105,7 @@ class GettingStartedController < ApplicationController
def set_course
# create_unique finds or creates, but always returns a context
session[:course_uuid] = nil if params[:fresh]
# TODO i18n
@context = Course.create_unique(session[:course_uuid], session[:course_creation_account_id] || @domain_root_account.sub_accounts.find_or_create_by_name("Manually-Created Courses").id, @domain_root_account.id)
if session[:course_uuid] != @context.uuid && @current_user
if params[:teacherless]

View File

@ -487,46 +487,7 @@
<div class="teacherless_invite_message" style="<%= hidden unless @context.teacherless? %> font-size: 0.8em;">
If you invite a teacher and they accept, you will give up administrative priveleges for this course.
</div>
<div id="email_list_boxes">
<a id="email_lists_path" style="display:none;" href="<%= url_for email_lists_path(:format => :json) %>"></a>
<div id="user_emails_textarea_container" style="z-index: 2;">
<span style="font-size: 0.8em;">Copy and paste a list of email addresses to add users to this course.</span>
<textarea name="user_emails" class="user_emails"></textarea>
</div>
<div id="user_emails_parsed" style="z-index: 1; display:none;">
<div class="ui-helper-reset ui-widget-content ui-corner-all" id="email_lists_processed_people">
<div id="user_emails_duplicates_found" class="ui-widget">
<div class="ui-state-highlight ui-corner-all">
<p>
<span style="float: left; margin-right: 0 0.3em;" class="ui-icon ui-icon-info"></span>
<strong>Notice:</strong> <strong class='duplicate_count'>???</strong> duplicate address<span class="duplicates_plurality">es</span> found, duplicates have been removed.
</p>
</div>
</div>
<div id="user_emails_no_valid_emails" class="ui-widget">
<div class="ui-state-highlight ui-corner-all">
<p><span style="float: left; margin-right: 0 0.3em;" class="ui-icon ui-icon-info"></span>
<strong>Sorry,</strong> it does not seem as if there were any valid email addresses typed in, please go back and try again.</p>
</div>
</div>
<div id="user_emails_with_errors" class="ui-widget">
<div class="ui-state-highlight ui-corner-all">
<p>
<span style="float: left; margin-right: 0 0.3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> There were <strong class="errors_count">???</strong> errors parsing that list of emails. There may be some that
were invalid, you might need to go back and fix any errors. If you proceed as is, <strong class="addresses_count">???</strong>
users will be added.
</p>
</div>
</div>
<div class="person ui-helper-reset ui-state-default ui-corner-all" id="email_lists_processed_person_template" style="display:none;">
<div class="name">Last, First</div>
<div class="address">user@domain.com</div>
</div>
</div>
</div>
</div>
<%= render :partial => 'shared/email_lists' %>
<% unless @context.available? %>
<div style="font-size: 0.8em;">
<i>Since the course hasn't been published, students and TA's will be added, but won't be

View File

@ -1,23 +1,23 @@
<li style="<%= student ? "" : "display: none;" %>" id="student_<%= student ? student.id : "blank" %>" class="student">
<div style="float: left;">
<div class="editing">
<input type="text" name="name" value="<%= student.name rescue "" %>" title="Student Name"/>
<input type="text" name="name" value="<%= student.name rescue "" %>" title="<%= t :student_name_title, "Student Name" %>"/>
</div>
<div class="showing">
<span class="name" style="padding-right: 10px;" title="Click to Edit Name"><%= student && student.name ? student.name : "New Student" %></span>
<span class="name" style="padding-right: 10px;" title="<%= t :edit_name_title, "Click to Edit Name" %>"><%= student && student.name ? student.name : t(:new_student_name, "New Student") %></span>
</div>
</div>
<div style="float: right;" class="links">
<div class="showing">
<% id = student ? student.student_enrollments.find_by_course_id(@context.id) : "{{ id }}"%>
<a href="<%= context_url(@context, :context_unenroll_url, :id => id) %>" class="delete_student_link" title="Remove this Student">&#215;</a>
<a href="<%= context_url(@context, :context_unenroll_url, :id => id) %>" class="delete_student_link" title="<%= t :remove_student_title, "Remove this Student" %>">&#215;</a>
</div>
<div class="editing">
<button type="button" class="button small-button save_name_button">Ok</button>
<button type="button" class="button small-button save_name_button"><%= t "#buttons.okay", "Okay" %></button>
</div>
</div>
<div style="float: right; margin-right: 30px;">
&lt;<span class="email"><%= student && student.email ? student.email : "no email" %></span>&gt;
&lt;<span class="email"><%= student && student.email ? student.email : t(:missing_email, "no email") %></span>&gt;
</div>
<div class="clear"></div>
</li>

View File

@ -3,29 +3,29 @@
%>
<ul id="wizard-steps" style='display:none;'>
<li class="first <%= "active" if view == 'name' %>"><a href="<%= url_for :action => "name" %>">
<span class="title">Step 1</span>
<span class="subtitle">Course Name</span>
<span class="title"><%= t :step1, "Step 1" %></span>
<span class="subtitle"><%= t :course_name, "Course Name" %></span>
</a>
</li>
<li class="<%= "active" if view == 'assignments' %>"><a href="<%= url_for :action => "assignments" %>">
<span class="title">Step 2</span>
<span class="subtitle">Assignments</span>
<span class="title"><%= t :step2, "Step 2" %></span>
<span class="subtitle"><%= t :assignments, "Assignments" %></span>
</a>
</li>
<li class="<%= "active" if view == 'students' %>"><a href="<%= url_for :action => "students" %>">
<span class="title">Step 3</span>
<span class="subtitle">Students</span>
<span class="title"><%= t :step3, "Step 3" %></span>
<span class="subtitle"><%= t :students, "Students" %></span>
</a>
</li>
<li class="<%= "active" if view == 'setup' %>"><a href="<%= url_for :action => "setup" %>">
<span class="title">Step 4</span>
<span class="subtitle">Review &amp; Save</span>
<span class="title"><%= t :step4, "Step 4" %></span>
<span class="subtitle"><%= t :review_and_save, "Review and Save" %></span>
</a>
</li>
<li id="hide-scratch" style="<%= hidden if hide_scratch %>">
<%= link_to "Start From Scratch", getting_started_url(:fresh => 1) %>
<%= link_to t(:start_from_scratch, "Start From Scratch"), getting_started_url(:fresh => 1) %>
<% if @context && session[:saved_course_uuid] == @context.uuid %>
| <%= link_to "Visit Course Page", course_url(@context) %>
| <%= link_to t(:visit_course_page, "Visit Course Page"), course_url(@context) %>
<% end %>
</li>
</ul>
@ -37,4 +37,4 @@
$("#wizard-steps").chevronCrumbs();
});
</script>
<% end %>
<% end %>

View File

@ -1,33 +1,30 @@
<% content_for :page_title do %>Try It: Assignments<% end %>
<% content_for :page_title do %><%= before_label :try_it_title, "Try It" %> <%= t "#titles.assignments", "Assignments" %><% end %>
<%= render :partial => 'wizard_secondary_nav', :locals => {:view => 'assignments'} %>
<% content_for :right_side do %>
<div class="rs-margin-lr rs-margin-top">
<p>Not ready to create your assignments? Feel free to skip this step, you can
always come back to it later after your course is set up.
<p><%= t :skip_assignments_notice, "Not ready to create your assignments? Feel free to skip this step, you can always come back to it later after your course is set up." %></p>
<p>
<a href="#" class="wizard_popup_link help <%= 'was_auto_open' if @assignments.empty? %>"><%= t :how_do_i, "How Do I...?" %></a>
</p>
<p>
<a href="#" class="wizard_popup_link help <%= 'was_auto_open' if @assignments.empty? %>">How Do I...?</a>
</p>
<p>
<a href="<%= context_url(@context, :new_context_assignment_url) %>" class="add_assignment_link add groupless_link">
Add Assignment
</a> to
<% ot :add_assignment_link, "*Add Assignment* to %{group_name}", :group_name => capture { %>
<select class="assignment_groups_select">
<% @groups.each do |group| %>
<option value="<%= group.id %>"><%= group.name %></option>
<% end %>
</select>
<% }, :wrapper => "<a href=\"#{context_url(@context, :new_context_assignment_url)}\" class=\"add_assignment_link add groupless_link\">\\1</a>" %>
<br/>
<a href="#" class="add_group_link add"> Add Assignment Group</a>
<a href="#" class="add_group_link add"> <%= t :add_assignment_group_link, "Add Assignment Group" %></a>
</p>
<%= render :partial => 'assignments/group_weights', :locals => {:editable => can_do(@context, @current_user, :manage_grades)} %>
</div>
<div class="rs-margin-lr" style="text-align: right; white-space:nowrap;">
<a href="<%= url_for :action => "name" %>" class="previous_step_button button small-button">Previous</a>
<a href="<%= url_for :action => "students" %>" class="next_step_button button big-button">Next Step: Students</a>
<div style="margin-top: 5px; margin-right: 5px;"><a href="<%= context_url(@context, :context_url) %>" class="save_button button button-secondary">Save &amp; Skip the Rest</a></div>
<a href="<%= url_for :action => "name" %>" class="previous_step_button button small-button"><%= t "#buttons.previous", "Previous" %></a>
<a href="<%= url_for :action => "students" %>" class="next_step_button button big-button"><%= t :student_next_step_link, "Next Step: Students" %></a>
<div style="margin-top: 5px; margin-right: 5px;"><a href="<%= context_url(@context, :context_url) %>" class="save_button button button-secondary"><%= t :save_and_skip, "Save & Skip the Rest" %></a></div>
</div>
<% end %>
@ -35,7 +32,7 @@
<div style="margin-bottom: 10px; padding-left: 20px; " id="class_weighting_box">
<input type="checkbox" id="class_weighting_policy" name="class_weighting_policy" <%= "checked" if @context.group_weighting_scheme == 'percent' %>/>
<label for="class_weighting_policy">Weight the final grade based on assignment groups</label>
<label for="class_weighting_policy"><%= t :grade_weight_label, "Weight the final grade based on assignment groups" %></label>
<a href="<%= url_for (@context) %>" class="context_url" style="display: none;">&nbsp;</a>
</div>
<div id="groups" class="groups_editable">
@ -43,21 +40,16 @@
</div>
<% if @groups.length == 1 %>
<% if @context.teacherless? %>
<p style="margin-top: 30px;">Nicely done. Next you'll want to define the
assignments for your course. Most classes base grades either on straight
points, or points according to types (50% of your grade is from tests, 20%
is from papers, etc.). In Canvas you add assignments, quizzes, or whatever
into groups and optionally weight those groups. Build your Canvas
course to match the grading scheme of your actual course, and we'll take
care of computing your final grade for you.
<p style="margin-top: 30px;"><%= t :grade_groups_notice, "Nicely done. Next you'll want to define the assignments for your course. Most classes base grades either on straight points, or points according to types (50% of your grade is from tests, 20% is from papers, etc.). In Canvas you add assignments, quizzes, or whatever into groups and optionally weight those groups. Build your Canvas course to match the grading scheme of your actual course, and we'll take care of computing your final grade for you." %></p>
<% else %>
<p style="margin-top: 30px;"><b>Now we're getting somewhere!</b> Next you'll want to add
<p style="margin-top: 30px;">
<%= t :default_group_notice, "*Now we're getting somewhere!* Next you'll want to add
your course assignments. Assignments are organized into groups (quizzes, papers, etc.),
and each group can be weighted to count as a percentage of the final score. We've added a
default group above to get you started. You can add assignments to it by clicking the plus icon,
or use the links to the right to create your own groups.</p>
or use the links to the right to create your own groups.", :wrapper => "<b>\1</b>" %></p>
<% end %>
<p>Confused? Click the "How Do I...?" link to the right for more help.</p>
<p><%= t :confused_notice, "Confused? Click the \"How Do I...?\" link to the right for more help." %></p>
<% end %>
<%= render :partial => "shared/assignment_group", :object => nil %>
<%= render :partial => "shared/assignment", :object => nil %>

View File

@ -1,17 +1,16 @@
<% content_for :page_title do %>Try It: Enter Code<% end %>
<% content_for :page_title do %><%= before_label :try_it_title, "Try It" %> <%= t "#titles.enter_code", "Enter Code" %><% end %>
<%= render :partial => 'wizard_secondary_nav' %>
<div style="width: 300px; margin-left: auto; margin-right: auto; margin-top: 20px;">
<h2>Authorization Code</h2>
Before you can continue, you need to enter your authorization code. You should
have been given this code either by Instructure or by your administrator.
<h2><%= t "#titles.authorization_code", "Authorization Code" %></h2>
<%= t :authorization_code_notice, "Before you can continue, you need to enter your authorization code. You should have been given this code either by Instructure or by your administrator." %>
<form action="<%= getting_started_url((params[:teacherless] ? {:teacherless => params[:teacherless]} : {})) %>" method="GET">
<div style="text-align: center; margin: 10px;">
<input type="text" name="getting_started_code" class="getting_started_code" style="border: 1px solid #aaa; font-size: 1.3em;"/>
</div>
<div style="text-align: right;">
<button class="button big-button" type="submit">Continue</button>
<button class="button big-button" type="submit"><%= t "#buttons.continue", "Continue" %></button>
</div>
</form>
</div>

View File

@ -1,21 +1,18 @@
<% content_for :page_title do %>Try It: Choose a Course Name<% end %>
<% content_for :page_title do %><%= before_label :try_it_title, "Try It" %> <%= t "#titles.choose_course_name", "Choose Course Name" %><% end %>
<% content_for :right_side do %>
<div class="rs-margin-lr rs-margin-top">
<% if @context.teacherless? %>
<p>First thing's first, tell us the name of the course you'd like to
track.</p>
<p><%= t :course_name_notice, "First thing's first, tell us the name of the course you'd like to
track." %></p>
<% else %>
<p>Right, then. Let's get this course set up! It should only take a
few minutes for the whole process. First off
come up with a name for your course. Then you'll add your
assignments and students. Shouldn't take too long at all.
<p><%= t :course_name_notice_longer, "Right, then. Let's get this course set up! It should only take a few minutes for the whole process. First off come up with a name for your course. Then you'll add your assignments and students. Shouldn't take too long at all." %>
</p>
<% end %>
</div>
<div class="rs-margin-lr" style="text-align: right;">
<button class="next_step_button button big-button button-sidebar-wide" type="submit">Next Step: Assignments</button>
<a href="#" class="save_button button button-secondary">Save &amp; Skip the Rest</a>
<button class="next_step_button button big-button button-sidebar-wide" type="submit"><%= t :assignment_next_step_link, "Next Step: Assignments" %></button>
<a href="#" class="save_button button button-secondary"><%= t :save_and_skip, "Save & Skip the Rest" %></a>
</div>
<% end %>
<% js_block do %>
@ -39,29 +36,34 @@ $(function(){
<% form_for @context, :html => { :id => 'setup_course_form' } do |form| %>
<div style="text-align: left; margin-left: 50px; margin-top: 10px; width: auto; position: relative;" id="course_name_div">
<% if @context.teacherless? %>
<p>You can use Canvas to keep track of how you're doing in all your courses,
whether they're using Canvas or not. Just tell us how your
course's grading policy is set up and then enter your scores manually. You can
also invite your classmates to use the course you set up so they can track
their grades, too!</p>
<p><%= t :teacherless_grades_notice, "You can use Canvas to keep track of how you're doing in all your courses, whether they're using Canvas or not. Just tell us how your course's grading policy is set up and then enter your scores manually. You can also invite your classmates to use the course you set up so they can track their grades, too!" %></p>
<% end %>
<div>
<%= form.label :name, "Enter a name for your course:", :style => "font-weight: bold; font-size: 1.2em; display: block;" %>
<%= form.blabel :name, :en => "Enter a name for your course", :style => "font-weight: bold; font-size: 1.2em; display: block;" %>
<%= form.text_field :name, :style => "font-size: 2.0em; border: 2px solid #aaa; padding: 2px;" %>
</div>
<div>
<%= form.label :course_code, "And a shorter reference code:", :style => "margin-top: 25px;font-weight: bold; font-size: 1.2em; display: block;" %>
<%= form.blabel :course_code, :en => "And a shorter reference code", :style => "margin-top: 25px;font-weight: bold; font-size: 1.2em; display: block;" %>
<%= form.text_field :course_code, :style => "font-size: 1.5em; border: 2px solid #aaa; padding: 2px; width: 250px;" %><br/>
<span style="font-weight: normal; font-size: 0.8em;">(something like BIO 100, ENG 315, etc.)</span>
<span style="font-weight: normal; font-size: 0.8em;"><%= t :course_code_example, "(something like BIO 100, ENG 315, etc.)" %></span>
</div>
<div style="margin-top: 50px; <%= hidden unless @domain_root_account == Account.default %>">
<%= form.label :license, "License for course content:", :style => "font-weight: bold; font-size: 1.2em; display: block;" %>
<%= form.select :license, [['Private (Copyrighted)', 'private'], ['CC Attribution Non-Commercial No Derivatives', 'cc_by_nc_nd'], ['CC Attribution Non-Commercial Share Alike', 'cc_by_nc_sa'], ['CC Attribution Non-Commercial', 'cc_by_nc'], ['CC Attribution No Derivatives', 'cc_by_nd'], ['CC Attribution Share Alike', 'cc_by_sa'], ['CC Attribution', 'cc_by'], ['Public Domain', 'public_domain']], {}, :style => "font-size: 1.3em; border: 2px solid #aaa;" %>
<%= form.blabel :license, :en => "License for course content", :style => "font-weight: bold; font-size: 1.2em; display: block;" %>
<%= form.select :license, [
[t("#cc.private", 'Private (Copyrighted)'), 'private'],
[t("#cc.by_nc_nd", 'CC Attribution Non-Commercial No Derivatives'), 'cc_by_nc_nd'],
[t("#cc.by_nc_sa", 'CC Attribution Non-Commercial Share Alike'), 'cc_by_nc_sa'],
[t("#cc.by_nc", 'CC Attribution Non-Commercial'), 'cc_by_nc'],
[t("#cc.by_nd", 'CC Attribution No Derivatives'), 'cc_by_nd'],
[t("#cc.by_sa", 'CC Attribution Share Alike'), 'cc_by_sa'],
[t("#cc.by", 'CC Attribution'), 'cc_by'],
[t("#cc.public_domain", 'Public Domain'), 'public_domain']
], {}, :style => "font-size: 1.3em; border: 2px solid #aaa;" %>
<%= license_help_link %>
<div style="margin-top: 10px;">
<%= form.check_box :is_public, :class => "is_public_checkbox" %>
<%= form.label :is_public, "Make this course publicly visible", :style => "font-size: 1.3em;" %>
<div style="padding-left: 30px; margin-top: -5px; font-size: 0.8em;">(student data will remain private)</div>
<div style="padding-left: 30px; margin-top: -5px; font-size: 0.8em;"><%= t :student_data_privacy, "(student data will remain private)" %></div>
</div>
<% if @domain_root_account == Account.default %>
<div class="public_options" style="margin-top: 5px;">

View File

@ -3,16 +3,13 @@
<% content_for :right_side do %>
<% unless @context.teacherless? %>
<div class="rs-margin-lr rs-margin-top">
<p>Don't worry, this course will stay visible to just you until you publish it.
When you publish, your course will become active and students will be notified that
it's has been created and they are enrolled. You can publish at any time
from the course's main page.</p>
<p><%= t :unpublished_notice, "Don't worry, this course will stay visible to just you until you publish it. When you publish, your course will become active and students will be notified that it's has been created and they are enrolled. You can publish at any time from the course's main page." %></p>
</div>
<% end %>
<div class="rs-margin-lr" style="text-align: right; white-space:nowrap;">
<% form_tag getting_started_finalize_url, {:id => "publish_course_url"} do %>
<a href="<%= url_for :action => "students" %>" class="previous_step_button button small-button">Previous</a>
<button type="submit" class="button big-button">Save Course</button>
<a href="<%= url_for :action => "students" %>" class="previous_step_button button small-button"><%= t "#buttons.previous", "Previous" %></a>
<button type="submit" class="button big-button"><%= t "#buttons.save_course", "Save Course" %></button>
<% end %>
</div>
<% end %>
@ -34,37 +31,35 @@
<%= render :partial => 'wizard_secondary_nav', :locals => {:view => 'setup'} %>
<h2>Review and Save</h2>
<p><b>That's it! You're done!</b> Here's the summary of everything you put in. Feel free to click any section
to go back and edit the information there. When you're sure you've got everything right, click the save
button to go to your course page.
<h2><%= t "#titles.review_and_save", "Review and Save" %></h2>
<p><%= t :summary_notice, "*That's it! You're done!* Here's the summary of everything you put in. Feel free to click any section to go back and edit the information there. When you're sure you've got everything right, click the save button to go to your course page.", :wrapper => "<b>\1</b>" %>
</p>
<div>
<table style="width: 100%;">
<tr>
<td style=" width: 130px; text-align: right; padding-right: 20px;"><%= link_to "Course Name:", :action => 'name' %></td>
<td style=" width: 130px; text-align: right; padding-right: 20px;"><%= link_to before_label(:course_name, "Course Name"), :action => 'name' %></td>
<td><span style="font-size: 1.2em; font-weight: bold;"><%= @context.name %></span></td>
</tr><tr>
<td style="text-align: right; padding-right: 20px; vertical-align: top;"><%= link_to "Assignments:", :action => 'assignments' %></td>
<td style="text-align: right; padding-right: 20px; vertical-align: top;"><%= link_to t(:assignments, "Assignments"), :action => 'assignments' %></td>
<td>
</a>
<b>
<%= @assignments && !@assignments.empty? ? @assignments.length.to_s + " Total Assignments" : "No Assignments Created" %>
<%= @assignments && !@assignments.empty? ? t(:total_assignment_count, { :one => "1 Assignment Total", :other => "%{count} Assignments Total" }, :count => @assignments.length) : t(:no_assignments, "No Assignments Created") %>
</b>
<% if @assignments && !@assignments.empty? %>
<a href="#" style="padding-left: 20px; font-size: 0.9em; display: none;" class="hide_assignments_link">Hide</a>
<a href="#" style="padding-left: 20px; font-size: 0.9em;" class="show_assignments_link">Show</a>
<a href="#" style="padding-left: 20px; font-size: 0.9em;" class="show_assignments_link"><%= t "#buttons.show", "Show" %></a>
<div id="assignment_list" style="display:none;">
<table style="width: 100%;" class="summary">
<tr>
<th style="min-width: 150px;">Assignment</th>
<th>Type</th>
<th>Pts</th>
<th>Due</td>
<th style="min-width: 150px;"><%= t "short_header.assignment", "Assignment" %></th>
<th><%= t "short_header.type", "Type" %></th>
<th><%= t "short_header.points", "Pts" %></th>
<th><%= t "short_header.due", "Due" %></td>
</tr>
<% @assignments.each do |assignment| %>
<tr>
<td><%= assignment.title ? assignment.title : "Assignment" %></td>
<td><%= assignment.title ? assignment.title : t("short_header.assignment", "Assignment") %></td>
<td><%= assignment.assignment_group.name rescue "-" %></td>
<td><%= assignment.points_possible rescue "-" %></td>
<td><%= assignment.due_at.strftime("%b %d") rescue "-" %></td>
@ -75,24 +70,24 @@
<% end%>
</td>
</tr><tr>
<td style="text-align: right; padding-right: 20px; vertical-align: top;"><%= link_to 'Students:', :action => 'students' %></td>
<td style="text-align: right; padding-right: 20px; vertical-align: top;"><%= link_to before_label(:students, 'Students'), :action => 'students' %></td>
<td>
<b>
<%= @students && !@students.empty? ? @students.length.to_s + " Total Students" : "No Students Added" %>
<%= @students && !@students.empty? ? t(:total_students_count, { :one => "1 Student Total", :other => "%{count} Students Total" }, :count => @students.length) : t(:no_students, "No Students Added") %>
</b>
<% if @students && !@students.empty? %>
<a href="#" style="padding-left: 20px; font-size: 0.9em; display: none;" class="hide_students_link">Hide</a>
<a href="#" style="padding-left: 20px; font-size: 0.9em;" class="show_students_link">Show</a>
<a href="#" style="padding-left: 20px; font-size: 0.9em; display: none;" class="hide_students_link"><%= t "#buttons.hide", "Hide" %></a>
<a href="#" style="padding-left: 20px; font-size: 0.9em;" class="show_students_link"><%= t "#buttons.show", "Show" %></a>
<div id="student_list" style="display:none;">
<table style="width: 100%;" class="summary">
<tr>
<th style="min-width: 150px;">Student</th>
<th>Email</th>
<th style="min-width: 150px;"><%= t "short_header.student", "Student" %></th>
<th><%= t "short_header.email", "Email" %></th>
</tr>
<% @students.each do |student| %>
<tr>
<td><%= student.name ? student.name : "New Student" %></td>
<td><%= student.email ? student.email : "no email" %></td>
<td><%= student.name ? student.name : t(:new_student, "New Student") %></td>
<td><%= student.email ? student.email : t(:no_email, "no email") %></td>
</tr>
<% end %>
</table>

View File

@ -2,20 +2,17 @@
<% content_for :right_side do %>
<div class="rs-margin-lr rs-margin-top">
<% if @context.teacherless? %>
<p>You can always skip this step and invite your classmates (or even your teacher)
to share this course later on.
<p><%= t :teacherless_add_student_skip, "You can always skip this step and invite your classmates (or even your teacher) to share this course later on." %>
</p>
<% else %>
<p>If you're not sure who's going to be in your class, you can skip this step
and add students (along with TA's and other teachers) anytime after you finish
the wizard.
<p><%= t :teacher_add_student_skip, "If you're not sure who's going to be in your class, you can skip this step and add students (along with TA's and other teachers) anytime after you finish the wizard." %>
</p>
<% end %>
</div>
<div class="rs-margin-lr" style="text-align: right;">
<a href="<%= url_for :action => "assignments" %>" class="previous_step_button button small-button">Previous</a>
<a href="<%= url_for :action => "setup" %>" class="next_step_button button big-button">Next Step: Save</a>
<div style="margin-top: 5px; margin-right: 5px;"><a href="<%= context_url(@context, :context_url) %>" class="save_button button button-secondary">Save &amp; Skip the Rest</a></div>
<a href="<%= url_for :action => "assignments" %>" class="previous_step_button button small-button"><%= t "#buttons.previous", "Previous" %></a>
<a href="<%= url_for :action => "setup" %>" class="next_step_button button big-button"><%= t :save_next_step_link, "Next Step: Save" %></a>
<div style="margin-top: 5px; margin-right: 5px;"><a href="<%= context_url(@context, :context_url) %>" class="save_button button button-secondary"><%= t :save_and_skip, "Save & Skip the Rest" %></a></div>
</div>
<% end %>
<% content_for :stylesheets do %>
@ -55,85 +52,29 @@
<%= render :partial => 'wizard_secondary_nav', :locals => {:view => 'students'} %>
<% if @context.teacherless? %>
<p style="margin-top: 10px;">If you'd like, you can invite your fellow classmates
to also use this course. That way they won't have to set up the grading policies
all over again, and we'll also give you a place to share files and collaborate. Just
paste in a list of email addresses below to invite others to join.</p>
<p style="margin-top: 10px;"><%= t :teacherless_add_student_notice, "If you'd like, you can invite your fellow classmates to also use this course. That way they won't have to set up the grading policies all over again, and we'll also give you a place to share files and collaborate. Just paste in a list of email addresses below to invite others to join." %></p>
<% else %>
<p style="margin-top: 10px;"><b>Next, you'll want to add students to your course.</b> You can add them one by
one or as a whole list. Paste in just email addresses (bob@example.com) or
names with addresses <span style="white-space:nowrap;">("Jones, Bob M." &lt;bob@example.com&gt;)</span> separated by commas or
on separate lines.
<p style="margin-top: 10px;"><%= t :teacher_add_student_notice, "*Next, you'll want to add students to your course.* You can add them one by one or as a whole list. Paste in just email addresses (bob@example.com) or names with addresses #(\"Jones, Bob M.\" &lt;bob@example.com&gt;)# separated by commas or on separate lines.", :wrapper => { "*" => "<b>\1</b>", "#" => "<span style=\"white-space:nowrap;\">\1</span>" } %>
</p>
<% end %>
<% form_tag course_enroll_users_url(@context), {:id => "enroll_users_form"} do %>
<h2>Add Students</h2>
<h2><%= t "#titles.add_students", "Add Students" %></h2>
<div style="margin-top: 5px;">
<div id="email_list_boxes">
<a id="email_lists_path" style="display:none;" href="<%= url_for email_lists_path(:format => :json) %>"></a>
<div id="user_emails_textarea_container" style="z-index: 2;">
<input type="hidden" name="enrollment_type" value="StudentEnrollment" />
<span style="font-size: 0.8em;">Copy and paste a list of email addresses to add users to this course.</span>
<textarea name="user_emails" class="user_emails"><% if @students.empty? %>"Example Student" <student@example.com>
"Other Student" <otherstudent@example.com>
"Lastname, Firstname" <firstlast@example.com>
<justAnEmailAddress@example.com>
<% end %></textarea>
</div>
<div id="user_emails_parsed" style="z-index: 1; display:none;">
<div class="ui-helper-reset ui-widget-content ui-corner-all" id="email_lists_processed_people">
<div id="user_emails_duplicates_found" class="ui-widget">
<div class="ui-state-highlight ui-corner-all">
<p>
<span style="float: left; margin-right: 0 0.3em;" class="ui-icon ui-icon-info"></span>
<strong>Notice:</strong> <strong class='duplicate_count'>???</strong> duplicate address<span class="duplicates_plurality">es</span> found, duplicates have been removed.
</p>
</div>
</div>
<div id="user_emails_no_valid_emails" class="ui-widget">
<div class="ui-state-highlight ui-corner-all">
<p><span style="float: left; margin-right: 0 0.3em;" class="ui-icon ui-icon-info"></span>
<strong>Sorry,</strong> it does not seem as if there were any valid email addresses typed in, please go back and try again.</p>
</div>
</div>
<div id="user_emails_with_errors" class="ui-widget">
<div class="ui-state-highlight ui-corner-all">
<p>
<span style="float: left; margin-right: 0 0.3em;" class="ui-icon ui-icon-alert"></span>
<strong>Alert:</strong> There were <strong class="errors_count">???</strong> errors parsing that list of emails. There may be some that
were invalid, you might need to go back and fix any errors. If you proceed as is, <strong class="addresses_count">???</strong>
users will be added.
</p>
</div>
</div>
<div class="person ui-helper-reset ui-state-default ui-corner-all" id="email_lists_processed_person_template" style="display:none;">
<div class="name">Last, First</div>
<div class="address">user@domain.com</div>
</div>
</div>
</div>
</div>
<!-- <% unless @context.available? %>
<div>
<i>Since the course hasn't been published, students and TA's will be added, but won't be
invited to join the course. Invitations will be sent out when the course is published.</i>
</div>
<% end %> -->
<%= render :partial => 'shared/email_lists' %>
</div>
<div class="button-container">
<button type="button" class="button verify_syntax_button">Continue...</button>
<button type="submit" class="button add_users_button">OK Looks Good, Add These Users</button>
<button type="button" class="go_back_button button-secondary">Go back and edit the list of emails</button>
<button type="button" class="button verify_syntax_button"><%= t "#buttons.continue", "Continue" %></button>
<button type="submit" class="button add_users_button"><%= t :looks_good, "OK Looks Good, Add These Users" %></button>
<button type="button" class="go_back_button button-secondary"><%= t :go_back_and_edit, "Go back and edit the list of emails" %></button>
</div>
<br /><br />
<% end %>
<h2>Students <span class="tally">(<span class="student_count"><%= @students.length %></span>)</span></h2>
<h2><%= t "#titles.students", "Students" %> <span class="tally">(<span class="student_count"><%= @students.length %></span>)</span></h2>
<ul class="user_list student_enrollments">
<% if @students.empty? %>
<li class="none">No Students Enrolled</li>
<li class="none"><%= t :no_enrollments, "No Students Enrolled" %></li>
<% else %>
<%= render :partial => 'shared/enrollment', :collection => @students %>
<% end %>
@ -141,4 +82,4 @@
</ul>
<% jammit_js :email_lists %>
<% jammit_js :email_lists %>

View File

@ -1,11 +1,11 @@
<% content_for :page_title do %>Try It: New Course<% end %>
<% content_for :page_title do %><%= before_label :try_it_title, "Try It" %> <%= t "#titles.new_course", "New Course" %><% end %>
<% content_for :page_header do %>
<h1>Use Canvas for Grading</h1>
<h1><%= t :use_canvas_for_grading, "Use Canvas for Grading" %></h1>
<% end %>
<% content_for :page_subhead do %>
<h2>Set up a new Course in Canvas</h2>
<h2><%= t :setup, "Set up a new Course in Canvas" %></h2>
<% end %>
<% content_for :primary_nav do %>
@ -17,12 +17,8 @@
<% end %>
<div style="width: 600px; margin: 20px auto;">
<p>You can use Canvas to keep track of how you're doing in all your courses,
whether they're using Canvas or not. Just tell us how your
course's grading policy is set up and then enter your scores manually. You can
also invite your classmates to use the course you set up so they can track
their grades, too!</p>
<p><%= t :teacherless_explanation, "You can use Canvas to keep track of how you're doing in all your courses, whether they're using Canvas or not. Just tell us how your course's grading policy is set up and then enter your scores manually. You can also invite your classmates to use the course you set up so they can track their grades, too!" %></p>
<div style="margin-top: 10px; font-size: 1.5em; text-align: center;">
<a href="<%= getting_started_url(:teacherless => 1) %>">Click here to get started</a>
<a href="<%= getting_started_url(:teacherless => 1) %>"><%= t :get_started, "Click here to get started" %></a>
</div>
</div>

View File

@ -0,0 +1,46 @@
<div id="email_list_boxes">
<a id="email_lists_path" style="display:none;" href="<%= url_for email_lists_path(:format => :json) %>"></a>
<div id="user_emails_textarea_container" style="z-index: 2;">
<input type="hidden" name="enrollment_type" value="StudentEnrollment" />
<span style="font-size: 0.8em;"><%= t :copy_and_paste_notice, "Copy and paste a list of email addresses to add users to this course." %></span>
<textarea name="user_emails" class="user_emails"><% if @students && @students.empty? %><%= t :example_user_emails, '"Example Student" <student@example.com>
"Other Student" <otherstudent@example.com>
"Lastname, Firstname" <firstlast@example.com>
<justAnEmailAddress@example.com>' %>
<% end %></textarea>
</div>
<div id="user_emails_parsed" style="z-index: 1; display:none;">
<div class="ui-helper-reset ui-widget-content ui-corner-all" id="email_lists_processed_people">
<div id="user_emails_duplicates_found" class="ui-widget">
<div class="ui-state-highlight ui-corner-all">
<p>
<span style="float: left; margin-right: 0 0.3em;" class="ui-icon ui-icon-info"></span>
<strong><%= before_label :notice, "Notice" %></strong>
<span class="message_content"></span>
</p>
</div>
</div>
<div id="user_emails_no_valid_emails" class="ui-widget">
<div class="ui-state-highlight ui-corner-all">
<p><span style="float: left; margin-right: 0 0.3em;" class="ui-icon ui-icon-info"></span>
<%= t :no_valid_emails, "*Sorry,* it does not seem as if there were any valid email addresses typed in, please go back and try again.", :wrapper => "<strong>\\1</strong>" %></p>
</div>
</div>
<div id="user_emails_with_errors" class="ui-widget">
<div class="ui-state-highlight ui-corner-all">
<p>
<span style="float: left; margin-right: 0 0.3em;" class="ui-icon ui-icon-alert"></span>
<strong><%= before_label :alert, "Alert" %></strong>
<span class="message_content"></span>
</p>
</div>
</div>
<div class="person ui-helper-reset ui-state-default ui-corner-all" id="email_lists_processed_person_template" style="display:none;">
<div class="name"><%= t :user_name_example, "Last, First" %></div>
<div class="address"><%= t :user_email_example, "user@domain.com" %></div>
</div>
</div>
</div>
</div>

View File

@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
I18n.scoped('email_lists', function(I18n) {
(function($) {
var $email_lists_processed_person_template = $("#email_lists_processed_person_template").removeAttr('id').detach(),
@ -170,20 +172,14 @@
if (emailList.errored_addresses && emailList.errored_addresses.length) {
$user_emails_with_errors
.appendTo($email_lists_processed_people)
.find('.addresses_count')
.html(emailList.addresses.length)
.end()
.find('.errors_count')
.html(emailList.errored_addresses.length);
.find('.message_content')
.html(I18n.t("email_parsing_errors", { one: "There was 1 error parsing that list of emails.", other: "There were %{count} errors parsing that list of emails."}, {count:emailList.errored_addresses.length}) + " " + I18n.t("invalid_emails_notice", "There may be some that were invalid, and you might need to go back and fix any errors.") + " " + I18n.t("users_to_add", { one: "If you proceed as is, 1 user will be added.", other: "If you proceed as is, %{count} users will be added." }, {count: emailList.addresses.length}));
}
if (emailList.duplicates && emailList.duplicates.length) {
$user_emails_duplicates_found
.appendTo($email_lists_processed_people)
.find('.duplicate_count')
.html(emailList.duplicates.length)
.end()
.find('.duplicates_plurality')
.html(emailList.duplicates.length > 1 ? 'es': '');
.find('.message_content')
.html(I18n.t("duplicate_emails", { one: "1 duplicate address found, duplicates have been removed.", other: "%{count} duplicate addresses found, duplicates have been removed."}, {count:emailList.duplicates.length}))
}
$.each(emailList.addresses, function(){
@ -260,3 +256,5 @@
$(INST.EmailLists.init);
})(jQuery, INST);
});