Skip to content

Commit b758116

Browse files
author
Jon Willesen
committed
apply the new module_sequence_footer to discussion topics
fixes CNVS-8014 test plan: - add a discussion topic to a module. - navigate to the discussion topic and see the old module navigation at the bottom of the page. - enable draft state on the account. in the console: a = Account.find(your_account_id) a.enable_draft! - refresh the discussion topic page and see the new module navigation at the bottom of the page. - create and navigate to a group discussion and make sure there are no errors. - create a graded group discussion and add it to a module. - navigate to the graded group discussion as a teacher and make sure the new footer appears. - navigate to the graded group discussion as a student, which will redirect you to the student's specific group discussion. make sure the new footer appears. Change-Id: Ib380fb6d3390ef3f4f5029349466b1a0e43ff8a1 Reviewed-on: https://gerrit.instructure.com/24201 Reviewed-by: Braden Anderson <banderson@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Cam Theriault <cam@instructure.com> Product-Review: Jon Willesen <jonw@instructure.com>
1 parent 144de56 commit b758116

6 files changed

Lines changed: 34 additions & 7 deletions

File tree

app/coffeescripts/bundles/discussion.coffee

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ require [
1414
'compiled/views/DiscussionTopic/TopicView'
1515
'compiled/views/DiscussionTopic/EntriesView'
1616
'compiled/jquery/sticky'
17+
'compiled/jquery/ModuleSequenceFooter'
1718
], (EntryView, DiscussionFilterState, DiscussionToolbarView, DiscussionFilterResultsView, MarkAsReadWatcher, $, _, Backbone, Entry, MaterializedDiscussionTopic, SideCommentDiscussionTopic, EntryCollection, TopicView, EntriesView) ->
1819

1920
descendants = 5
@@ -169,6 +170,15 @@ require [
169170
topicView.render()
170171
toolbarView.render()
171172

173+
##
174+
# Add module sequence footer
175+
if ENV.DISCUSSION.SEQUENCE?
176+
$('#module_sequence_footer').moduleSequenceFooter(
177+
assetType: 'Discussion'
178+
assetID: ENV.DISCUSSION.SEQUENCE.ASSET_ID
179+
courseID: ENV.DISCUSSION.SEQUENCE.COURSE_ID
180+
)
181+
172182
##
173183
# Get the party started
174184
if ENV.DISCUSSION.INITIAL_POST_REQUIRED

app/coffeescripts/jquery/ModuleSequenceFooter.coffee

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ define [
3737
throw 'Option must be set with assetType and assetID'
3838
return
3939

40-
@addClass 'module-sequence-footer clearfix'
41-
4240
# After fetching, @msfInstance will have the following
4341
# @hide: bool
4442
# @previous: Object

app/controllers/discussion_topics_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,12 @@ def show
355355
:INITIAL_POST_REQUIRED => @initial_post_required,
356356
:THREADED => @topic.threaded?
357357
}
358+
if @sequence_asset
359+
env_hash[:SEQUENCE] = {
360+
:ASSET_ID => @sequence_asset.id,
361+
:COURSE_ID => @sequence_asset.context.id,
362+
}
363+
end
358364
if @topic.for_assignment? &&
359365
@topic.assignment.grants_right?(@current_user, session, :grade) && @presenter.allows_speed_grader?
360366
env_hash[:SPEEDGRADER_URL_TEMPLATE] = named_context_url(@topic.assignment.context,

app/stylesheets/base/module_sequence_footer.scss

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
$bar-background: #eff2f5;
2+
$bar-height: 55px;
23
$button-border-line: #d4d6d9;
34
$top-bar-border: #bdc1c5;
45
$top-bar-shadow: #dcdee0;
56
$text: #3a4651;
67
$button-hover: #dee5ea;
78

9+
.module-sequence-padding{
10+
height: $bar-height;
11+
}
12+
813
.module-sequence-footer{
914
background: $bar-background;
1015
position: absolute;
1116
left:0px;
1217
right:0px;
1318
bottom:0px;
14-
height: 55px;
19+
height: $bar-height;
1520
border-top: 1px solid $top-bar-border;
1621
box-shadow: inset 0px 1px 0px 0px $top-bar-shadow;
1722

1823
a{
19-
line-height: 55px;
24+
line-height: $bar-height;
2025
font-weight: bold;
2126
color: $text;
2227
border-right: 1px solid $button-border-line;

app/views/discussion_topics/show.html.erb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,14 @@
246246

247247
</div>
248248

249-
<%=
250-
render :partial => "shared/sequence_footer", :locals => {:asset => @sequence_asset, :context => @sequence_asset.context} if @sequence_asset
251-
%>
249+
<% if @context.draft_state_enabled? && @headers != false %>
250+
<div id="module_sequence_footer"></div>
251+
<% else %>
252+
<%=
253+
render :partial => "shared/sequence_footer", :locals => {:asset => @sequence_asset, :context => @sequence_asset.context} if @sequence_asset
254+
%>
255+
<% end %>
256+
252257
<% if !@headers %>
253258
</div>
254259
<% end %>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1+
<div class='module-sequence-padding'></div>
2+
<div class='module-sequence-footer clearfix'>
13
{{#if previous.show}}
24
<a href="{{previous.url}}" class="pull-left" data-tooltip title="{{previous.tooltip}}"><i class="icon-mini-arrow-left"></i>&nbsp;{{#t 'previous'}}Previous{{/t}}</a>
35
{{/if}}
46

57
{{#if next.show}}
68
<a href="{{next.url}}" class="pull-right bordered" data-tooltip title="{{next.tooltip}}">{{#t 'next'}}Next{{/t}}&nbsp;<i class="icon-mini-arrow-right"></i></a>
79
{{/if}}
10+
</div>

0 commit comments

Comments
 (0)