Changeset 313

Show
Ignore:
Timestamp:
05/03/10 15:53:58 (3 years ago)
Author:
fabio.montefuscolo
Message:

put tickets and submissions in desc. order on dashboard, refers #44

Location:
trunk/clinicaltrials
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • trunk/clinicaltrials/reviewapp/templates/reviewapp/dashboard.html

    r311 r313  
    2727    </tbody> 
    2828</table> 
     29<a href="{% url reviewapp.submissionlist %}" class="button">{% trans "Show all"%}</a> 
     30 
    2931 
    3032<h3>{% trans "Tickets" %}</h3> 
     
    6769    {% endfor %} 
    6870</table> 
     71 
     72<a href="{% url ticket.index %}" class="button">{% trans "Show all"%}</a> 
     73 
    6974{% else %} 
    7075<p>{% trans "Have no open tickets" %}</p> 
  • trunk/clinicaltrials/reviewapp/views.py

    r311 r313  
    1818def dashboard(request): 
    1919    username = request.user.username 
    20     user_tickets = Ticket.objects.filter(creator=request.user)[:5] 
    21     user_submissions = Submission.objects.filter(creator=request.user)[:5] 
     20    user_tickets = Ticket.objects.order_by('-created').filter(creator=request.user)[:5] 
     21    user_submissions = Submission.objects.order_by('-created').filter(creator=request.user)[:5] 
    2222    return render_to_response('reviewapp/dashboard.html', locals()) 
    2323 
  • trunk/clinicaltrials/tickets/templates/tickets/ticket_detail.html

    r143 r313  
    44 
    55{% block body %} 
    6 <h2>{% trans "Current Situation" %}</h2> 
    7     {% if object %} 
    8         <table> 
    9             <tr> 
    10                 <th>{% trans "creation date" %}</th> 
    11                 <th>{% trans "context" %}</th> 
    12                 <th>{% trans "type" %}</th> 
    13                 <th>{% trans "subject" %}</th> 
    14                 <th>{% trans "status" %}</th> 
    15                 <th>{% trans "last update" %}</th> 
    16                 <th>{% trans "mark as" %}</th> 
    17             </tr> 
    18             <tr> 
    19                 <td>{{ object.created }}</td> 
    20                 <td>{{ object.context }}</td> 
    21                 <td>{{ object.type }}</td> 
    22                 <td>{{ object.followup_set.latest.subject }}</td> 
    23                 <td>{{ object.followup_set.latest.status }}</td> 
    24                 <td>{{ object.followup_set.latest.iteration_date }}</td> 
    25                 <td> 
    26                     {% if object.is_closed or object.is_resolved %} 
    27                     <a href="/ticket/reopen/{{ object.pk }}/">reopen</a> 
    28                     {% endif %}  
    29                     {% if not object.is_closed %} {% if not object.is_resolved %} 
    30                     <a href="/ticket/resolve/{{ object.pk }}/">resolved</a> 
    31                     {% endif %} {% endif %} 
    32                     {% if not object.is_closed %} {% if not object.is_resolved %} 
    33                     <a href="/ticket/close/{{ object.pk }}/">closed</a> 
    34                     {% endif %} {% endif %} 
    35                 </td> 
    36             </tr> 
    37         </table> 
    38     {% else %} 
    39         <p>{% trans "Ticket not found" %}.</p> 
    40     {% endif %} 
     6<h2>{% trans "About ticket" %} #{{object.pk}}</h2> 
    417 
    42 <h2>{% trans "History" %}</h2> 
    43     {% if object.followup_set.all %} 
    44             <table> 
    45                 <tr> 
    46                     <th>{% trans "update date" %}</th> 
    47                     <th>{% trans "status" %}</th> 
    48                     <th>{% trans "description" %}</th> 
    49                     <th>{% trans "assigned to" %}</th> 
    50                 </tr> 
    51             {% for fw in object.followup_set.all %} 
    52             <tr> 
    53                 <td>{{ fw.iteration_date }}</td> 
    54                 <td>{{ fw.status }}</td> 
    55                 <td>{{ fw.description }}</td> 
    56                 <td>{{ fw.to_user }}</td> 
    57             </tr> 
    58             {% endfor %} 
    59             </table> 
    60     {% endif %} 
    61     {% if object.is_closed or object.is_resolved %} {% trans 'To show the "add iterarion link" the ticket must be diferente from "closed".' %} {% else %} <a href="/ticket/newiteration/{{ object.pk }}/">add iteration</a> {% endif %} 
     8<h3>{% trans "Current Situation" %}</h3> 
     9{% if object %} 
     10<table class="table"> 
     11    <tr> 
     12        <th>{% trans "Creation date" %}</th> 
     13        <th>{% trans "Context" %}</th> 
     14        <th>{% trans "Type" %}</th> 
     15        <th>{% trans "Subject" %}</th> 
     16        <th>{% trans "Status" %}</th> 
     17        <th>{% trans "Last update" %}</th> 
     18        <th>{% trans "Mark as" %}</th> 
     19    </tr> 
     20    <tr> 
     21        <td>{{ object.created }}</td> 
     22        <td>{{ object.context }}</td> 
     23        <td>{{ object.type }}</td> 
     24        <td>{{ object.followup_set.latest.subject }}</td> 
     25        <td>{{ object.followup_set.latest.status }}</td> 
     26        <td>{{ object.followup_set.latest.iteration_date }}</td> 
     27        <td> 
     28            <ul> 
     29                {% if object.is_closed or object.is_resolved %} 
     30                <li><a href="/ticket/reopen/{{ object.pk }}/">{% trans "reopen" %}</a></li> 
     31                {% endif %} 
     32                {% if not object.is_closed %} {% if not object.is_resolved %} 
     33                <li><a href="/ticket/resolve/{{ object.pk }}/">{% trans "resolved" %}</a></li> 
     34                {% endif %} {% endif %} 
     35                {% if not object.is_closed %} {% if not object.is_resolved %} 
     36                <li><a href="/ticket/close/{{ object.pk }}/">{% trans "closed" %}</a></li> 
     37                {% endif %} {% endif %} 
     38            </ul> 
     39        </td> 
     40    </tr> 
     41</table> 
     42{% else %} 
     43<p>{% trans "Ticket not found" %}.</p> 
     44{% endif %} 
     45 
     46<h3>{% trans "History" %}</h3> 
     47{% if object.followup_set.all %} 
     48<table class="table"> 
     49    <tr> 
     50        <th>{% trans "Update date" %}</th> 
     51        <th>{% trans "Status" %}</th> 
     52        <th>{% trans "Description" %}</th> 
     53        <th>{% trans "Assigned to" %}</th> 
     54    </tr> 
     55    {% for fw in object.followup_set.all %} 
     56    <tr> 
     57        <td>{{ fw.iteration_date }}</td> 
     58        <td>{{ fw.status }}</td> 
     59        <td>{{ fw.description }}</td> 
     60        <td>{{ fw.to_user }}</td> 
     61    </tr> 
     62    {% endfor %} 
     63</table> 
     64{% endif %} 
     65{% if object.is_closed or object.is_resolved %} <p>{% trans 'To show the "add iterarion button" the ticket must be diferente from "closed".' %}</p> {% else %} <a class="buttonadd" href="/ticket/newiteration/{{ object.pk }}/">Add iteration</a> {% endif %} 
    6266{% endblock %} 
  • trunk/clinicaltrials/tickets/templates/tickets/user_tickets.html

    r143 r313  
    33{% block body_title %}{% trans "User Tickets" %}{% endblock %} 
    44{% block body %} 
     5 
     6    <h2>{% trans "Tickets" %}</h2> 
     7 
    58    {% if user_tickets %} 
    6             <table> 
    7                 <tr> 
    8                     <th>{% trans "creation date" %}</th> 
    9                     <th>{% trans "context" %}</th> 
    10                     <th>{% trans "type" %}</th> 
    11                     <th>{% trans "subject" %}</th> 
    12                     <th>{% trans "status" %}</th> 
    13                     <th>{% trans "last update" %}</th> 
    14                     <th></th> 
    15                 </tr> 
     9            <table class="table"> 
     10                <col width="5%"/> 
     11                <col width="10%"/> 
     12                <col width="5%"/> 
     13                <col width="50%"/> 
     14                <col width="5%"/> 
     15                <col width="5%"/> 
     16                <col width="20%"/> 
     17            <tr> 
     18                <th>{% trans "Creation date" %}</th> 
     19                <th>{% trans "Context" %}</th> 
     20                <th>{% trans "Type" %}</th> 
     21                <th>{% trans "Subject" %}</th> 
     22                <th>{% trans "Status" %}</th> 
     23                <th>{% trans "Last update" %}</th> 
     24                <th></th> 
     25            </tr> 
    1626            {% for ct in user_tickets %} 
    1727            <tr> 
     
    2232                <td>{{ ct.followup_set.latest.status }}</td> 
    2333                <td>{{ ct.followup_set.latest.iteration_date }}</td> 
    24                 <td><a href="/ticket/history/{{ ct.pk }}/">{% trans "view history" %}</a> {% if ct.is_closed or ct.is_resolved %} {% else %} <a href="/ticket/newiteration/{{ ct.pk }}/">{% trans "add iteration" %} {% endif %}</a></td> 
     34                <td> 
     35                    <ul> 
     36                        <li><a href="/ticket/history/{{ ct.pk }}/">{% trans "view history" %}</a></li> 
     37                    {% if ct.is_closed or ct.is_resolved %} 
     38                    {% else %} 
     39                        <li><a href="/ticket/newiteration/{{ ct.pk }}/">{% trans "add iteration" %}</a></li> 
     40                    {% endif %} 
     41                    </ul> 
     42                </td> 
    2543            </tr> 
    2644            {% endfor %} 
     
    2947            <p>{% trans "Have no open tickets" %}</p> 
    3048    {% endif %} 
    31     <a href="/ticket/open/personal/personal/">{% trans "open ticket" %}</a> 
     49    <a class="buttonadd" href="/ticket/open/personal/personal/">{% trans "open ticket" %}</a> 
    3250{% endblock %} 
  • trunk/clinicaltrials/tickets/urls.py

    r143 r313  
    1010 
    1111urlpatterns = patterns('', 
    12     url(r'^$', index), 
    13     url(r'^list/$', object_list, info_dict), 
     12    url(r'^$', index, name="ticket.index"), 
     13    url(r'^list/$', object_list, info_dict, name="ticket.list"), 
    1414    url(r'^list_waiting/$', waiting_acceptance, name="ticket.waiting_acceptance"), 
    1515    url(r'^history/(?P<object_id>\d+)/$', object_detail, info_dict, name='ticket.history' ),