Permalink
Browse files

Added Offering Summary

  • Loading branch information...
1 parent 0f501ef commit 34a54abc5c1cd002fef7200a93d6d6752d1f580e @ryansouza ryansouza committed Mar 19, 2012
@@ -238,4 +238,14 @@ def self.content_to_outcome_mapping_row_total
10
end
+
+ def summed_mappings
+ outcomes.map do |outcome|
+ objectives.
+ includes(:mappings).
+ where(mappings: {outcome_id: outcome, value: 1}).count
+ end
+ end
+
+
end
@@ -0,0 +1,11 @@
+<div id="offering-summary">
+ <% if offering.is_complete? :details %>
+ <%= render partial: 'offerings/details/summary', locals: {offering: offering} %>
+ <% end %>
+ <% if offering.is_complete? :objectives %>
+ <%= render partial: 'offerings/objectives/summary', locals: {offering: offering} %>
+ <% end %>
+ <% if offering.is_complete? :content %>
+ <%= render partial: 'offerings/content/summary', locals: {offering: offering} %>
+ <% end %>
+</div>
@@ -1 +1,12 @@
-Nothing here but us words
+<div class="row summary content">
+ <div class="title span2">
+ <h2 class="middle">Content</h2>
+ </div>
+ <div class="span5">
+ <ul class="horizontal-list">
+ <% offering.content_groups.each do |cg| %>
+ <li><%= cg.content.count %><br><%= cg.name %></li>
+ <% end %>
+ </ul></div>
+</div>
+
@@ -1,2 +1,22 @@
-Nothing here but us words
-
+<div class="row details summary">
+ <div class="span2">
+ <dl class="">
+ <dt>CRN #</dt>
+ <dd><%= offering.crn %></dd>
+ <dt>Section(s)</dt>
+ <dd><%= offering.section %></dd>
+ <dt>Credits</dt>
+ <dd><%= offering.credits %></dd>
+ <dt>Location</dt>
+ <dd><%= offering.location %></dd>
+
+ </dl></div>
+ <div class="span5">
+ <dl class="padded">
+ <dt>Description</dt>
+ <dd><%= offering.description %></dd>
+ <dt>Primary Textbook</dt>
+ <dd><%= offering.textbook %></dd>
+ </dl>
+ </div>
+</div>
@@ -43,7 +43,12 @@
</p>
<br>
-<h3>Offering summary goes here<h3>
+
+<div class="row">
+ <div class="span8 offset2">
+ <%= render partial: 'offerings/summary', locals: {offering: @recent_offering_choice} %>
+ </div>
+</div>
<% end %>
@@ -1,2 +1,29 @@
-Nothing here but us words
+<div class="row summary objectives">
+ <div class="title span2">
+ <h2 class="middle">Objectives</h2>
+ </div>
+ <div class="span5">
+ <table class="table">
+ <thead>
+ <tr>
+ <th colspan="11" style="text-align: center">
+ <%= offering.objectives.count %> objectives meeting outcomes
+ </th>
+ </tr>
+ <tr>
+ <% offering.outcomes.each do |outcome| %>
+ <th class="col-outcome"><%= outcome.key %></th>
+ <% end %>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <% offering.summed_mappings.each do |value| %>
+ <td class="col-oucome"><%= value %></td>
+ <% end %>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+</div>
@@ -2,15 +2,8 @@
<div class="row">
<div id="offering-summary" class="span8 offset1">
- <% if @offering.is_complete? :details %>
- <%= render 'offerings/details/summary' %>
- <% end %>
- <% if @offering.is_complete? :objectives %>
- <%= render 'offerings/objectives/summary' %>
- <% end %>
- <% if @offering.is_complete? :content %>
- <%= render 'offerings/content/summary' %>
- <% end %>
+ <%= render partial: 'summary', locals: {offering: @offering} %>
+ &nbsp;<br>
</div>
<!--Sidebar-->

0 comments on commit 34a54ab

Please sign in to comment.