Skip to content

Commit

Permalink
Merge pull request #269 from postpdm/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
yn-coder authored Apr 22, 2021
2 parents f6954ac + c32eca1 commit c4cd0ae
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion ich_bau/templatetags/version_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

@register.simple_tag(name='site_version_info')
def site_version_info():
return 'v0.0041 at 21.04.2021'
return 'v0.0042 at 22.04.2021'
3 changes: 3 additions & 0 deletions project/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,9 @@ def taskcomment_post_save_Notifier_Composer(sender, instance, **kwargs):

TASK_PROFILE_PRIORITY_LIST = ( TASK_PROFILE_PRIORITY_INTERESTED, TASK_PROFILE_PRIORITY_RESPONSIBLE_FULL, TASK_PROFILE_PRIORITY_RESPONSIBLE_HOLDER, TASK_PROFILE_PRIORITY_RESPONSIBLE_EXECUTANT )

# states what counts as assigned
TASK_PROFILE_PRIORITY_ASSIGNED_LIST = ( TASK_PROFILE_PRIORITY_RESPONSIBLE_FULL, TASK_PROFILE_PRIORITY_RESPONSIBLE_HOLDER, TASK_PROFILE_PRIORITY_RESPONSIBLE_EXECUTANT )

TASK_PROFILE_PRIORITY_LIST_CHOICES = (
( TASK_PROFILE_PRIORITY_INTERESTED, 'Interested'),
( TASK_PROFILE_PRIORITY_RESPONSIBLE_FULL, 'Full responsible'),
Expand Down
2 changes: 1 addition & 1 deletion project/templates/project/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ <h2>{% trans "Tasks" %} {% if user_can_admin or user_can_work %}<a class="btn bt

{% endif %}

{% include "project/task_list.html" with table_mode='project' %}
{% include "project/task_list.html" with table_mode='project' show_assignee_flag=show_assignee_flag %}

{% comment %} end if TITLE {% endcomment %}
{% endif %}
Expand Down
22 changes: 13 additions & 9 deletions project/templates/project/task_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,26 @@
{%comment%}<th>Target (milestone or date)</th>{%endcomment%}
{% if table_mode != 'milestone' %}<th>Target milestone</th>{% endif %}
<th>Holder</th>
{% if show_assignee_flag %}
<th>Assignee</th>
{% endif %}
<th>State</th>
</tr>
</thead>
<tbody>
{% for t in tasks %}
<tr>

{% if table_mode == 'index' %}
<td><a href="{{t.project.get_absolute_url}}">{{t.project}}</a></td>
{% endif %}

<td>
{% if not t.get_opened %}<strike>{% endif %}

<a href="{{t.get_absolute_url}}">{{t}}</a>
{% if not t.get_opened %}</strike>{% endif %}

{% if t.important %}
<i class="fa fa-exclamation-triangle" style="color:red"></i>
{% endif %}
Expand All @@ -41,11 +43,13 @@
<td>{% if t.milestone %} Milestone - <a href="{{t.milestone.get_absolute_url}}">{{t.milestone}} {% if t.milestone.planned_at %} {{ t.milestone.planned_at|date }} {% endif %} </a>{% endif %}
{% endif %}
<td>{% if t.holder %} {{t.holder}}{% endif %}</td>
<td>
{% for p in t.get_profiles %}
{% if p.priority %}<strong>{% endif %}{{p.profile}}{% if p.priority %}</strong>{% endif %}<br>
{% endfor %}
</td>
{% if show_assignee_flag %}
<td>
{% for p in t.get_profiles %}
{% if p.priority %}<strong>{% endif %}{{p.profile}}{% if p.priority %}</strong>{% endif %}<br>
{% endfor %}
</td>
{% endif %}
<td>{{t.get_state_name}}</td>
</tr>
{% endfor %}
Expand Down
8 changes: 6 additions & 2 deletions project/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,7 @@ def get_project_view(request, project_id, arg_task_filter = TASK_FILTER_OPEN, ar
filter_type = ''
task_filter = None
tasks = None
show_assignee_flag = None
repo_rel_path = None
domains = None
selected_domain = None
Expand Down Expand Up @@ -409,11 +410,13 @@ def get_project_view(request, project_id, arg_task_filter = TASK_FILTER_OPEN, ar
else:
if arg_task_filter == TASK_FILTER_ASSIGNED:
filter_type = 'filter_task_assigned'
tasks = base_tasks.filter( state = TASK_STATE_NEW ).filter( profile2task__priority = TASK_PROFILE_PRIORITY_RESPONSIBLE ).distinct()
show_assignee_flag = True
print( show_assignee_flag)
tasks = base_tasks.filter( state = TASK_STATE_NEW ).filter( profile2task__priority__in = TASK_PROFILE_PRIORITY_ASSIGNED_LIST ).distinct()
else:
if arg_task_filter == TASK_FILTER_UNASSIGNED:
filter_type = 'filter_task_unassigned'
tasks = base_tasks.filter( state = TASK_STATE_NEW ).exclude( profile2task__priority = TASK_PROFILE_PRIORITY_RESPONSIBLE )
tasks = base_tasks.filter( state = TASK_STATE_NEW ).exclude( profile2task__priority__in = TASK_PROFILE_PRIORITY_ASSIGNED_LIST )
else:
raise Http404

Expand All @@ -437,6 +440,7 @@ def get_project_view(request, project_id, arg_task_filter = TASK_FILTER_OPEN, ar
'members':members,
'milestones' : milestones,
'tasks' : tasks,
'show_assignee_flag' : show_assignee_flag,
'filter': task_filter,
'filter_type' : filter_type,
'user_can_work' : user_can_work,
Expand Down

0 comments on commit c4cd0ae

Please sign in to comment.