~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/filesystem/browser/media/specialhome.js

  • Committer: Matt Giuca
  • Date: 2010-02-24 04:57:52 UTC
  • Revision ID: matt.giuca@gmail.com-20100224045752-r1ipo8qyo0hh3ois
Specialhome now shows the semester name for any non-current offerings. userservice/get_enrolments now returns the 'state' property of an offering (past, current, future, etc). This fixes Launchpad bug #526838.

Show diffs side-by-side

added added

removed removed

Lines of Context:
65
65
        var subject = subjects[i];
66
66
        var subjpath = subject.subj_short_name;
67
67
        // Header, with link to offering home page.
68
 
        h3 = $('<h3><span></span> <span style="font-weight: normal">&ndash; <a class="subjectaction">Subject home</a></span>');
69
 
        h3.find('span:first-child').text(subject.subj_name);
 
68
        h3 = $('<h3><span class="subjname"></span><span style="font-weight: normal"><span class="semester"></span> &ndash; <a class="subjectaction">Subject home</a></span>');
 
69
        h3.find('.subjname').text(subject.subj_name);
 
70
        /* Non-current offerings need to show the semester, to avoid confusion
 
71
         * about which offering we are talking about */
 
72
        if (subject.state != "current")
 
73
        {
 
74
            h3.find('.semester').text(" (" + subject.year + ", semester "
 
75
                                      + subject.semester + ")");
 
76
        }
70
77
        h3.find('a').attr('href', subject.url);
71
78
        $(specialhomediv).append(h3);
72
79