update "choose home page" dialog
test plan: 0. BEFORE APPLYING THIS CHANGE SET, create a course, enable draft state, do not create a wiki front page, use the *old* "Choose Home Page" dialog, select "Pages Front Page", and save 1. NOW APPLY THIS CHANGE SET. open the new "Choose Home Page" dialog, and confirm that "Front Page" is grayed out and disabled, and "Recent Activity Dashboard" is selected 2. create a new course and enable draft state 3. go to the course home page and click "Choose Home Page" 4. the new dialog should appear and should contain a radio button for each page selectable as home page. 5. note the "Front Page" radio button should be disabled since there is no home page. 6. click the link next to the disabled radio button labeled "Front page must be set first". It should take you to the "Pages" page, where you can create a page and set it as the front page. 7. Return to the course home page and click "Choose Home Page" 8. Now the "Front Page" radio button should be selectable and the page title should appear next to it 9. Click the "Change" link and verify it takes you to the Pages page 10. Confirm that all the other radio buttons work as expected also fixes CNVS-10987 Change-Id: I056f91015af6f998b3018ec9bd31b98d6848bc3f Reviewed-on: https://gerrit.instructure.com/35260 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Bracken Mosbacker <bracken@instructure.com> QA-Review: Clare Strong <clare@instructure.com> Product-Review: Hilary Scharton <hilary@instructure.com>
This commit is contained in:
parent
0a0299b4a5
commit
28572b3106
|
@ -21,3 +21,8 @@ $highlight-color: #06a9ee;
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#edit_course_home_content_form div.form_group {
|
||||
padding-top: 2px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
|
|
@ -140,20 +140,28 @@
|
|||
<%= render :partial => 'shared/dashboard_invitation', :object => @pending_enrollment %>
|
||||
<% end %>
|
||||
|
||||
<% if @context.feature_enabled?(:draft_state) %>
|
||||
<% if @context.feature_enabled?(:draft_state)
|
||||
has_front_page = @context.wiki && @context.wiki.has_front_page? %>
|
||||
<% content_for :right_side do %>
|
||||
<div id="edit_course_home_content" style="display: none;">
|
||||
<h2><%= t('draft_state.headings.set_layout', %{Set Home Page Layout}) %></h2>
|
||||
<%= form_for :course, :url => context_url(@context, :context_url), :html => {:tabindex=>"0", :'data-turn-into-dialog'=>'{"height": 300, "width":500,"modal":true}', :title=>t('headings.choose_home_page_title', %{Choose Home Page}), :style => "display:none", :id => "edit_course_home_content_form", :method => :put} do |f| %>
|
||||
<label for="edit_course_home_content_select"><%= t('draft_state.labels.select_content', %{Select what you'd like to display on the homepage.}) %></label>
|
||||
<br>
|
||||
<select name="course[default_view]" id="edit_course_home_content_select">
|
||||
<option value="feed" <%= 'selected' if @context.default_view == 'feed' %>><%= t('draft_state.options.recent_activity_dashboard', %{Recent Activity Dashboard}) %></option>
|
||||
<option value="wiki" <%= 'selected' if @context.default_view == 'wiki' %>><%= t('draft_state.options.custom_page', %{Pages Front Page}) %></option>
|
||||
<option value="modules" <%= 'selected' if @context.default_view == 'modules' %>><%= t('draft_state.options.modules', %{Course Modules}) %></option>
|
||||
<option value="assignments" <%= 'selected' if @context.default_view == 'assignments' %>><%= t('draft_state.options.assignments', %{Assignments List}) %></option>
|
||||
<option value="syllabus" <%= 'selected' if @context.default_view == 'syllabus' %>><%= t('draft_state.options.syllabus', %{Syllabus}) %></option>
|
||||
</select>
|
||||
<label for="edit_course_home_content_select"><%= t('draft_state.labels.select_content', %{Select what you'd like to display on the home page.}) %></label>
|
||||
|
||||
<div class="form_group"><label class="radio"><input type="radio" name="course[default_view]" value="feed" <%= 'checked' if @context.default_view == 'feed' || (!has_front_page && @context.default_view == 'wiki') %>><%= t('draft_state.options.recent_activity_dashboard', %{Recent Activity Dashboard}) %></label></div>
|
||||
<div class="form_group">
|
||||
<label class="radio"><input type="radio" name="course[default_view]" value="wiki" <%= 'checked' if has_front_page && @context.default_view == 'wiki' %><%= 'disabled' unless has_front_page %>>
|
||||
<span class="<%= 'ui-state-disabled' unless has_front_page %>"><%= t('draft_state.options.custom_page', %{Pages Front Page}) %></span></label>
|
||||
<% if has_front_page %>
|
||||
<small> <%= @context.wiki.front_page.title %> [ <%= link_to t('change_home_page', 'Change'), context_url(@context, :context_pages_url) %> ]</small>
|
||||
<% else %>
|
||||
<small> [ <%= link_to t('front_page_not_set', 'Front page must be set first'), context_url(@context, :context_pages_url) %> ]</small>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="form_group"><label class="radio"><input type="radio" name="course[default_view]" value="modules" <%= 'checked' if @context.default_view == 'modules' %>><%= t('draft_state.options.modules', %{Course Modules}) %></label></div>
|
||||
<div class="form_group"><label class="radio"><input type="radio" name="course[default_view]" value="assignments" <%= 'checked' if @context.default_view == 'assignments' %>><%= t('draft_state.options.assignments', %{Assignments List}) %></label></div>
|
||||
<div class="form_group"><label class="radio"><input type="radio" name="course[default_view]" value="syllabus" <%= 'checked' if @context.default_view == 'syllabus' %>><%= t('draft_state.options.syllabus', %{Syllabus}) %></label></div>
|
||||
|
||||
<div class="button-container">
|
||||
<a type="button" class="btn button-secondary dialog_closer"><%= t('draft_state.buttons.cancel', %{Cancel}) %></a>
|
||||
<button type="submit" class="btn btn-primary"><%= t('draft_state.buttons.update_layout', %{Save}) %></button>
|
||||
|
|
Loading…
Reference in New Issue