Skip to content

Commit

Permalink
Merge pull request #1 from manumilou/madmath-no_referent-dev
Browse files Browse the repository at this point in the history
Highlight missing info and fix update form
  • Loading branch information
madmath authored Aug 27, 2016
2 parents 214f468 + 990abba commit 10a25b4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 13 additions & 4 deletions src/member/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ def __init__(self, *args, **kwargs):

def load_initial_data(client):
"""
Load initial for the given step and client.
Load initial for the given client.
"""
initial = {
'firstname': client.member.firstname,
Expand All @@ -394,9 +394,18 @@ def load_initial_data(client):
'latitude': client.member.address.latitude,
'longitude': client.member.address.longitude,
'distance': client.member.address.distance,
'work_information': client.client_referent.get().work_information,
'referral_reason': client.client_referent.get().referral_reason,
'date': client.client_referent.get().date,
'work_information':
client.client_referent.get().work_information
if client.client_referent.count()
else '',
'referral_reason':
client.client_referent.get().referral_reason
if client.client_referent.count()
else '',
'date':
client.client_referent.get().date
if client.client_referent.count()
else '',
'member': client.id,
'same_as_client': True,
'facturation': '',
Expand Down
2 changes: 1 addition & 1 deletion src/member/templates/client/partials/menu.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a class="{% if active_tab == 'information' %}active{% endif %} item" href="{% url 'member:client_information' pk=client.id %}"><i class="user icon"></i>{% trans 'Personal' %}</a>
{% if client.client_referent.all.count %}
<a class="{% if active_tab == 'referent' %}active{% endif %} item" href="{% url 'member:client_referent' pk=client.id %}"><i class="treatment icon"></i>{% trans 'Referent' %}</a>
{% else %}<span class="item">{% trans 'No referent available' %}</span>{% endif %}
{% else %}<em><a class="item" alt="{% trans 'Add a referent' %} "href="{% url 'member:member_update_referent_information' client_id=client.id %}"><i class="warning sign orange icon"></i>{% trans 'No referent available' %}</a></em>{% endif %}
<a class="{% if active_tab == 'billing' %}active{% endif %} item" href="{% url 'member:client_payment' pk=client.id %}"><i class="payment icon"></i>{% trans 'Billing' %}</a>
<a class="{% if active_tab == 'status' %}active{% endif %} item" href="{% url 'member:client_status' pk=client.id %}"><i class="history icon"></i>{% trans 'Status' %}</a>
</div>
Expand Down

0 comments on commit 10a25b4

Please sign in to comment.