Commits

Josh VanderLinden committed 20dc78a

Made some minor changes to the templates and a couple fixes to the code. I took some screenshots for the project page.

  • Participants
  • Parent commits 9fc06e4

Comments (0)

Files changed (18)

File docs/screenshots/0.1.6-pre3/add_entry.png

Added
New image

File docs/screenshots/0.1.6-pre3/clock_in.png

Added
New image

File docs/screenshots/0.1.6-pre3/clock_in_pause.png

Added
New image

File docs/screenshots/0.1.6-pre3/clock_in_pause_complete.png

Added
New image

File docs/screenshots/0.1.6-pre3/clock_out.png

Added
New image

File docs/screenshots/0.1.6-pre3/clock_out_complete.png

Added
New image

File docs/screenshots/0.1.6-pre3/entries.png

Added
New image

File docs/screenshots/0.1.6-pre3/previous_period.png

Added
New image

File docs/screenshots/0.1.6-pre3/update_entry.png

Added
New image

File pendulum/__init__.py

-VERSION = (0, 1, 6, 'pre2')
+VERSION = (0, 1, 6, 'pre3')
 
 def version():
     return '%s.%s.%s-%s' % VERSION

File pendulum/forms.py

     update existing log entries.
     """
 
-    #start_time = forms.DateTimeField(widget=PendulumDateTimeWidget)
-    #end_time = forms.DateTimeField(widget=PendulumDateTimeWidget)
+    start_time = forms.DateTimeField(widget=PendulumDateTimeWidget)
+    end_time = forms.DateTimeField(widget=PendulumDateTimeWidget)
 
-    start_time = PendulumDateTimeField()
-    end_time = PendulumDateTimeField()
+    #start_time = PendulumDateTimeField()
+    #end_time = PendulumDateTimeField()
 
     class Meta:
         model = Entry

File pendulum/templates/pendulum/_day_totals.html

-    <tr>
+    <tr class="day-summary">
         <td>&nbsp;</td>
         <th colspan="2">
             Hours for
             {{ day|date:"N j" }}:
         </th>
-        <td>
+        <td class="entry-hours">
             {{ day_time }}<br />
             ({{ day_total|floatformat:2 }})
         </td>

File pendulum/templates/pendulum/_week_totals.html

-    <tr>
+    <tr class="week-summary">
         <td>&nbsp;</td>
         <th colspan="2">
             Hours for
             {{ week_range.start|date:"N j" }}-
             {{ week_range.end|date:"N j" }}:
         </th>
-        <td>
+        <td class="entry-hours">
             {{ week_time }}<br />
-            {{ week_total|floatformat:2 }}
+            ({{ week_total|floatformat:2 }})
         </td>
         <td colspan="3">&nbsp;</td>
     </tr>

File pendulum/templates/pendulum/clock_in.html

 {{ block.super }}
 
 <form action="{% url pendulum-clock-in %}" method="post">
-<table>
+<table class="clock-in">
 {{ form }}
-{% if user.clocked_in %}<tr>
-
+{% if user.clocked_in %}<tr class="even">
     <td colspan="2">
         You are currently clocked into another project.  Check the box below to pause the other entry.
     </td>
 </tr>
-<tr>
+<tr class="odd">
     <td colspan="2">
         <input type="checkbox" id="pause_logs" name="pause_open" value="1" />
         <label for="pause_logs">Pause open log</label>

File pendulum/templates/pendulum/clock_out.html

 {% extends 'pendulum/pendulum_base.html' %}
 
 {% block content %}
+<h2>Clock Out of Project</h2>
+
 {{ block.super }}
 
-<h2>Clock Out of Project</h2>
-
 <form action="{% url pendulum-clock-out entry.id %}" method="post">
 <table>
 {{ form }}

File pendulum/templates/pendulum/entry_list.html

         {% endif %}</td>
         <td class="entry-hours">{% if entry.end_time %}
             {{ entry.total_time }}<br />
-            ({{ entry.hours }}){% else %}
+            <span class="hours">({{ entry.hours }})</span>{% else %}
             {% if entry.is_paused %}
             <a href="{% url pendulum-toggle-paused entry.id %}">Unpause</a>
             {% else %}
             <a href="{% url pendulum-delete entry.id %}">&times;</a>
         </td>
     </tr>
-    {% if entry.seconds_paused %}<tr class="{{ rowclass }}">
+    {% if entry.seconds_paused %}<tr class="{{ rowclass }} entry-paused">
         <td colspan="2">&nbsp;</td>
         <th>Breaks:</th>
         <td class="entry-paused">{{ entry.paused_time }}</td>
 </table>
 
 {% if entries %}
-<table>
+<table class="entry-statistics">
     <tr>
         <th colspan="2">Statistics</th>
     </tr>
         {% entries_projects entries as projects %}
         {% for project in projects %}
         {% if forloop.first %}<table>{% endif %}
-            <tr>
+            <tr class="{% cycle odd,even as rowclass %}">
                 <th>{{ project.name }}</th>
                 <td>
                     {% time_in_period project period %}
         {% entries_activities entries as activities %}
         {% for activity in activities %}
         {% if forloop.first %}<table>{% endif %}
-            <tr>
+            <tr class="{% cycle odd,even as rowclass %}">
                 <th>{{ activity.name }}</th>
                 <td>
                     {% time_in_period activity period %}
         {% endfor %}
         </td>
     </tr>
-    <tr>
+    <tr class="odd">
         <th>Total Hours</th>
         <td>
             {% total_time_for_period period user %}
             ({% filter floatformat:2 %}{% total_hours_for_period period user %}{% endfilter %})
         </td>
     </tr>
-    <tr>
+    <tr class="even">
         <th>Total Entries</th>
         <td>{{ entries.count }}</td>
     </tr>

File pendulum/templates/pendulum/pendulum_base.html

 
 {% block content %}
 {% block pendulum-controls %}
-<ul class="pendulum-controls">
-    <li>Logged in as <strong>{{ user }}</strong></li>
-    <li><a href="{% url pendulum-clock-in %}">Clock In</a></li>
-    <li><a href="{% url pendulum-add %}">Add Entry</a></li>
-    <li><a href="{% url pendulum-entries %}">Current Entries</a></li>
-    <li><a href="/accounts/logout/">Log Out</a></li>
-</ul>
+<div id="pendulum-controls">
+    <ul class="pendulum-controls">
+        <li>Logged in as <strong>{{ user }}</strong></li>
+        <li><a href="{% url pendulum-clock-in %}">Clock In</a></li>
+        <li><a href="{% url pendulum-add %}">Add Entry</a></li>
+        <li><a href="{% url pendulum-entries %}">Current Entries</a></li>
+        <li><a href="/accounts/logout/">Log Out</a></li>
+    </ul>
+</div>
 {% endblock %}
 
-{% if messages %}<div>
-    <ul id="django-messages">
+{% if messages %}<div id="django-messages">
+    <ul>
         {% for msg in messages %}<li>{{ msg }}</li>{% endfor %}
     </ul>
 </div>{% endif %}

File pendulum/views.py

         # save it
         entry.save()
 
+        if entry.is_paused:
+            action = 'paused'
+        else:
+            action = 'resumed'
+
         # create a message that can be displayed to the user
-        request.user.message_set.create(message='The log entry has been paused.')
+        request.user.message_set.create(message='The log entry has been %s.' % action)
 
     # redirect to the log entry list
     return HttpResponseRedirect(reverse('pendulum-entries'))