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

« back to all changes in this revision

Viewing changes to ivle/webapp/submit/submit.html

  • Committer: Matt Giuca
  • Date: 2010-02-11 07:39:15 UTC
  • Revision ID: matt.giuca@gmail.com-20100211073915-rirq98zg3sanvf09
Submit view: The projects list is now identical (except for radio buttons) to the view on the subjects page. It is much clearer and contains more info. The code is somewhat different, because it's a table, not a list, so I didn't abstract it. Moved a function out of subject.py to ivle.util, as it is shared by both views.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
          <form action="" method="post">
28
28
            <table>
29
29
              <tr py:for="project in principal.get_projects(offering=offering)"
30
 
                  py:with="attrs = {'disabled': 'disabled'} if project.has_deadline_passed(req.user) else {}">
 
30
                  py:with="attrs = {'disabled': 'disabled'} if project.has_deadline_passed(req.user) else {}"
 
31
                  py:attrs="{'class': 'project closed'} if project.has_deadline_passed(req.user) else {'class': 'project'}">
31
32
                <td style="vertical-align: top">
32
33
                  <input type="radio" name="project" id="project_${project.id}" value="${project.id}" py:attrs="attrs" />
33
34
                </td>
34
35
                <td>
35
 
                  <!-- XXX This deadline does not take the student's extensions into account. -->
36
 
                  <label for="project_${project.id}"><a href="${project.url}">${project.name}</a> (<span title="Due ${format_datetime(project.deadline)}">due ${format_datetime_short(project.deadline)}</span>)<br />${project.synopsis}</label>
 
36
                  <label for="project_${project.id}">
 
37
                    <py:choose test="project.url not in (None, '')">
 
38
                      <a py:when="True" href="${project.url}">${project.name}</a>
 
39
                      <span py:otherwise="">${project.name}</span> 
 
40
                    </py:choose>
 
41
                    &ndash;
 
42
                    <span py:content="format_submission_principal(req.user, principal)" /> &ndash;
 
43
                    <!-- XXX This deadline does not take the student's extensions into account. -->
 
44
                    <span title="${format_datetime(project.deadline)}">
 
45
                      ${'closed' if project.has_deadline_passed(req.user) else 'due'} ${format_datetime_short(project.deadline)}
 
46
                    </span>
 
47
                    <py:if test="principal is not None"
 
48
                           py:with="submissions = project.get_submissions_for_principal(principal)">
 
49
                      &ndash;
 
50
                      <py:choose test="submissions.count()">
 
51
                        <span py:when="0">
 
52
                          not yet submitted
 
53
                        </span>
 
54
                        <span py:otherwise=""
 
55
                              py:with="latest = submissions.last()"
 
56
                              title="${format_datetime(latest.date_submitted)}">
 
57
                          last submitted ${format_datetime_short(latest.date_submitted)}
 
58
                        </span>
 
59
                      </py:choose>
 
60
                    </py:if>
 
61
                    <br />
 
62
                    ${project.synopsis}
 
63
                  </label>
37
64
                </td>
38
65
              </tr>
39
66
            </table>