summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2018-10-31 21:35:30 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-10-31 21:35:30 +0000
commit34cac5129b94b9d3086ace8e11377a6c65d6f0e8 (patch)
tree33e8cd82e42f0252568ee29991a1939dd5cdb360
parent5e28c11e0db5610048127e0decd526d35d1a5692 (diff)
parentb998aa1e8a0a76eedba9d40c40a9d2c5bfeb3d47 (diff)
Merge "Improved Collaborators UX"
-rw-r--r--dashboard/src/templates/booking/steps/booking_meta.html3
-rw-r--r--dashboard/src/workflow/forms.py4
2 files changed, 4 insertions, 3 deletions
diff --git a/dashboard/src/templates/booking/steps/booking_meta.html b/dashboard/src/templates/booking/steps/booking_meta.html
index fa8f7a9..a42e158 100644
--- a/dashboard/src/templates/booking/steps/booking_meta.html
+++ b/dashboard/src/templates/booking/steps/booking_meta.html
@@ -43,7 +43,8 @@
<div class="panel panel_center">
</div>
<div class="panel">
- {% bootstrap_field form.users %}
+ <p>You may add collaborators on your booking to share resources with coworkers.</p>
+ {% bootstrap_field form.users label="Collaborators" %}
</div>
{% buttons %}
diff --git a/dashboard/src/workflow/forms.py b/dashboard/src/workflow/forms.py
index c770e38..d4abbc3 100644
--- a/dashboard/src/workflow/forms.py
+++ b/dashboard/src/workflow/forms.py
@@ -189,6 +189,7 @@ class BookingMetaForm(forms.Form):
default_user = kwargs.pop("default_user")
else:
default_user = "you"
+ self.default_user = default_user
if "chosen_users" in kwargs:
chosen_users = kwargs.pop("chosen_users")
elif data and "users" in data:
@@ -212,7 +213,7 @@ class BookingMetaForm(forms.Form):
"""
try:
users = {}
- d_qset = UserProfile.objects.select_related('user').all();
+ d_qset = UserProfile.objects.select_related('user').all().exclude(user__username=self.default_user);
for userprofile in d_qset:
user = {
'id':userprofile.user.id,
@@ -237,7 +238,6 @@ class BookingMetaForm(forms.Form):
'selectable_limit': -1,
'name': "users",
'placeholder': "username",
- 'default_entry': default_user,
'initial': chosen_users,
'edit': False
}