-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Slater/clean search #642
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slater/clean search #642
Changes from all commits
6797f9c
f91b31e
363908b
c2a3b5b
3bc9786
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| .header:hover{ | ||
| background-color: #DEECF7; | ||
| color: #5C677A; | ||
| cursor: pointer; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| function indexCourses(){ | ||
| $("#index-courses").attr("disabled", true); | ||
| $("body").css("cursor", "progress"); | ||
| var course = ""; | ||
| var url = "/index_courseware"; | ||
| var courseTitle = $("#index-courses").eq(0).attr("data-course"); | ||
| var courseId = $("#course_id").eq(0).attr("value"); | ||
| $.ajax({ | ||
| type: "POST", | ||
| url: url, | ||
| data: {"course": courseTitle, "course_id": courseId}, | ||
| success: success | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need to handle errors here as well as success. Also, we should disable the button while the indexing process is running. I am also concerned that changing the state of the cursor and button are not enough indication, particularly for error cases and in light of the generally nice progress and error reporting that course authors are now accustomed to seeing in Studio.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, if there's an error, it still bubbles up to the same error handling that's already in studio. I might be able to give slightly more informative error messages, but I'm not sure how true or useful that would be. Will totally disable the button though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What error message does it currently render? |
||
| }); | ||
| } | ||
|
|
||
| function success(){ | ||
| $("body").css("cursor", "auto"); | ||
| $("#index-courses").attr("disabled", false); | ||
| } | ||
|
|
||
| $(document).ready(function() { | ||
| $("#index-courses").eq(0).bind("click", indexCourses); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you using document.ready?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In my mind to make sure that the index-courses element is present, but mostly because I'm not aware of a better way. Is there one? |
||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ | |
| <script type="text/javascript" src="${static.url('js/views/grader-select-view.js')}"></script> | ||
| <script type="text/javascript" src="${static.url('js/views/overview.js')}"></script> | ||
| <script type="text/javascript" src="${static.url('js/models/settings/course_grading_policy.js')}"></script> | ||
|
|
||
| <script type="text/javascript" src="${static.url('js/views/index_courses.js')}"></script> | ||
| <script type="text/template" id="section-name-edit-tpl"> | ||
| <%static:include path="js/section-name-edit.underscore" /> | ||
| </script> | ||
|
|
@@ -121,6 +121,7 @@ <h3 class="section-name"> | |
| </%block> | ||
|
|
||
| <%block name="content"> | ||
| <input type="hidden" id="course_id" name="course_id" value="${ course_id }" readonly> | ||
| <div class="wrapper-mast wrapper"> | ||
| <header class="mast has-actions has-subtitle"> | ||
| <h1 class="page-header"> | ||
|
|
@@ -140,6 +141,11 @@ <h3 class="sr">${_("Page Actions")}</h3> | |
| <li class="nav-item"> | ||
| <a href="${lms_link}" rel="external" class="button view-button view-live-button">${_("View Live")}</a> | ||
| </li> | ||
| % if search_boolean: | ||
| <li class="nav-item"> | ||
| <a href="#" class="button new-button index-courses" id="index-courses" data-course="${course_title}">${_("Index Courseware for Search")}</a> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The use of course_title is concerning; different runs of the same course (or possibly different courses from different departments or institutions) can have the same title.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. True, but in Mongo all resources are tagged by course-title. The only document that actually references the run is the course object itself. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to understand this better; if the resources are tagged with a course title, then how is the content from various runs distinguished?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It appears that they are not currently distinguished in any simple way. |
||
| </li> | ||
| % endif | ||
| </ul> | ||
| </nav> | ||
| </header> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't "/index" enough?