localize ePortfolios

Change-Id: If79d2b7e219ba4855d1a441e3fc7de2d8da0fad3
Reviewed-on: https://gerrit.instructure.com/4152
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Jacob Fugal 2011-06-10 12:41:00 -06:00
parent 93898e620f
commit e0e09bfea1
18 changed files with 402 additions and 281 deletions

View File

@ -28,13 +28,9 @@ class EportfolioCategoriesController < ApplicationController
if authorized_action(@portfolio, @current_user, :update)
category_names = @portfolio.eportfolio_categories.map{|c| c.name}
@category = @portfolio.eportfolio_categories.build(params[:eportfolio_category])
# if category_names.include?(@category.name)
# @category.errors.add_to_base("Category names must be unique");
# end
respond_to do |format|
if @category.save #@category.errors.empty? && @category.save
@portfolio.eportfolio_entries.create(:eportfolio_category => @category, :name => "New Page", :allow_comments => true, :show_comments => :true)
#@portfolio.eportfolio_categories << @category
if @category.save
@portfolio.eportfolio_entries.create(:eportfolio_category => @category, :name => t(:default_name, "New Page"), :allow_comments => true, :show_comments => :true)
format.html { redirect_to eportfolio_category_url(@portfolio, @category) }
format.json { render :json => @category.to_json }
else
@ -72,13 +68,13 @@ class EportfolioCategoriesController < ApplicationController
@category = @portfolio.eportfolio_categories.find_by_slug(params[:category_name]) or raise ActiveRecord::RecordNotFound
end
@page = @category.eportfolio_entries.first
@page ||= @portfolio.eportfolio_entries.create(:eportfolio_category => @category, :allow_comments => true, :show_comments => true, :name => "New Page") if @portfolio.grants_right?(@current_user, session, :update)
@page ||= @portfolio.eportfolio_entries.create(:eportfolio_category => @category, :allow_comments => true, :show_comments => true, :name => t(:default_name, "New Page")) if @portfolio.grants_right?(@current_user, session, :update)
raise ActiveRecord::RecordNotFound if !@page
eportfolio_page_attributes
render :template => "eportfolios/show"
end
rescue ActiveRecord::RecordNotFound
flash[:notice] = "Couldn't find that page"
flash[:notice] = t('errors.missing_page', "Couldn't find that page")
redirect_to eportfolio_url(@portfolio.id)
end
end

View File

@ -54,7 +54,7 @@ class EportfolioEntriesController < ApplicationController
@page = @category.eportfolio_entries.find_by_slug(params[:entry_name])
end
if !@page
flash[:notice] = "Couldn't find that page"
flash[:notice] = t('notices.missing_page', "Couldn't find that page")
redirect_to eportfolio_url(@portfolio.id)
return
end
@ -112,7 +112,7 @@ class EportfolioEntriesController < ApplicationController
begin
redirect_to verified_file_download_url(@attachment)
rescue
raise "Not Found"
raise t('errors.not_found', "Not Found")
end
end
end

View File

@ -30,7 +30,7 @@ class EportfoliosController < ApplicationController
@context = UserProfile.new(@current_user)
@active_tab = "eportfolios"
add_crumb(@current_user.short_name, profile_url)
add_crumb("ePortfolios")
add_crumb(t(:crumb, "ePortfolios"))
@portfolios = @current_user.eportfolios.active.find(:all, :order => :updated_at)
render :action => 'user_index'
end
@ -41,7 +41,7 @@ class EportfoliosController < ApplicationController
respond_to do |format|
if @portfolio.save
@portfolio.setup_defaults
flash[:notice] = "Porfolio successfully created"
flash[:notice] = t('notices.created', "Porfolio successfully created")
format.html { redirect_to eportfolio_url(@portfolio) }
format.json { render :json => @portfolio.to_json(:permissions => {:user => @current_user, :session => session}) }
else
@ -83,7 +83,7 @@ class EportfoliosController < ApplicationController
respond_to do |format|
if @portfolio.update_attributes(params[:eportfolio])
@portfolio.setup_defaults
flash[:notice] = "Porfolio successfully updated"
flash[:notice] = t('notices.updated', "Porfolio successfully updated")
format.html { redirect_to eportfolio_url(@portfolio) }
format.json { render :json => @portfolio.to_json(:permissions => {:user => @current_user, :session => session}) }
else
@ -99,7 +99,7 @@ class EportfoliosController < ApplicationController
if authorized_action(@portfolio, @current_user, :delete)
respond_to do |format|
if @portfolio.destroy
flash[:notice] = "Portfolio successfully deleted"
flash[:notice] = t('notices.deleted', "Portfolio successfully deleted")
format.html { redirect_to profile_url }
format.json { render :json => @portfolio.to_json }
else
@ -173,7 +173,7 @@ class EportfoliosController < ApplicationController
end
format.json { render :json => @attachment.to_json(:methods => :readable_size) }
else
flash[:notice] = "File zipping still in process..."
flash[:notice] = t('notices.zipping', "File zipping still in process...")
format.html { redirect_to eportfolio_url(@portfolio.id) }
format.zip { redirect_to eportfolio_url(@portfolio.id) }
format.json { render :json => @attachment.to_json }
@ -189,7 +189,7 @@ class EportfoliosController < ApplicationController
if @portfolio.public || params[:verifier] == @portfolio.uuid
@entries = @portfolio.eportfolio_entries.find(:all, :order => 'eportfolio_entries.created_at DESC')
feed = Atom::Feed.new do |f|
f.title = "#{@portfolio.name} Feed"
f.title = t(:title, "%{portfolio_name} Feed", :portfolio_name => @portfolio.name)
f.links << Atom::Link.new(:href => eportfolio_url(@portfolio.id))
f.updated = @entries.first.updated_at rescue Time.now
f.id = eportfolio_url(@portfolio.id)

View File

@ -17,4 +17,39 @@
#
module EportfoliosHelper
def show_me(link_class)
raw("<a href=\"#\" class=\"#{link_class}\"><b>#{t('#show me', "show me")}</b></a>")
end
def edit_icon
image_tag("edit.png")
end
def delete_icon(png=false)
if png
image_tag("delete.png")
else
raw('&#215;')
end
end
def help_icon
image_tag("help.png")
end
def edit_link_text
t(:link_text, "%{edit_icon} Edit This Page", :edit_icon => edit_icon)
end
def help_link_text
t(:link_text, "%{help_icon} How Do I...?", :help_icon => help_icon)
end
def manage_pages_link_text
t(:link_text, "Organize/Manage Pages")
end
def manage_sections_link_text
t(:link_text, "Organize Sections")
end
end

View File

@ -63,8 +63,8 @@ class Eportfolio < ActiveRecord::Base
end
def setup_defaults
cat = self.eportfolio_categories.create(:name => "Home") if self.eportfolio_categories.empty?
entry = cat.eportfolio_entries.create(:eportfolio => self, :name => "Welcome", :content => "Nothing entered yet") if cat && cat.eportfolio_entries.empty?
cat = self.eportfolio_categories.create(:name => t(:first_category, "Home")) if self.eportfolio_categories.empty?
entry = cat.eportfolio_entries.create(:eportfolio => self, :name => t('first_entry.title', "Welcome"), :content => t('first_entry.content', "Nothing entered yet")) if cat && cat.eportfolio_entries.empty?
cat
end
def self.serialization_excludes; [:uuid]; end

View File

@ -29,7 +29,7 @@ class EportfolioCategory < ActiveRecord::Base
def infer_unique_slug
categories = self.eportfolio.eportfolio_categories
self.name ||= "Section Name"
self.name ||= t(:default_section, "Section Name")
self.slug = self.name.gsub(/[\s]+/, "_").gsub(/[^\w\d]/, "")
match_cnt = categories.select{|c| c != self && c.slug && c.slug == self.slug}.length
if match_cnt > 0

View File

@ -123,7 +123,7 @@ class EportfolioEntry < ActiveRecord::Base
self.content << new_obj
end
end
self.content << "No Content Added Yet" if self.content.empty?
self.content << t(:default_content, "No Content Added Yet") if self.content.empty?
end
@ -133,7 +133,7 @@ class EportfolioEntry < ActiveRecord::Base
def infer_unique_slug
pages = self.eportfolio_category.eportfolio_entries rescue []
self.name ||= "Page Name"
self.name ||= t(:default_name, "Page Name")
self.slug = self.name.gsub(/[\s]+/, "_").gsub(/[^\w\d]/, "")
match_cnt = pages.select{|p| p != self && p.slug && p.slug == self.slug}.length
if match_cnt > 0
@ -151,7 +151,7 @@ class EportfolioEntry < ActiveRecord::Base
url += "?verifier=#{self.eportfolio.uuid}" if opts[:private]
entry.links << Atom::Link.new(:rel => 'alternate', :href => url)
entry.id = "tag:#{HostUrl.default_host},#{self.created_at.strftime("%Y-%m-%d")}:/eportfoli_entries/#{self.feed_code}_#{self.created_at.strftime("%Y-%m-%d-%H-%M") rescue "none"}"
rendered_content = "Click to view page content"
rendered_content = t(:click_through, "Click to view page content")
entry.content = Atom::Content::Html.new(rendered_content)
end
end

View File

@ -4,7 +4,10 @@
<span class="name"><%= eportfolio.name rescue nbsp %></span>
</a>
<div style="padding-left: 30px;">
<span class="entry_count"><%= eportfolio.eportfolio_entries.length rescue 0 %></span> pages &nbsp;&nbsp;&nbsp;&nbsp;
last updated <span class="updated_at"><%= datetime_string(eportfolio.updated_at) rescue nbsp %></span>
<%= t(:entry_count, { :one => "*1* page", :other => "*%{count}* pages" },
:count => (eportfolio.eportfolio_entries.length rescue 0),
:wrapper => '<span class="entry_count">\1</span>') %>
&nbsp;&nbsp;&nbsp;&nbsp;
<%= t(:updated_at, "last updated %{updated_at}", :updated_at => raw("<span class=\"updated_at\">#{datetime_string(eportfolio.updated_at) rescue nbsp}</span>")) %>
</div>
</li>

View File

@ -3,45 +3,44 @@
<%= @category.name %>
<% if can_do(@portfolio, @current_user, :manage) %>
<div style="float: right; margin-right: 10px; font-size: 0.8em;">
<a href="#" class="manage_pages_link" style="font-style: italic;" title="Add, remove or rearrange pages for this section">Organize/Manage Pages</a>
<!--input type="button" value="Manage Pages" title="Add, remove, or rearrange pages for this section" class="manage_pages_link"/-->
<a href="#" class="manage_pages_link" style="font-style: italic;" title="<%= t('titles.manage_pages', "Add, remove or rearrange pages for this section") %>"><%= manage_pages_link_text %></a>
</div>
<% end %>
</h2>
<div class="rs-margin-lr">
<div class="editing_box" style="font-size: 0.8em;">
Click any page name to rename it, or click and drag to reorder.
<%= t(:edit_instructions, "Click any page name to rename it, or click and drag to reorder.") %>
</div>
<div class="displaying_box" style="font-size: 0.8em;">
Pages for this section
<%= t('headers.page_list', "Pages for this section") %>
</div>
<ul id="page_list">
<% @category.eportfolio_entries.each do |e| %>
<li id="page_<%= e.id %>" class="page <%= "current" if e == @page %>">
<a href="#" class="edit_page_link">
<%= image_tag "edit.png", :class => "editing_image", :title => "Rename Page" %>
<%= image_tag "edit.png", :class => "editing_image", :title => t('titles.rename_page', "Rename Page") %>
</a>
<a class="page_url no-hover" href="<%= eportfolio_named_category_entry_path(@portfolio,@category.slug, e.slug) %>">
<span class="name"><%= e.name %></span>
</a>
<a class="rename_page_url" href="<%= eportfolio_entry_path(@portfolio, e.id) %>" style="display: none;">&nbsp;</a>
&nbsp;<a href="#" class="remove_page_link" title="Delete this Page">&#215;</a>
&nbsp;<a href="#" class="remove_page_link" title="<%= t('titles.delete_page', "Delete this Page") %>">&#215;</a>
</li>
<% end %>
<li id="page_blank" class="page unsaved" style="display: none;">
<a href="#" class="edit_page_link">
<%= image_tag "edit.png", :class => "editing_image", :title => "Rename Page" %>
<%= image_tag "edit.png", :class => "editing_image", :title => t('titles.rename_page', "Rename Page") %>
</a>
<a class="page_url no-hover" href="<%= eportfolio_named_category_entry_path(@portfolio, @category.slug, "{{ slug }}") %>">
<span class="name">Page Name</span>
<span class="name"><%= t(:default_page_name, "Page Name") %></span>
</a>
&nbsp;<a href="#" class="remove_page_link">&#215;</a>
<a class="rename_page_url" href="<%= eportfolio_entry_path(@portfolio, "{{ id }}") %>" style="display: none;">&nbsp;</a>
&nbsp;<a href="#" class="remove_page_link" title="<%= t('titles.delete_page', "Delete this Page") %>">&#215;</a>
</li>
</ul>
<a href="#" class="add_page_link add"> Add Another Page</a>
<a href="#" class="add_page_link add"><%= t('links.add_page', "Add Another Page") %></a>
<div class="editing_box button-container">
<button type="button" class="done_editing_button button">Done Editing</button>
<button type="button" class="done_editing_button button"><%= t('buttons.done_editing', "Done Editing") %></button>
</div>
<a href="<%= eportfolio_entries_path(@portfolio) %>" class="add_page_url" style="display: none;">&nbsp;</a>
<a href="<%= eportfolio_reorder_entries_url(@portfolio.id, @category.id) %>" class="reorder_pages_url">&nbsp;</a>

View File

@ -1,30 +1,34 @@
<div class="section <%= "read_only" if (page_section && (page_section["attachment_id"] || page_section["submission_id"])) %>" id="page_section_<%= idx %>">
<a href="#" class="move_link no-hover" title="Drag to rearrange sections"><%= image_tag "move.png" %></a>
<a href="#" class="move_link no-hover" title="<%= t('titles.move_section', "Drag to rearrange sections") %>"><%= image_tag "move.png" %></a>
<div class="section_type_name">
<% if !page_section || page_section["section_type"] == "rich_text" %>
Rich Text Content
<%= t('section_types.rich_text', "Rich Text Content") %>
<% elsif page_section["section_type"] == "html" %>
HTML/Embedded Content
<%= t('section_types.html', "HTML/Embedded Content") %>
<% elsif page_section["section_type"] == "submission" %>
Course Submission
<%= t('section_types.submission', "Course Submission") %>
<% elsif page_section["section_type"] == "attachment" %>
Image/File Upload
<%= t('section_types.attachment', "Image/File Upload") %>
<% end %>
</div>
<div class="links">
<a href="#" class="delete_page_section_link no-hover" title="Delete this section"><%= image_tag "delete.png" %></a>
<a href="#" class="delete_page_section_link no-hover" title="<%= t('titles.delete_section', "Delete this section") %>"><%= image_tag "delete.png" %></a>
</div>
<div class="section_content">
<% if page_section %>
<% if !page_section["section_type"] || page_section["section_type"] == "rich_text" || page_section["section_type"] == "html" %>
<%= raw(page_section["content"] || "Nothing Entered Yet") %>
<%= raw(page_section["content"] || t('rich_text.default_content', "Nothing Entered Yet")) %>
<% elsif page_section["section_type"] == "attachment" %>
<div style="text-align: center;" class="attachment">
<% attachment = @portfolio.user.attachments.find(page_section["attachment_id"]) %>
<% if attachment && attachment.content_type.match(/\Aimage/) %>
<a href="<%= eportfolio_entry_view_file_path(@portfolio, @page, attachment.uuid) %>" class="no-hover"><%= image_tag eportfolio_entry_view_file_path(@portfolio, @page, attachment.uuid) %></a>
<% elsif attachment %>
<a href="<%= eportfolio_entry_view_file_path(@portfolio, @page, attachment.uuid) %>">Click here to Download <span class="filename"><%= attachment.display_name %></span></a>
<a href="<%= eportfolio_entry_view_file_path(@portfolio, @page, attachment.uuid) %>">
<%= t('links.download_attachment', "Click here to Download *%{attachment}*",
:attachment => attachment.display_name,
:wrapper => '<span class="filename">\1</span>') %>
</a>
<% end %>
</div>
<% elsif page_section["section_type"] == "submission" %>

View File

@ -3,30 +3,42 @@
<% if page_section %>
<div class="section_content">
<% if !page_section["section_type"] || page_section["section_type"] == "rich_text" || page_section["section_type"] == "html" %>
<%= page_section["content"] || "Nothing Entered Yet" %>
<%= page_section["content"] || t('rich_text.default_content', "Nothing Entered Yet") %>
<% elsif page_section["section_type"] == "attachment" %>
<div style="text-align: center;" class="attachment">
<% attachment = @static_attachments.find{|a| a.uuid == page_section["attachment_id"]} %>
<% if attachment && attachment.content_type.match(/\Aimage/) %>
<a href="<%= attachment.filename %>"><img src="<%= attachment.filename %>" alt="<%= attachment.filename %>"/></a>
<% elsif attachment %>
<a href="<%= attachment.filename %>">Click here to Download <span class="filename"><%= attachment.display_name %></span></a>
<a href="<%= attachment.filename %>">
<%= t('links.download_attachment', "Click here to Download *%{attachment}*",
:attachment => attachment.display_name,
:wrapper => '<span class="filename">\1</span>') %>
</a>
<% end %>
</div>
<% elsif page_section["section_type"] == "submission" %>
<% submission = @submissions_hash[page_section["submission_id"]] rescue nil %>
<% rendered = false %>
<% if submission %>
<div style="margin-bottom: 10px;">Student Submission for <%= submission.assignment.title %>, created <%= datetime_string(submission.submitted_at || submission.graded_at || submission.created_at) %></div>
<div style="margin-bottom: 10px;">
<%= t('headers.submission', "Student Submission for %{assignment}, created %{date}",
:assignment => submission.assignment.title,
:created => datetime_string(submission.submitted_at || submission.graded_at || submission.created_at)) %>
</div>
<% if submission.submission_type == 'online_url' %>
<a href="<%= submission.url %>">View the URL submitted for this assignment</a>
<a href="<%= submission.url %>"><%= t('links.submission_url', "View the URL submitted for this assignment") %></a>
<% rendered = true %>
<% elsif submission.submission_type = 'online_upload' %>
<ul>
<% submission.attachments.each do |a| %>
<% attachment = @static_attachments.find{|att| att.id == a.id } %>
<% if attachment %>
<li><a href="<%= attachment.filename %>">Click here to Download <%= a.display_name %></a></li>
<li><a href="<%= attachment.filename %>">
<%= t('links.download_attachment', "Click here to Download *%{attachment}*",
:attachment => a.display_name,
:wrapper => '<span class="filename">\1</span>') %>
</a></li>
<% end %>
<% end %>
</ul>
@ -39,7 +51,7 @@
<% end %>
<% end %>
<% if !rendered %>
There used to be a submission here, but we couldn't find it or didn't support the submission type for exporting.
<%= t(:not_rendered, "There used to be a submission here, but we couldn't find it or didn't support the submission type for exporting.") %>
<% end %>
<% end %>
</div>

View File

@ -2,7 +2,7 @@
<% @categories.each do |c| %>
<li id="section_<%= c.id %>" class="section <%= "active" if c == @category %>">
<span class="section_url">
<a href="#" class="edit_section_link"><%= image_tag "edit.png", :class => "editing_image", :title => "Rename this Section" %></a>
<a href="#" class="edit_section_link"><%= image_tag "edit.png", :class => "editing_image", :title => t('titles.rename_section', "Rename this Section") %></a>
<a class="name" href="<%= eportfolio_named_category_path(c.eportfolio, c.slug) %>"><%= c.name %></a>
<a href="<%= eportfolio_category_path(c.eportfolio, c.id) %>" class="remove_section_link">&#215;</a>
</span>
@ -11,23 +11,23 @@
<% end %>
<li id="section_blank" class="section unsaved" style="display: none;">
<span class="section_url">
<a href="#" class="edit_section_link"><%= image_tag "edit.png", :class => "editing_image", :title => "Rename this Section" %></a>
<a class="name" href="<%= eportfolio_named_category_path(@portfolio, "{{ slug }}") %>">Section Name</a>
<a href="#" class="edit_section_link"><%= image_tag "edit.png", :class => "editing_image", :title => t('titles.rename_section', "Rename this Section") %></a>
<a class="name" href="<%= eportfolio_named_category_path(@portfolio, "{{ slug }}") %>"><%= t(:default_section_name, "Section Name") %></a>
<a href="<%= eportfolio_category_path(@portfolio.id, "{{ id }}") %>" class="remove_section_link">&#215;</a>
</span>
<a class="rename_section_url" href="<%= eportfolio_category_path(@portfolio, "{{ id }}") %>" style="display: none;">&nbsp;</a>
</li>
</ul>
<ul style="font-size: 0.8em;line-height: 1.85em; font-style: italic; margin-left: 10px;" id="section_list_manage">
<li style="display: none;" class="add_section">&nbsp;<a href="#" class="add_section_link no-hover add">Add Section</a></li>
<li style="display: none;" class="add_section">&nbsp;<a href="#" class="add_section_link no-hover add"><%= t('links.add_section', "Add Section") %></a></li>
<li style="display: none;">
<a href="<%= eportfolio_categories_path(@portfolio) %>" class="add_section_url">&nbsp;</a>
<a href="<%= eportfolio_reorder_categories_path(@portfolio.id) %>" class="reorder_sections_url">&nbsp;</a>
</li>
<% if can_do(@portfolio, @current_user, :manage) %>
<li class="displaying_item"><a href="#" class="manage_sections_link" title="Add, remove or rearrange sections for this portfolio">Organize Sections</a></li>
<li class="editing_item" style="padding-bottom: 10px;"><button type="button" class="done_editing_button button small-button">Done Editing</button></li>
<li><a href="#" class="portfolio_settings_link">ePortfolio Settings</a></li>
<li class="displaying_item"><a href="#" class="manage_sections_link" title="<%= t('titles.manage_sections', "Add, remove or rearrange sections for this portfolio") %>"><%= manage_sections_link_text %></a></li>
<li class="editing_item" style="padding-bottom: 10px;"><button type="button" class="done_editing_button button small-button"><%= t('buttons.done_editing', "Done Editing") %></button></li>
<li><a href="#" class="portfolio_settings_link"><%= t('links.settings', "ePortfolio Settings") %></a></li>
<% end %>
</ul>
<span id="section_name_holder" class="section_url" style="display: none;">

View File

@ -10,8 +10,8 @@
<body>
<div id="container">
<div id="header">
<a href="#skip_navigation" id="skip_navigation_link">Skip Navigation</a>
<a href="http://www.instructure.com" title="Created with Canvas"><img class="logo" src="logo.png" alt="logo"/></a>
<a href="#skip_navigation" id="skip_navigation_link"><%= t('links.skip_navigation', "Skip Navigation") %></a>
<a href="http://www.instructure.com" title="<%= t('#created_with_canvas', "Created with Canvas") %>"><img class="logo" src="logo.png" alt="logo"/></a>
<h1><%= @page.name %></h1>
<h2><a href="<%= @page.eportfolio.eportfolio_categories.first.eportfolio_entries.first.full_slug %>.html"><%= @page.eportfolio.name %></a> &#187; <a href="<%= @page.eportfolio_category.eportfolio_entries.first.full_slug %>.html"><%= @page.eportfolio_category.name %></a></h2>
<div class="clear"></div>
@ -37,7 +37,7 @@
</div>
<% if !@page.page_comments.empty? %>
<div id="page_comments_holder" style="margin-top: 50px;">
<h2>Page Comments</h2>
<h2><%= t('headers.page_comments', "Page Comments") %></h2>
<div id="page_comments" style="padding: 5px 20px;">
<%= render :partial => "eportfolios/page_comment", :collection => @page.page_comments, :locals => {:read_only => true} %>
</div>

View File

@ -48,113 +48,169 @@ $(document).ready(function() {
<% content_for :wizard_box do %>
<div class="wizard_options" >
<% if @owner_view %>
<h3>Getting Started</h3>
<h3><%= t('headers.getting_started', "Getting Started") %></h3>
<% else %>
<h3>Using an ePortfolio</h3>
<h3><%= t('headers.instructions', "Using an ePortfolio") %></h3>
<% end %>
<ul class="wizard_options_list">
<li class="option information_step">
<a href="#" class="header">Introduction</a>
<a href="#" class="header"><%= t('headers.introduction', "Introduction") %></a>
<div class="details" style="display: none;">
ePortfolios are a place to demonstrate your work. They are made of sections and pages.
The list of sections are along the left side
of the window (<a href="#" class="sections_list_hover"><b>show me</b></a>). Each section can have multiple pages, shown on the right
side of the window (<a href="#" class="pages_list_hover"><b>show me</b></a>).
<%= t('introduction.body', <<-DETAILS,
ePortfolios are a place to demonstrate your work. They are made of
sections and pages. The list of sections are along the left side of
the window (%{showme1}). Each section can have multiple pages,
shown on the right side of the window (%{showme2}).
DETAILS
:showme1 => show_me('sections_list_hover'),
:showme2 => show_me('pages_list_hover')) %>
</div>
</li>
<li class="option content_step">
<a href="#" class="header">Portfolio Sections</a>
<a href="#" class="header"><%= t('headers.sections', "Portfolio Sections") %></a>
<div class="details" style="display: none;">
<div style="font-size: 0.8em;">
<p>Sections are listed along the left side of the window (<a href="#" class="sections_list_hover"><b>show me</b></a>).
Each section can have multiple pages inside of it. To organize or add sections, click the
"Organize Sections" link (<a href="#" class="organize_sections_hover"><b>show me</b></a>).</p>
<p>You can rename any section by clicking on the <%= image_tag "edit.png" %>
icon that appears, rearrange sections by clicking and dragging them, or delete sections
by clicking the &#215; icon.</p>
<p><%= t('sections.body1', <<-DETAILS,
Sections are listed along the left side of the window
(%{showme1}). Each section can have multiple pages inside of it.
To organize or add sections, click the "%{manage_sections}" link
(%{showme2}).
DETAILS
:showme1 => show_me('sections_list_hover'),
:manage_sections => manage_sections_link_text,
:showme2 => show_me('organize_sections_hover')) %></p>
<p><%= t('sections.body2', <<-DETAILS,
You can rename any section by clicking on the %{edit_icon} icon
that appears, rearrange sections by clicking and dragging them,
or delete sections by clicking the %{delete_icon} icon.
DETAILS
:edit_icon => edit_icon,
:delete_icon => delete_icon) %></p>
</div>
</div>
</li>
<li class="option content_step">
<a href="#" class="header">Section Pages</a>
<a href="#" class="header"><%= t('headers.pages', "Section Pages") %></a>
<div class="details" style="display: none;">
<div style="font-size: 0.8em;">
<p>Sections have multiple pages. You can see the list of pages for the current section
on the right side of the window (<a href="#" class="pages_list_hover"><b>show me</b></a>).
To organize or add pages, click the "Organize/Manage Pages" link
(<a href="#" class="organize_pages_hover"><b>show me</b></a>).</p>
<p>You can rename any page by click on the <%= image_tag "edit.png" %>
icon that appears, delete a page by clicking the &#215; icon, or rearrange the order
of pages by click and dragging them.</p>
<p><%= t('pages.body1', <<-DETAILS,
Sections have multiple pages. You can see the list of pages for
the current section on the right side of the window (%{showme1}).
To organize or add pages, click the "%{manage_pages}" link
(%{showme2}).
DETAILS
:showme1 => show_me('pages_list_hover'),
:manage_pages => manage_pages_link_text,
:showme2 => show_me('organize_pages_hover')) %></p>
<p><%= t('pages.body2', <<-DETAILS,
You can rename any page by click on the %{edit_icon} icon that
appears, delete a page by clicking the %{delete_icon} icon, or
rearrange the order of pages by click and dragging them.
DETAILS
:edit_icon => edit_icon,
:delete_icon => delete_icon) %></p>
</div>
</div>
</li>
<% if !@owner_view %>
<li class="option edit_step">
<a href="#" class="header">Page Content</a>
<a href="#" class="header"><%= t('headers.page_content', "Page Content") %></a>
<div class="details" style="display: none;">
The content you see on a page is the same content any visitors will see. To edit
this content, click the "<%= image_tag "edit.png" %> Edit This Page" link
(<a href="#" class="edit_content_hover"><b>show me</b></a>) and the page will
change to editing mode.
<%= t('page_content.body1', <<-DETAILS,
The content you see on a page is the same content any visitors
will see. To edit this content, click the "%{edit_link_text}"
link (%{showme}) and the page will change to editing mode.
DETAILS
:edit_link_text => edit_link_text,
:showme => show_me('edit_content_hover')) %>
</div>
</li>
<li class="option editing_mode" style="display: none;">
<a href="#" class="header">Page Content</a>
<a href="#" class="header"><%= t('headers.page_content', "Page Content") %></a>
<div class="details" style="display: none;">
<div style="font-size: 0.8em;">
<p>Now you're editing! Rename the page or change commenting options
(<a href="#" class="page_settings_hover"><b>show me</b></a>) if you like. You can save,
preview or cancel your changes at any time by clicking the button on the right
side <a href="#" class="page_buttons_hover"><b>show me</b></a>).</p>
<p>Content is divided into subsections, which each have a dotted border. You can
delete or edit the contents of a subsection by clicking the <%= image_tag "edit.png" %>
or <%= image_tag "delete.png" %> icons at the top right corner of the subsection.</p>
<p>To add new subsections, find and click the type of content you want to add in the
options list on the right side of the page
(<a href="#" class="page_add_subsection_hover"><b>show me</b></a>).
</p>
<p><%= t('page_content.body2', <<-DETAILS,
Now you're editing! Rename the page or change commenting
options (%{showme1}) if you like. You can save, preview or
cancel your changes at any time by clicking the button on the
right side (%{showme2}).
DETAILS
:showme1 => show_me('page_settings_hover'),
:showme2 => show_me('page_buttons_hover')) %></p>
<p><%= t('page_content.body3', <<-DETAILS,
Content is divided into subsections, which each have a dotted
border. You can delete or edit the contents of a subsection by
clicking the %{edit_icon} or %{delete_icon} icons at the top
right corner of the subsection.
DETAILS
:edit_icon => edit_icon,
:delete_icon => delete_icon(true)) %></p>
<p><%= t('page_content.body4', <<-DETAILS,
To add new subsections, find and click the type of content you
want to add in the options list on the right side of the page
(%{showme}).
DETAILS
:showme => show_me('page_add_subsection_hover')) %></p>
</div>
</div>
</li>
<% end %>
<% if @owner_view %>
<li class="option add_step adding_submissions">
<a href="#" class="header">Adding Submissions</a>
<a href="#" class="header"><%= t('headers.submissions', "Adding Submissions") %></a>
<div class="details" style="display: none;">
You may have noticed at the bottom of this page is a list of recent submissions
from your classes (<a href="#" class="recent_submissions_hover"><b>show me</b></a>).
You can quickly add submissions to new pages in your portfolio from this page. Just
click the submission you want to add and a simple dialog will pop up.
<%= t('submissions.body1', <<-DETAILS,
You may have noticed at the bottom of this page is a list of
recent submissions from your classes (%{showme}). You can quickly
add submissions to new pages in your portfolio from this page.
Just click the submission you want to add and a simple dialog
will pop up.
DETAILS
:showme => show_me('recent_submissions_hover')) %>
</div>
</li>
<li class="option adding_submissions_dialog" style="display: none;">
<a href="#" class="header">Adding Submissions</a>
<a href="#" class="header"><%= t('headers.submissions', "Adding Submissions") %></a>
<div class="details" style="display: none;">
Great! Now to finish adding the submission, you need to choose which section
you'd like to add it to and give the page a name. After you click "Add Page"
you'll be taken to the new page so you can edit it in more detail if you like.
<%= t('submissions.body2', <<-DETAILS)
Great! Now to finish adding the submission, you need to choose
which section you'd like to add it to and give the page a name.
After you click "Add Page" you'll be taken to the new page so you
can edit it in more detail if you like.
DETAILS
%>
</div>
</li>
<% end %>
<li class="option edit_step">
<a href="#" class="header">ePortfolio Settings</a>
<a href="#" class="header"><%= t('headers.settings', "ePortfolio Settings") %></a>
<div class="details" style="display: none;">
To change the settings for your ePortfolio, click the "ePortfolio Settings" link
(<a href="#" class="eportfolio_settings_hover"><b>show me</b></a>).
You can rename the portfolio and also change whether it is public or private. Private
portfolios are only visible to those to whom you grant access.
<%= t('settings.body', <<-DETAILS,
To change the settings for your ePortfolio, click the "ePortfolio
Settings" link (%{showme}). You can rename the portfolio and also
change whether it is public or private. Private portfolios are only
visible to those to whom you grant access.
DETAILS
:showme => show_me('eportfolio_settings_hover')) %>
</div>
</li>
<% if @owner_view %>
<li class="option publish_step">
<a href="#" class="header">Let's Do It</a>
<a href="#" class="header"><%= t('headers.finish', "Let's Do It") %></a>
<div class="details" style="display: none;">
Ready to get started? You can always get back to this wizard from any page
by clicking the "<%= image_tag "help.png" %> How Do I...?" link you'll see there.
<%= t('finish.body', <<-DETAILS,
Ready to get started? You can always get back to this wizard from
any page by clicking the "%{help_link_text}" link you'll
see there.
DETAILS
:help_link_text => help_link_text) %>
<div style="text-align: center; font-size: 1.2em;">
<b><a href="<%= eportfolio_path(@portfolio.id, :view => :preview) %>">
View the Portfolio
<%= t('links.portfolio', "View the Portfolio") %>
</a></b>
</div>
</div>
@ -164,7 +220,7 @@ $(document).ready(function() {
</div>
<div class="wizard_details">
<div>
<h3 class="header" style="display: none;">Step</h3>
<h3 class="header" style="display: none;"><%= t('#step', "Step") %></h3>
<div style="text-align: center; font-size: 1.5em; margin-top: 5px;">
<a class="link">&nbsp;</a>
</div>

View File

@ -1,3 +1,3 @@
This ePortfolio is not publicly visible. If you know the portfolio's owner, you can
ask them to grant you access to the portfolio. Otherwise, you're out of luck.
<%= t(:content, "This ePortfolio is not publicly visible. If you know the portfolio's owner, you can
ask them to grant you access to the portfolio. Otherwise, you're out of luck.") %>

View File

@ -4,9 +4,9 @@
<% content_for :auto_discovery do %>
<% if can_do(@portfolio, @current_user, :update) %>
<%= auto_discovery_link_tag(:atom, feeds_eportfolio_path(@portfolio.id, :atom, :verifier => @portfolio.uuid), {:title => "Eportfolio Atom Feed"}) %>
<%= auto_discovery_link_tag(:atom, feeds_eportfolio_path(@portfolio.id, :atom, :verifier => @portfolio.uuid), {:title => t('titles.feed', "Eportfolio Atom Feed") }) %>
<% elsif @portfolio.public %>
<%= auto_discovery_link_tag(:atom, feeds_eportfolio_path(@portfolio.id, :atom), {:title => "Eportfolio Atom Feed"}) %>
<%= auto_discovery_link_tag(:atom, feeds_eportfolio_path(@portfolio.id, :atom), {:title => t('titles.feed', "Eportfolio Atom Feed") }) %>
<% end %>
<% end %>
@ -20,35 +20,33 @@
<div id="page_sidebar">
<% if can_do(@portfolio, @current_user, :manage) && !@owner_view %>
<div class="rs-margin-all">
<a href="#" class="wizard_popup_link">
<%= image_tag "help.png" %> How Do I...?
</a>
<a href="#" class="wizard_popup_link"><%= help_link_text %></a>
</div>
<% end %>
<%= render :partial => "eportfolios/page_list" %>
<% if can_do(@portfolio, @current_user, :manage) && !@owner_view %>
<div class="rs-margin-lr edit_content_link_holder">
<a href="#" class="edit_content_link button button-sidebar-wide"><%= image_tag "edit.png" %> Edit this Page</a>
<a href="<%= eportfolio_path(@portfolio.id) %>" class="back">Back to Portfolio Dashboard</a>
<a href="#" class="edit_content_link button button-sidebar-wide"><%= edit_link_text %></a>
<a href="<%= eportfolio_path(@portfolio.id) %>" class="back"><%= t('links.back', "Back to Portfolio Dashboard") %></a>
</div>
<div id="edit_page_sidebar">
<h2 class="header">Add Content</h2>
<h2 class="header"><%= t('headers.add_content', "Add Content") %></h2>
<div class="rs-margin-lr">
<ul>
<li><a class="add_content_link add_rich_content_link" href="#">Rich Text Content</a></li>
<li><a class="add_content_link add_html_link" href="#">HTML/Embedded Content</a></li>
<li><a class="add_content_link add_submission_link" href="#">Course Submission</a></li>
<li><a class="add_content_link add_file_link" href="#">Image/File Upload</a></li>
<li><a class="add_content_link add_rich_content_link" href="#"><%= t('links.rich_content', "Rich Text Content") %></a></li>
<li><a class="add_content_link add_html_link" href="#"><%= t('links.html_content', "HTML/Embedded Content") %></a></li>
<li><a class="add_content_link add_submission_link" href="#"><%= t('links.choose_submission', "Course Submission") %></a></li>
<li><a class="add_content_link add_file_link" href="#"><%= t('links.file_uload', "Image/File Upload") %></a></li>
</ul>
<div class="form_content button-container">
<button type="button" class="submit_button button small-button button-default">Save Page</button>
<button type="button" class="preview_button button small-button">Preview</button>
<button type="button" class="cancel_button button-secondary">Cancel</button>
<button type="button" class="submit_button button small-button button-default"><%= t('buttons.save_page', "Save Page") %></button>
<button type="button" class="preview_button button small-button"><%= t('buttons.preview', "Preview") %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#cancel', "Cancel") %></button>
</div>
<div class="preview_content button-container">
<button type="button" class="submit_button button small-button button-default">Save Page</button>
<button type="button" class="keep_editing_button button small-button">Keep Editing</button>
<button type="button" class="cancel_button button-secondary">Cancel</button>
<button type="button" class="submit_button button small-button button-default"><%= t('buttons.save_page', "Save Page") %></button>
<button type="button" class="keep_editing_button button small-button"><%= t('buttons.keep_editing', "Keep Editing") %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#cancel', "Cancel") %></button>
</div>
</div>
</div>
@ -57,51 +55,63 @@
<% end %>
<% if @owner_view %>
<h2>Welcome to Your ePortfolio</h2>
<p>If this is your first time here, you may want to pop up the wizard and
see how best to get started. Otherwise you can quickly add recent submissions
or just jump straight to the portfolio.
</p>
<h2><%= t('headers.welcome', "Welcome to Your ePortfolio") %></h2>
<p><%= t(:welcome, <<-DETAILS)
If this is your first time here, you may want to pop up the wizard and see
how best to get started. Otherwise you can quickly add recent submissions
or just jump straight to the portfolio.
DETAILS
%></p>
<ul class="unstyled_list" style="padding-left: 20px; margin-bottom: 20px; line-height: 1.8em; font-size: 1.2em;">
<li><a href="#" class="wizard_popup_link help">Getting Started Wizard</a></li>
<li><a href="?view=preview" class="forward"> Go to the Actual ePortfolio</a></li>
<li><a href="#" class="wizard_popup_link help"><%= t('links.wizard', "Getting Started Wizard") %></a></li>
<li><a href="?view=preview" class="forward"><%= t('links.portfolio', "Go to the Actual ePortfolio") %></a></li>
</ul>
<% if @portfolio.public %>
<h3>Your ePortfolio is Public</h3>
<p>That means anyone who knows the address of your portfolio can view it. You can
make your portfolio private by
<a href="#" class="portfolio_settings_link"><b>changing your portfolio settings</b></a>.
<h3><%= t('headers.public_eportfolio', "Your ePortfolio is Public") %></h3>
<p><%= t(:public_eportfolio, <<-DETAILS,
That means anyone who knows the address of your portfolio can view it.
You can make your portfolio private by *changing your portfolio
settings*.
DETAILS
:wrapper => '<a href="#" class="portfolio_settings_link"><b>\1</b></a>') %></p>
<% else %>
<h3>Your ePortfolio is Private</h3>
<p>That means people can't find it or even view it without permission. You can see
it since it's your portfolio, but if you want to let anybody else see it, you'll
need to copy and share the the following special link so they can access your portfolio:
</p>
<h3><%= t('headers.private_eportfolio', "Your ePortfolio is Private") %></h3>
<p><%= t(:private_eportfolio, <<-DETAILS)
That means people can't find it or even view it without permission. You
can see it since it's your portfolio, but if you want to let anybody else
see it, you'll need to copy and share the the following special link so
they can access your portfolio:
DETAILS
%></p>
<p>
<a href="<%= eportfolio_path(@portfolio.id, :verifier => @portfolio.uuid) %>"><b style="font-size: 1.2em;">Copy and share this link to give others access to your private ePortfolio.</b></a>
<a href="<%= eportfolio_path(@portfolio.id, :verifier => @portfolio.uuid) %>"><b style="font-size: 1.2em;">
<%= t('links.share', "Copy and share this link to give others access to your private ePortfolio.") %>
</b></a>
</p>
<% end %>
<h3>Recent Submissions</h3>
<p>Click any submission to add it to a new page in your ePortfolio.</p>
<h3><%= t('headers.recent_submissions', "Recent Submissions") %></h3>
<p><%= t(:recent_submissions, "Click any submission to add it to a new page in your ePortfolio.") %></p>
<% if @portfolio.user.submissions.empty? %>
<div style="margin: 5px 20px;">No Submissions Found</div>
<div style="margin: 5px 20px;"><%= t(:no_submissions, "No Submissions Found") %></div>
<% end %>
<ul class="submission_list" id="recent_submissions" style="max-height: 200px; overflow: auto;">
<% @portfolio.user.submissions.each do |submission| %>
<% already_used = (@used_submission_ids.include?(submission.id) rescue false) %>
<li class="submission <%= 'already_used' if already_used %>" title="<%= "This submission is already included in your portfolio" if already_used %>" id="recent_submission_<%= submission.id %>">
<li class="submission <%= 'already_used' if already_used %>" title="<%= t('titles.already_used', "This submission is already included in your portfolio") if already_used %>" id="recent_submission_<%= submission.id %>">
<a href="<%= eportfolio_entry_preview_submission_path(@portfolio, @page, submission.id) %>" style="display: none;" class="submission_preview_url"></a>
<div style="float: right; font-size: 0.8em; color: #aaa; margin-right: 20px; margin-top: 0.5em;">
<%= datetime_string(submission.submitted_at || submission.updated_at) %>
&nbsp;<a href="<%= context_url(submission.assignment.context, :context_assignment_submission_url, submission.assignment_id, submission.id) %>" target="_blank" class="no-hover"><%= image_tag "popout.png", :title => "View the Submission" %></a>
&nbsp;<a href="<%= context_url(submission.assignment.context, :context_assignment_submission_url, submission.assignment_id, submission.id) %>" target="_blank" class="no-hover"><%= image_tag "popout.png", :title => t('titles.view_submission', "View the Submission") %></a>
</div>
<span class="text" style="font-size: 1.2em;">
<span class="text assignment_title"><%= submission.assignment.title %></span>
<span style="font-size: 0.8em; padding-left: 5px;" class="text context_name"><%= submission.assignment.context.name %></span>
</span>
<div style="font-size: 0.8em; color #aaa; margin-left: 20px;"><%= pluralize(submission.attachments.length, "Attachment") unless submission.attachments.empty? %></div>
<div style="font-size: 0.8em; color #aaa; margin-left: 20px;">
<%= t(:attachment_count, { :one => "1 Attachment", :other => "%{count} Attachments" },
:count => submission.attachments.length) unless submission.attachments.empty? %></div>
<span class="submission_id" style="display: none;"><%= submission.id %></span>
<div class="clear"></div>
</li>
@ -135,25 +145,30 @@
<input type="hidden" name="section_2[section_type]" value="submission"/>
<input type="hidden" name="section_2[submission_id]" class="submission_id" value=""/>
<input type="hidden" name="section_count" value="2"/>
<p style="font-size: 0.8em;">To make a new page for this submission, select a section and enter the name for the
new page.</p>
<p style="font-size: 0.8em;"><%= t(:add_submission, <<-INSTRUCTIONS)
To make a new page for this submission, select a section and enter the
name for the new page.
INSTRUCTIONS
%></p>
<table class="formtable">
<tr>
<td>Section:</td>
<td><%= before_label(:section, "Section") %></td>
<td>
<select id="category_select" name="eportfolio_entry[eportfolio_category_id]">
<% @portfolio.eportfolio_categories.each do |category| %>
<option value="<%= category.id %>" id="category_select_<%= category.id %>"><%= category.name %></option>
<% end %>
<option value="new" id="category_select_blank" style="display: none;">New Section</option>
<option value="new" id="category_select_blank" style="display: none;">
<%= t(:new_section, "New Section") %>
</option>
</select>
</td>
</tr><tr>
<td>Page Name:</td>
<td><%= before_label(:page_name, "Page Name") %></td>
<td><input type="text" name="eportfolio_entry[name]" style="width: 100px;"/></td>
</tr><tr>
<td colspan="2" style="padding-left: 20px; font-size: 0.8em; padding-top: 10px;">
Current Pages
<%= t(:current_pages, "Current Pages") %>
<ul id="page_select_list" class="unstyled_list" style="padding-left: 20px; margin-top: 5px;">
<li class="page_select" id="page_select_blank" style="display: none;">
</li>
@ -162,8 +177,8 @@
</tr>
</table>
<div class="button-container">
<button type="submit" class="button">Add Page</button>
<button type="button" class="cancel_button button-secondary">Cancel</button>
<button type="submit" class="button"><%= t('buttons.add_page', "Add Page") %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#cancel', "Cancel") %></button>
</div>
<div style="display: none;">
<a class="add_eportfolio_entry_url" href="<%= eportfolio_entries_path(@portfolio.id) %>">&nbsp;</a>
@ -172,13 +187,13 @@
</form>
<% else %>
<% if can_do(@portfolio, @current_user, :manage) %>
<div style="float: right; display: none;"><a href="#" class="edit_content_link edit">Edit This Page</a></div>
<div style="float: right; display: none;"><a href="#" class="edit_content_link edit"><%= edit_link_text %></a></div>
<% end %>
<h2><%= @page.name %></h2>
<% idx = 1 %>
<% form_for @page, :url => eportfolio_entry_url(@portfolio, @page), :html => {:id => "edit_page_form" } do |f| %>
<div class="form_content">
<%= f.label :name, "Page Name:" %>
<%= f.label :name, before_label(:page_name, "Page Name") %>
<%= f.text_field :name %>
</div>
<div id="page_content">
@ -189,27 +204,27 @@
</div>
<div class="form_content">
<%= f.check_box :allow_comments, :class => "allow_comments" %>
<%= f.label :allow_comments, "Allow Comments on this Page" %>
<%= f.label :allow_comments, t('labels.allow_comments', "Allow Comments on this Page") %>
<div style="margin-left: 40px;" class="show_comments_box <%= "disabled" unless @page.allow_comments %>">
<%= f.check_box :show_comments, :class => "show_comments" %>
<%= f.label :show_comments, "Make Comments Public" %>
<%= f.label :show_comments, t('labels.show_comments', "Make Comments Public") %>
</div>
</div>
<div class="form_content button-container">
<button type="submit" class="button button-default">Save Page</button>
<button type="button" class="preview_button button">Preview</button>
<button type="button" class="cancel_button button-secondary">Cancel</button>
<button type="submit" class="button button-default"><%= t('buttons.save_page', "Save Page") %></button>
<button type="button" class="preview_button button"><%= t('buttons.preview', "Preview") %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#cancel', "Cancel") %></button>
</div>
<div class="preview_content button-container">
<button type="submit" class="button button-default">Save Page</button>
<button type="button" class="keep_editing_button button">Keep Editing</button>
<button type="button" class="cancel_button button-secondary">Cancel</button>
<button type="submit" class="button button-default"><%= t('buttons.save_page', "Save Page") %></button>
<button type="button" class="keep_editing_button button"><%= t('buttons.keep_editing', "Keep Editing") %></button>
<button type="button" class="cancel_button button-secondary"><%= t('#cancel', "Cancel") %></button>
</div>
<table class="formtable" style="width: 100%; display: none;">
<tr>
<td colspan="2">
<div style="text-align: right; margin-right: 5%;">
<a href="#" class="switch_views_link" style="font-size: 0.8em;">Switch Views</a>
<a href="#" class="switch_views_link" style="font-size: 0.8em;"><%= t('links.switch_views', "Switch Views") %></a>
</div>
<%= f.text_area :content, :id => "edit_page_content", :style => "width: 98%; height: 300px;" %>
</td>
@ -229,13 +244,13 @@
<textarea class="edit_section" id="edit_section_blank" style="width: 95%; margin-left: auto; margin-right: auto; height: 200px;"></textarea>
</div>
<div class="edit_html_content form_content" style="display: none;">
Copy and paste your HTML code into the box below:<br/>
<%= before_label(:html_content, "Copy and paste your HTML code into the box below") %><br/>
<textarea class="edit_section" id="edit_html_section_blank" style="width: 95%; margin-left: auto; margin-right: auto; height: 150px;"></textarea>
</div>
<div class="edit_submission_content form_content" style="display: none;">
Select an assignment submission to embed in this page:<br/>
<%= before_label(:choose_submission, "Select an assignment submission to embed in this page") %><br/>
<% if @portfolio.user.submissions.empty? %>
<div style="margin: 5px 20px;">No Submissions Found</div>
<div style="margin: 5px 20px;"><%= t(:no_submissions, "No Submissions Found") %></div>
<% end %>
<ul class="submission_list">
<% @portfolio.user.submissions.each do |submission| %>
@ -243,41 +258,43 @@
<a href="<%= eportfolio_entry_preview_submission_path(@portfolio, @page, submission.id) %>" style="display: none;" class="submission_preview_url"></a>
<div style="float: right; font-size: 0.8em; color: #aaa; margin-right: 20px; margin-top: 0.5em;"><%= datetime_string(submission.submitted_at || submission.updated_at) %></div>
<span class="text" style="font-size: 1.2em;"><%= submission.assignment.title %>, <%= submission.assignment.context.name %></span>
<div style="font-size: 0.8em; color #aaa; margin-left: 20px;"><%= pluralize(submission.attachments.length, "Attachment") unless submission.attachments.empty? %></div>
<div style="font-size: 0.8em; color #aaa; margin-left: 20px;">
<%= t(:attachment_count, { :one => "1 Attachment", :other => "%{count} Attachments" },
:count => submission.attachments.length) unless submission.attachments.empty? %></div>
<div class="clear"></div>
</li>
<% end %>
</ul>
<div class='button-container button-container-right-aligned'>
<button type="button" class="select_submission_button button small-button">Select Submission</button>
<button type="button" class="cancel_content_button button-secondary">Cancel</button>
<button type="button" class="select_submission_button button small-button"><%= t('buttons.select_submission', "Select Submission") %></button>
<button type="button" class="cancel_content_button button-secondary"><%= t('#cancel', "Cancel") %></button>
</div>
</div>
<div class="edit_attachment_content form_content" style="display: none;">
<div style="width: 400px; margin: 0 auto; text-align: left;">
Select a file to include on this page:<br/>
<%= before_label(:file_select, "Select a file to include on this page") %><br/>
<div class="file_list" style="margin-left: 50px; max-height: 200px; overflow: auto;">
<b><%= "No Files Uploaded" if @portfolio.user.attachments.active.empty? %></b>
<b><%= t(:no_files, "No Files Uploaded") if @portfolio.user.attachments.active.empty? %></b>
<% unless @portfolio.user.attachments.active.empty? %>
<%= render :partial => "files/nested_content", :object => (@folders.select{|f| !f.parent_folder_id}), :locals => {:folders => @folders} %>
<% end %>
</div><br/>
Or upload a new file:<br/>
<%= before_label(:file_upload, "Or upload a new file") %><br/>
<%= file_field :attachment, :uploaded_data, :class => "file_upload", :style => "padding-left: 50px;" %>
<div style="font-size: 0.8em; margin-left: 20px;">limit 50MB per file</div>
<div style="font-size: 0.8em; margin-left: 20px;"><%= t(:upload_limit, "limit 50MB per file") %></div>
</div>
<div class='button-container button-container-right-aligned'>
<button type="button" class="upload_file_button button small-button">Select/Upload File</button>
<button type="button" class="cancel_content_button button-secondary">Cancel</button>
<button type="button" class="upload_file_button button small-button"><%= t('buttons.upload_file', "Select/Upload File") %></button>
<button type="button" class="cancel_content_button button-secondary"><%= t('#cancel', "Cancel") %></button>
</div>
</div>
<div class="loading_submission" style="text-align: center;">
<%= image_tag "ajax-loader-bar.gif" %><br/>
Loading Submission: <span class="submission_name">&nbsp;</span>...
<%= before_label(:loading_submission, "Loading Submission") %><span class="submission_name">&nbsp;</span>...
</div>
<div class="uploading_file" style="text-align: center;">
<%= image_tag "ajax-loader-bar.gif" %><br/>
Uploading: <span class="file_name">&nbsp;</span>...
<%= before_label(:uploading_file, "Uploading") %><span class="file_name">&nbsp;</span>...
</div>
<% form_for :attachment, :url => context_url(@portfolio.user, :controller => :files, :action => :create, :format => "text"), :html => {:id => "upload_file_form"} do |f| %>
<% end %>
@ -295,17 +312,17 @@
<% form_for @portfolio, :url => eportfolio_path(@portfolio), :html => {:style => "display: none; position: relative;", :id => "edit_eportfolio_form"} do |f| %>
<table class="formtable">
<tr>
<td><%= f.label :name, "ePortfolio Name:" %></td>
<td><%= f.label :name, before_label(:eportfolio_name, "ePortfolio Name") %></td>
<td><%= f.text_field :name %></td>
</tr><tr>
<td colspan="2">
<%= f.check_box :public %>
<%= f.label :public, "Make it Public" %>
<%= f.label :public, t('labels.make_public', "Make it Public") %>
</td>
</tr>
<tr>
<td colspan="2" class="button-container-right-aligned">
<button type="submit" class="button">Update ePortfolio</button>
<button type="submit" class="button"><%= t('buttons.update_eportfolio', "Update ePortfolio") %></button>
</td>
<td>
</table>
@ -314,33 +331,37 @@
<div id="page_comments_holder" style="margin-top: 50px;">
<h2 style="<%= hidden unless @page.show_comments || @page.allow_comments || can_do(@portfolio, @current_user, :update) %>">Page Comments</h2>
<% if @page.show_comments || can_do(@portfolio, @current_user, :update) %>
<% if !@page.page_comments.empty? || @page.show_comments %>
<% if !@page.show_comments %>
<p>Right now only you can see the comments for this page. You can make the
comments public if you like by <a href="#" class="edit_content_link"><b>changing the settings for this page</b></a>.
</p>
<% end %>
<% if !@page.page_comments.empty? && !@page.show_comments %>
<p><%= t(:private_comments, <<-DETAILS,
Right now only you can see the comments for this page. You can make the
comments public if you like by *changing the settings for this page*.
DETAILS
:wrapper => '<a href="#" class="edit_content_link"><b>\1</b></a>') %></p>
<% end %>
<div id="page_comments" style="padding: 5px 20px;">
<%= "No Comments" if @page.page_comments.empty? %>
<%= t(:no_comments, "No Comments") if @page.page_comments.empty? %>
<%= render :partial => "eportfolios/page_comment", :collection => @page.page_comments %>
</div>
<%= render :partial => "eportfolios/page_comment", :object => nil %>
<% elsif @page.allow_comments %>
<p>Comments for this page are private. You can make comments, but only the portfolio's owner
will be able to see them.</p>
<p><%= t(:write_only_comments, <<-DETAILS)
Comments for this page are private. You can make comments, but only the
portfolio's owner will be able to see them.
DETAILS
%></p>
<% end %>
<% if @page.allow_comments %>
<% form_for :page_comment, :url => eportfolio_entry_page_comments_path(@portfolio.id, @page.id), :html => {:id => "add_page_comment_form", :style => "margin-top: 20px;"} do |f| %>
<h3>Add a New Comment:</h3>
<h3><%= before_label(:add_comment, "Add a New Comment") %></h3>
<% if @current_user %>
<%= f.text_area :message, :style => "width: 400px; height: 75px;" %>
<div class="button-container">
<button type="submit" class="button">Add Comment</button>
<button type="submit" class="button"><%= t('buttons.add_comment', "Add Comment") %></button>
</div>
<% else %>
<div style="text-align: center; font-size: 1.2em; margin: 10px;">
You must be <a href="<%= login_path %>"><b>logged in</b></a> to make comments on this page.
<%= t(:login_required, "You must be *logged in* to make comments on this page.",
:wrapper => "<a href=\"#{login_path}\"><b>\\1</b></a>") %>
</div>
<% end %>
<% end %>
@ -349,11 +370,10 @@
<% end %>
<% if @owner_view %>
<div style="text-align: left; font-size: 1.2em; margin: 30px 10px 0;">
<a href="<%= eportfolio_export_portfolio_path(@portfolio.id) %>" class="download_eportfolio_link download">Download the contents of this ePortfolio as a zip file</a>
<a href="<%= eportfolio_export_portfolio_path(@portfolio.id) %>" class="download_eportfolio_link download"><%= t('links.download_eportfolio', "Download the contents of this ePortfolio as a zip file") %></a>
<div style="display: none; font-size: 1.2em;" id="downloading_eportfolio_message">
<span class="message">
Collecting ePortfolio resources. this may take a while if you have a lot of files
in your ePortfolio.
<%= t('headers.export_progress', "Collecting ePortfolio resources. this may take a while if you have a lot of files in your ePortfolio.") %>
</span>
<div style="margin: 20px 10px;">
<div id="export_progress"></div>
@ -361,14 +381,16 @@
</div>
</div>
<div style="text-align: left; font-size: 1.2em; margin: 30px 10px 0;">
<a href="<%= eportfolio_url(@portfolio.id) %>" class="delete_eportfolio_link delete">Delete this ePortfolio</a>
<a href="<%= eportfolio_url(@portfolio.id) %>" class="delete_eportfolio_link delete"><%= t('links.delete', "Delete this ePortfolio") %></a>
</div>
<% form_tag eportfolio_url(@portfolio.id), {:method => :delete, :id => "delete_eportfolio_form", :style => "margin-top: 20px; margin-left: 20px; display: none;"} do %>
You currently have <%= pluralize(@portfolio.eportfolio_entries.count, "page") %> in this ePortfolio.
Are you sure you want to delete the entire ePortfolio?
<%= t(:delete_confirm, {
:one => "You currently have 1 page in this ePortfolio. Are you sure you want to delete the entire ePortfolio?",
:other => "You currently have %{count} pages in this ePortfolio. Are you sure you want to delete the entire ePortfolio?"
}, :count => @portfolio.eportfolio_entries.count) %>
<div class="button-container">
<button type="submit" class="button">Delete ePortfolio</button>
<button type="button" class="button-secondary delete_eportfolio_link">Cancel</button>
<button type="submit" class="button"><%= t('buttons.delete', "Delete ePortfolio") %></button>
<button type="button" class="button-secondary delete_eportfolio_link"><%= t('#cancel', "Cancel") %></button>
</div>
<% end %>
<% end %>
@ -376,10 +398,10 @@
<a href="<%= eportfolio_entry_view_file_path(@portfolio.id, @page.id, "{{ uuid }}") %>" class="eportfolio_download_url">&nbsp;</a>
<div id="eportfolio_category_id"><%= @category.id %></div>
<div id="eportfolio_view_image" style="text-align: center;">
<a href="#" class="eportfolio_download" title="View the Original File"><img src="#" class="eportfolio_image"/><a/>
<a href="#" class="eportfolio_download" title="<%= t('links.view_original', "View the Original File") %>"><img src="#" class="eportfolio_image"/><a/>
</div>
<div id="eportfolio_download_file" style="text-align: center;">
<a href="#" class="eportfolio_download">Click here to download <span class="filename">&nbsp;</span></a>
<a href="#" class="eportfolio_download"><%= t('links.download_file', "Click here to download %{filename}", :filename => raw('<span class="filename">&nbsp;</span>')) %></a>
</div>
</div>

View File

@ -1,10 +1,10 @@
<% content_for :page_title do %>
My ePortfolios
<%= t(:page_title, "My ePortfolios") %>
<% end %>
<% content_for :right_side do %>
<div class="rs-margin-lr rs-margin-top">
<a href="#" class="add_eportfolio_link button button-sidebar-wide"><%= image_tag "add.png" %> Create an ePortfolio</a>
<a href="#" class="add_eportfolio_link button button-sidebar-wide"><%= image_tag "add.png" %><%= t('links.create', "Create an ePortfolio") %></a>
</div>
<% end %>
@ -14,28 +14,29 @@
#sidebar{ display:none;}
</style>
<div id="whats_an_eportfolio">
<h2>What's an ePortfolio?</h2>
<p>ePortfolios are a place where you can display and discuss the significant
submissions and experiences that are happening during your learning process.
You can use an ePortfolio to:</p>
<ul>
<li>Display the papers you're proud of for more than just your instructor to see</li>
<li>Talk about all the thought and work that went into your class submissions</li>
<li>Gather an overview of your educational experience as a whole</li>
<li>Share your work with friends, future employers, etc.</li>
</ul>
<p>ePortfolios can be public for everyone to see, or private so only those you allow can
see, and you can change that setting at any time.</p>
<p>Ready to get started? Click the button.</p>
<h2><%= t('headers.what', "What's an ePortfolio?") %></h2>
<%= mt('what.details1', <<-DETAILS)
ePortfolios are a place where you can display and discuss the significant
submissions and experiences that are happening during your learning
process. You can use an ePortfolio to:
* Display the papers you're proud of for more than just your instructor to see
* Talk about all the thought and work that went into your class submissions
* Gather an overview of your educational experience as a whole
* Share your work with friends, future employers, etc.
ePortfolios can be public for everyone to see, or private so only those you
allow can see, and you can change that setting at any time.
Ready to get started? Click the button.
DETAILS
%>
<div class="button-container">
<a href="#" class="add_eportfolio_link button button-sidebar-wide"><%= image_tag "add.png" %> Create an ePortfolio</a>
<a href="#" class="add_eportfolio_link button button-sidebar-wide"><%= image_tag "add.png" %><%= t('links.create', "Create an ePortfolio") %></a>
</div>
</div>
<% else %>
<h2>My ePortfolios</h2>
<h2><%= t('headers.my_eportfolios', "My ePortfolios") %></h2>
<ul class="unstyled_list" style="padding-left: 20px;">
<%= render :partial => "eportfolio", :collection => @portfolios %>
</ul>
@ -58,37 +59,21 @@ $(document).ready(function() {
</script>
<% end %>
<% form_for Eportfolio.new, :url => eportfolios_path, :html => {:style => "display: none;", :id => "add_eportfolio_form"} do |f| %>
<h2>Make an ePortfolio</h2>
<h2><%= t('headers.add_eportfolio', "Make an ePortfolio") %></h2>
<table class="formtable">
<tr>
<td><%= f.label :name, "ePortfolio Name:" %></td>
<td><%= f.text_field :name, :value => "My Portfolio" %></td>
<td><%= f.label :name, before_label(:eportfolio_name, "ePortfolio Name") %></td>
<td><%= f.text_field :name, :value => t('defaults.eportfolio_name', "My Portfolio") %></td>
</tr><tr>
<td colspan="2">
<%= f.check_box :public, :value => true %>
<%= f.label :public, "Make it Public", :checked => true %>
<%= f.label :public, t('labels.make_public', "Make it Public"), :checked => true %>
</td>
</tr><!--tr>
<td>This is For:</tr>
<td>
<select>
<optgroup label="My Class">
<option value="">Biology 100</option>
<option value="">Biology 100</option>
</optgroup>
<optgroup label="My Institution">
<option value="">Biology 100</option>
</optgroup>
<optgroup label="Other">
<option value="">Biology 100</option>
</optgroup>
</select>
</td>
</tr--><tr>
</tr><tr>
<td colspan="2">
<button class="button " id="eportfolio_submit" name="commit" type="submit">Make ePortfolio</button>
<button type="button" class="cancel_button button-secondary" style>Cancel</button>
<button class="button " id="eportfolio_submit" name="commit" type="submit"><%= t('buttons.add_eportfolio', "Make ePortfolio") %></button>
<button type="button" class="cancel_button button-secondary" style><%= t('#cancel', "Cancel") %></button>
</td>
<td>
</table>
<% end %>
<% end %>

View File

@ -24,6 +24,9 @@
// the worst they can do is override endpoint urls for eportfolio
// settings on their own personal eportfolio, they can't
// affect anyone else
I18n.scoped('eportfolio', function(I18n) {
(function eportfolioInit() {
function ePortfolioFormData() {
var data = $("#edit_page_form").getFormData({
@ -60,7 +63,7 @@
$("#edit_eportfolio_form").dialog('close').dialog({
autoOpen: false,
width: "auto",
title: "ePortfolio Settings"
title: I18n.t('eportfolio_settings', "ePortfolio Settings")
}).dialog('open');
});
$("#edit_eportfolio_form .cancel_button").click(function(event) {
@ -189,16 +192,16 @@
$section.attr('id', 'page_section_' + sectionCountIdx++);
$("#page_content").append($section);
var section_type = "rich_text";
var section_type_name = "Rich Text Content"
var section_type_name = I18n.t('#eportfolios._page_section.section_types.rich_text', "Rich Text Content")
if($(this).hasClass('add_html_link')) {
section_type = "html";
section_type_name = "HTML/Embedded Content";
section_type_name = I18n.t('#eportfolios._page_section.section_types.html', "HTML/Embedded Content");
} else if($(this).hasClass('add_submission_link')) {
section_type = "submission";
section_type_name = "Course Submission";
section_type_name = I18n.t('#eportfolios._page_section.section_types.submission', "Course Submission");
} else if($(this).hasClass('add_file_link')) {
section_type = "attachment";
section_type_name = "Image/File Upload";
section_type_name = I18n.t('#eportfolios._page_section.section_types.attachment', "Image/File Upload");
}
var edit_type = "edit_" + section_type + "_content";
$section.fillTemplateData({
@ -326,7 +329,7 @@
}
$(this).remove();
} else {
$(this).errorBox('Please select a file');
$(this).errorBox(I18n.t('errors.missing_file', 'Please select a file'));
}
return false;
}
@ -358,7 +361,7 @@
},
error: function(data) {
var $section = $(this).data("section");
$section.find(".uploading_file").html("Upload Failed.");
$section.find(".uploading_file").html(I18n.t('errors.upload_failed', "Upload Failed."));
$section.addClass('failed');
$section.formErrors(data.errors || data);
}
@ -373,10 +376,12 @@
$("#add_submission_form .submission_id").val(id);
var assignment = $(this).find(".assignment_title").text();
var context = $(this).find(".context_name").text();
$("#add_submission_form .submission_description").val("This is my " + assignment + " submission for " + context + ".");
$("#add_submission_form .submission_description").val(
I18n.t('default_description', "This is my %{assignment} submission for %{course}.",
{ 'assignment': assignment, 'course': context }));
$("#add_submission_form").dialog('close').dialog({
autoOpen: false,
title: 'Add Page for Submission',
title: I18n.t('titles.add_submission', 'Add Page for Submission'),
width: 400,
open: function() {
$(this).find(":text:visible:first").val(assignment).focus().select();
@ -429,7 +434,7 @@
event.preventDefault();
$(this).parents(".comment").confirmDelete({
url: $(this).attr('href'),
message: "Are you sure you want to delete this message?",
message: I18n.t('confirm_delete_message', "Are you sure you want to delete this message?"),
success: function(data) {
$(this).slideUp(function() {
$(this).remove();
@ -594,7 +599,7 @@
$("#section_pages").removeClass('editing');
} else {
$("#page_list").addClass('editing');
$("#page_list .page").attr('title', 'Click to edit, drag to reorder');
$("#page_list .page").attr('title', I18n.t('links.manage_pages', 'Click to edit, drag to reorder'));
$("#page_list").sortable({
axis: 'y',
helper: 'clone',
@ -644,7 +649,7 @@
event.preventDefault();
hideEditObject('page');
$(this).parents("li").confirmDelete({
message: "Delete this page and all its content?",
message: I18n.t('confirm_delete_page', "Delete this page and all its content?"),
url: $(this).parents("li").find(".rename_page_url").attr('href'),
success: function(data) {
$(this).fadeOut(function() {
@ -720,7 +725,8 @@
$("#section_list").sortable('destroy');
$("#section_list_manage").removeClass('editing');
$("#section_list").removeClass('editing').sortable('disable');
$(".arrange_sections_link").text("Manage Sections").val("Manage Sections");
var manage_sections = I18n.t('buttons.manage_sections', "Manage Sections");
$(".arrange_sections_link").text(manage_sections).val(manage_sections);
$(".add_section").hide();
$("#section_list > li").attr('title', "");
} else {
@ -748,9 +754,10 @@
}
});
$("#section_list").addClass('editing').sortable('enable');
$(".arrange_sections_link").text("Done Editing").val("Done Editing");
var done_editing = I18n.t('buttons.done_editing', "Done Editing");
$(".arrange_sections_link").text(done_editing).val(done_editing);
$(".add_section").show();
$("#section_list > li").attr('title', "Drag to Arrange, Click to Edit");
$("#section_list > li").attr('title', I18n.t('titles.section_list', "Drag to Arrange, Click to Edit"));
}
});
$(".add_section_link").click(function(event) {
@ -763,7 +770,7 @@
event.preventDefault();
hideEditObject('section');
$(this).parents("li").confirmDelete({
message: "Delete this section and all its pages?",
message: I18n.t('confirm_delete_section', "Delete this section and all its pages?"),
url: $(this).parents("li").find(".rename_section_url").attr('href'),
success: function(data) {
$(this).fadeOut(function() {
@ -812,7 +819,7 @@
$("#export_progress").progressbar().progressbar('option', 'value', 0);
var $box = $("#downloading_eportfolio_message")
$box.slideDown();
$box.find(".message").text("Collecting ePortfolio resources. this may take a while if you have a lot of files in your ePortfolio...");
$box.find(".message").text(I18n.t('#eportfolios.show.headers.export_progress', "Collecting ePortfolio resources. this may take a while if you have a lot of files in your ePortfolio."));
var url = $(this).attr('href');
var errorCount = 0;
var check = function(first) {
@ -835,7 +842,7 @@
}, function(data) {
errorCount++;
if(errorCount > 5) {
$box.find(".message").text("There was an error compiling your eportfolio. Please try again in a little while.");
$box.find(".message").text(I18n.t('errors.compiling', "There was an error compiling your eportfolio. Please try again in a little while."));
} else {
setTimeout(check, 5000);
}
@ -846,8 +853,10 @@
$(".download_eportfolio_link").click(function(event) {
$("#downloading_eportfolio_dialog").dialog('close').dialog({
autoOpen: false,
title: "Download ePortfolio"
title: I18n.t('titles.download_eportfolio', "Download ePortfolio")
}).dialog('open');
});
});
})();
})