Matthew Reidsma

Work Notes

Updates from the GVSU Libraries’ Web Team.
Archive // Subscribe: EmailRSS

Better Course Reserve for Faculty

Todd came to me today about an issue he’s had in [Course Reserves](https://gvsu.edu/library/ereserve]. When a faculty member logs in and doesn’t have any classes entered in Ares, they just get a screen with a few empty tables, and often aren’t sure what to do. A few years back we had a similar problem with Document Delivery, so Todd and I agreed to try the same fix on Course Reserves. I found a much easier way to do this, and so I spent a few minutes making the changes this afternoon. Now, instead of empty tables, users with no classes will be prompted to add their classes, along with a brief description of Course Reserve and some other options (for the folks who prefer to have our staff fill in the information for them). Here’s the new page:

Better guidance screen in Course Reserves

This fix will also help students, so next week I’ll do something similar on the student side.

For those who are interested in the technical details, this was much easier than the way I did it for Document Deliveery. Since this content could be present even if the empty table was there, I decided to hard-code it into the HTML of the IHome.html page in Ares but set it to display:none by default. I wrapped it in a div with the id of no_classes, and wrapped the other two tables in similarly id’d divs. Then, using jQuery (since it was already loaded - you could just use JS for this), I grabbed the text of the “row-message” classed table row. If it said “No classes found,” then I just hide the empty tables and show the no_classes div. Here’s the whole script:

if($("#current_classes").length > 0) { // Instructor Home Screen
            
    var classesMessage = $("#current_classes").find('table').find("tr.row-message").text();
    var waitingMessage = $('#waiting_for').find('table').find('tr.row-message').text();
            
    if(classesMessage == 'No classes found. ') {
        console.log('Instructor has no classes. Hiding empty table and showing help tips.');
        $('#current_classes').hide();
        $('#no_classes').show();
    }

    if(waitingMessage == "No classes foundn") {

        console.log('Not waiting on materials from instructor. Hiding empty table.');
        $('#waiting_for').hide();
    }
}

Let me know if you have any questions! (Wow, busy day! Three posts to work notes, a new record!)