From: Ciro Scognamiglio Date: Thu, 20 Feb 2014 18:03:10 +0000 (+0100) Subject: home and ticket style X-Git-Tag: myslice-1.1~329 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=73c56c22ad3fad69695018c4dea8a0d22cd5727c;p=unfold.git home and ticket style --- diff --git a/portal/contactview.py b/portal/contactview.py index a97d697d..63b4bb0b 100644 --- a/portal/contactview.py +++ b/portal/contactview.py @@ -33,7 +33,11 @@ class ContactView (FreeAccessView, ThemeView): 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', { 'theme' : self.theme}) # Redirect after POST + if request.user.is_authenticated() : + username = request.user.email + else : + username = None + return render(request,'contact_sent.html', { 'theme' : self.theme, 'username': username}) # Redirect after POST else: return self._display (request, form) @@ -41,9 +45,13 @@ class ContactView (FreeAccessView, ThemeView): return self._display (request, ContactForm()) # A fresh unbound form def _display (self, request, form): + if request.user.is_authenticated() : + username = request.user.email + else : + username = None return render(request, 'contact.html', { 'form': form, 'topmenu_items': topmenu_items('Contact', request), - 'username': the_user (request), - 'theme' : self.theme + 'theme' : self.theme, + 'username': username, }) diff --git a/portal/homeview.py b/portal/homeview.py index 57041648..395cd965 100644 --- a/portal/homeview.py +++ b/portal/homeview.py @@ -44,6 +44,7 @@ class HomeView (FreeAccessView, ThemeView): # let's use ManifoldResult.__repr__ env['state']="%s"%manifoldresult env['layout_1_or_2']="layout-unfold2.html" + return render_to_response(self.template,env, context_instance=RequestContext(request)) # user was authenticated at the backend elif auth_result is not None: @@ -51,18 +52,24 @@ class HomeView (FreeAccessView, ThemeView): if user.is_active: print "LOGGING IN" login(request, user) - return HttpResponseRedirect ('/login-ok') + + if request.user.is_authenticated(): + env['person'] = self.request.user + else: + env['person'] = None + return render_to_response(self.template,env, context_instance=RequestContext(request)) else: env['state'] = "Your account is not active, please contact the site admin." env['layout_1_or_2']="layout-unfold2.html" + return render_to_response(self.template,env, context_instance=RequestContext(request)) # otherwise else: env['state'] = "Your username and/or password were incorrect." env['layout_1_or_2']="layout-unfold2.html" + return render_to_response(self.template, env, context_instance=RequestContext(request)) - # login-ok sets state="Welcome to MySlice" in urls.py def get (self, request, state=None): env = self.default_env() diff --git a/portal/static/css/onelab.css b/portal/static/css/onelab.css index 59364b48..e2f62164 100644 --- a/portal/static/css/onelab.css +++ b/portal/static/css/onelab.css @@ -16,19 +16,14 @@ body { a, a:active, a:focus { outline: 0; } -input { - margin:0; -} + h1 { - color:#0B0042; border-bottom:1px solid #DDDDDD; padding:0 0 15px 0; margin:0 0 15px 0; } h1 img { vertical-align:top; - margin:0; - padding:0; } div.wrapper { width:980px; @@ -143,20 +138,33 @@ div#home-dashboard table tr:first-child td { color:#270A5A; } div#home-dashboard table tr:last-child td { - font-size:12pt; vertical-align:top; + padding:25px 0; +} +div#home-dashboard table tr:last-child td.logged-in { border-right:1px solid #DDDDDD; padding:25px; } +div#home-dashboard table tr:last-child td.support { + border-left:1px solid #DDDDDD; + padding:25px; +} div#home-dashboard table tr:last-child td:first-child { } div#home-dashboard table tr:last-child td:last-child { border-right:0; } -div#home-dashboard table tr:last-child td div { +div#home-dashboard table tr:last-child td.logged-in div { + text-align:left; + padding:25px 0; +} +div#home-dashboard table tr:last-child td.support div { text-align:left; padding:25px 0; } +div#home-dashboard div.login-widget { + padding:20px; +} div#home-dashboard table td.support { } div#home-dashboard table td.support a { @@ -224,11 +232,24 @@ div#slice-request { color:black; margin:25px auto; } -div#slice-request div { +.form-hint { + font-size:11pt; + font-style:italic; + color:gray; +} + + +/* TICKET REQUEST */ +div#ticket-request { + color:black; + margin:25px auto; } .form-hint { font-size:11pt; font-style:italic; color:gray; } +div#ticket-request p { + margin:20px 0; +} diff --git a/portal/templates/contact.html b/portal/templates/contact.html index 12f76c33..4bc8218b 100644 --- a/portal/templates/contact.html +++ b/portal/templates/contact.html @@ -6,16 +6,16 @@ {% block unfold_main %} - -
-

Onelab Support

-

If you have any diffculties using the portal, please contact us by filling this form below.

-

You can also e-mail us directly or consult to our documentation

-
- -
+
+

Open a Ticket Onelab Support

+ +

+ If you have any diffculties using the portal, please contact us by filling this form below.
+ You can also e-mail us directly or consult to our documentation +

+ +
{% csrf_token %}
{% for field in form %} @@ -24,7 +24,9 @@
{{ field.errors }} {{ field }}

{{ field.help_text }}

{% endfor %} - +
+
+
diff --git a/portal/templates/onelab/_widget-login-user.html b/portal/templates/onelab/_widget-login-user.html index db7245cd..9e248875 100644 --- a/portal/templates/onelab/_widget-login-user.html +++ b/portal/templates/onelab/_widget-login-user.html @@ -1,4 +1,4 @@ -
+