Fix modules formatting on course home page

The styling for modules on the home page was broken, so we fixed it by
ensuring that the css for modules is now included where/when the context
module page is loaded.

Test Plan:
1. Go to your course home page.
2. Make sure your course home page settings are set to show modules
by default
3. Observe that your modules are styled correctly with css.

refs #CNVS-4201

Change-Id: Id4b550cd03196e396be11a41b9c659620fd2178e
Reviewed-on: https://gerrit.instructure.com/18111
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Florence <ryanf@instructure.com>
QA-Review: Adam Phillipps <adam@instructure.com>
This commit is contained in:
Sterling Cobb 2013-02-26 14:50:56 -07:00 committed by Bracken Mosbacker
parent 8d1b6c0b62
commit 5684a56a75
4 changed files with 18 additions and 29 deletions

View File

@ -1,10 +1,27 @@
<% course_home ||= false %>
<% js_bundle :context_modules %>
<% jammit_css :context_modules %>
<% js_env :COLLAPSED_MODULES => @collapsed_modules %>
<% js_env :CAN_MANAGE_MODULES => can_do(@context, @current_user, :manage_grades) || can_do(@context, @current_user, :manage_content) %>
<% js_env :COURSE_ID => @context.id %>
<% if course_home %>
<h2><%= @context.name %></h2>
<% end %>
<div class="context-modules-main-header clearfix">
<h2 class="context-modules-title">
<%= t('headings.course_modules', %{Course Modules}) %>
</h2>
<% if can_do(@context, @current_user, :manage_content) %>
<div class="context-modules-main-toolbar">
<button class="btn btn-small module_progressions_link"><%= t('links.student_progress', 'View Progress') %></button>
<button class="btn btn-small btn-primary add_module_link"><%= t('#context_modules.buttons.add_module', 'Create a Module') %></button>
</div>
<% end %>
</div>
<div id="no_context_modules_message" style="display:none; clear: both;">
<% if can_do(@context.context_modules.new, @current_user, :create) %>
<%= mt 'help.create', <<TEXT, :button => t('#context_modules.buttons.add_module_first', 'Add a New Module')

View File

@ -1,10 +0,0 @@
<% course_home ||= false %>
<div class="rs-margin-lr <%= 'rs-margin-top' unless course_home %>">
<% if can_do(@context, @current_user, :manage_content) %>
<a href="#" class="btn add_module_link button-sidebar-wide"><i class="icon-add"></i> <%= t('#context_modules.buttons.add_module_right_side', 'Add a New Module') %></a>
<div>
<button class="btn button-sidebar-wide loading_module_progressions_link disabled" disabled='true' style='display: none;'><%= t('loading_progressions', %{Loading Student Progress...}) %></button>
<a href="#" class="btn button-sidebar-wide module_progressions_link" style="display: none;"><i class="icon-user"></i> <%= t('links.student_progress', %{View Student Progress for Modules}) %></a>
</div>
<% end %>
</div>

View File

@ -1,18 +1,2 @@
<% content_for :page_title, join_title(t('titles.course_modules', "Course Modules"), @context.name) %>
<% js_bundle :context_modules %>
<% jammit_css :context_modules %>
<div class="context-modules-main-header clearfix">
<h2 class="context-modules-title">
<%= t('headings.course_modules', %{Course Modules}) %>
</h2>
<% if can_do(@context, @current_user, :manage_content) %>
<div class="context-modules-main-toolbar">
<button class="btn btn-small module_progressions_link"><%= t('links.student_progress', 'View Progress') %></button>
<button class="btn btn-small btn-primary add_module_link"><%= t('#context_modules.buttons.add_module', 'Create a Module') %></button>
</div>
<% end %>
</div>
<%= render :partial => "context_modules/content" %>

View File

@ -46,8 +46,6 @@
<% if @course_home_view == 'wiki' %>
<% js_bundle :wiki %>
<%= render :partial => "wiki_pages/wiki_right_side", :locals => {:course_home => true} %>
<% elsif @course_home_view == 'modules' %>
<%= render :partial => "context_modules/context_module_right_side", :locals => {:course_home => true} %>
<% elsif @course_home_view == 'assignments' %>
<%= render :partial => 'assignments/assignments_list_right_side', :locals => {:course_home => true} %>
<% elsif @course_home_view == 'syllabus' %>
@ -236,7 +234,7 @@ This layout is probably best for courses that aren't based on a specific schedul
<div class="clear"></div>
</div>
<div id="course_home_content">
<div style="float: right; text-align: left;" class="floating_links">
<div style="float: right; text-align: left;" class="floating_links clearfix">
<% if can_do(@context, @current_user, :manage_content) || @course_home_view != 'feed' %>
<div style="font-size: 0.9em;">
<% if can_do(@context, @current_user, :manage_content) %>