Merge branch 'master' of ssh://git.onelab.eu/git/myslice
authorLoic Baron <loic.baron@lip6.fr>
Fri, 17 Jan 2014 15:11:44 +0000 (16:11 +0100)
committerLoic Baron <loic.baron@lip6.fr>
Fri, 17 Jan 2014 15:11:44 +0000 (16:11 +0100)
portal/contactview.py
portal/forms.py
portal/registrationview.py
portal/slicerequestview.py
portal/templates/contact-support-email.txt [new file with mode: 0644]
portal/templates/contact.html
portal/templates/user_request_email.txt

index 796c8b0..caee44a 100644 (file)
@@ -18,18 +18,18 @@ class ContactView (FreeAccessView):
             # Process the data in form.cleaned_data
             first_name = form.cleaned_data['first_name']
             last_name = form.cleaned_data['last_name']
-            affiliation = form.cleaned_data['affiliation']
+            authority = form.cleaned_data['authority']
             subject = form.cleaned_data['subject']
-            message = form.cleaned_data['message']
+            description = form.cleaned_data['description']
             email = form.cleaned_data['email'] # email of the sender
             cc_myself = form.cleaned_data['cc_myself']
 
             #recipients = authority_get_pi_emails(authority_hrn)
-            recipients = ['yasin.upmc@gmail.com', 'thierry.parmentelat@inria.fr', ]
+            recipients = ['support@myslice.info' ]
             if cc_myself:
                 recipients.append(email)
 
-            msg = render_to_string('slice-request-email.txt', form.cleaned_data)
+            msg = render_to_string('contact-support-email.txt', form.cleaned_data)
             send_mail("Onelab user %s submitted a query "%email, msg, email, recipients)
             return render(request,'contact_sent.html') # Redirect after POST
         else:
index df5c1a6..fc8d8c3 100644 (file)
@@ -56,10 +56,10 @@ from django.template import loader
 class ContactForm(forms.Form):
     first_name = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
     last_name = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
-    affiliation = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
+    authority = forms.CharField(widget=forms.TextInput(attrs={'class':'form-control'}))
     email = forms.EmailField(widget=forms.TextInput(attrs={'class':'form-control'}))
     subject = forms.CharField(max_length=100,widget=forms.TextInput(attrs={'class':'form-control'}))
-    message = forms.CharField(widget=forms.Textarea(attrs={'class':'form-control'}))
+    description = forms.CharField(widget=forms.Textarea(attrs={'class':'form-control'}))
     cc_myself = forms.BooleanField(required=False,widget=forms.CheckboxInput(attrs={'class':'form-control'}))
 
 class PassResetForm(forms.Form):
index 9cc0cc3..e068aec 100644 (file)
@@ -46,7 +46,8 @@ class RegistrationView (FreeAccessView):
             print "FIREXP ENABLED"
 
         authorities = execute_admin_query(request, authorities_query)
-        authorities = sorted(authorities)
+        if authorities is not None:
+            authorities = sorted(authorities)
         # xxx tocheck - if authorities is empty, it's no use anyway
         # (users won't be able to validate the form anyway)
 
index ee94738..5b49607 100644 (file)
@@ -30,7 +30,8 @@ class SliceRequestView (LoginRequiredAutoLogoutView):
         # Using cache manifold-tables to get the list of authorities faster
         authorities_query = Query.get('authority').select('name', 'authority_hrn')
         authorities = execute_admin_query(request, authorities_query)
-        authorities = sorted(authorities)
+        if authorities is not None:
+            authorities = sorted(authorities)
 
         user_query  = Query().get('local:user').select('email')
         user_email = execute_query(self.request, user_query)
diff --git a/portal/templates/contact-support-email.txt b/portal/templates/contact-support-email.txt
new file mode 100644 (file)
index 0000000..9eb576d
--- /dev/null
@@ -0,0 +1,12 @@
+User details: 
+
+First name      : {{first_name}}
+Last name      : {{last_name}}
+email           : {{email}}
+Authority      : {{authority}}
+
+Query Details:
+
+Subject         : {{subject}}
+Description     : {{description}}
+
index ab00b15..12f76c3 100644 (file)
@@ -9,8 +9,8 @@
 <link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css" />
 <div class="onelab-title well-lg">
   <h2>Onelab Support</h2>
-  <h4>If you have already registered, then please send an <a href="mailto:support@myslice.info">e-mail</a>
-  or <a href="http://trac.myslice.info/" >visit us</a></h4>
+  <h4>If you have any diffculties using the portal, please contact us by filling this form below.</h4>
+  <h4>You can also <a href="mailto:support@myslice.info">e-mail</a> us directly or consult to our <a href="http://trac.myslice.info/" >documentation</a></h4>
 </div>
 
 <!-- no hint for this form, moreover we need more space to write stuff down
@@ -24,7 +24,7 @@
       <div class="col-xs-6"> {{ field.errors }} {{ field }} <p class="form-hint">{{ field.help_text }}</p> </div>
     </div>
     {% endfor %}
-    <button class="submit btn btn-default col-xs-12" type="submit">Send to Support</button>
+    <button class="submit btn btn-default col-xs-12" type="submit">Submit to OneLab Support</button>
   </fieldset>
   </form>
 </div>
index ba37c38..d38fd31 100644 (file)
@@ -4,5 +4,5 @@ First Name   : {{first_name}}
 Last Name    : {{last_name}} 
 Authority hrn: {{authority_hrn}}
 Public key   : {{public_key}}
-email        : {{email}}
-
+Email        : {{email}}
+User Hrn     : {{user_hrn}}