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)
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,
})
# 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:
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()
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;
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 {
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;
+}
{% block unfold_main %}
-<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 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
- so we use a 3-6-3 layout -->
-<div class='well'>
+<div class="wrapper" id="ticket-request">
+<h1><img src="{{ STATIC_URL }}img/icon_support_small.png" alt="Open a Ticket" /> Onelab Support</h1>
+
+<p>
+ If you have any diffculties using the portal, please contact us by filling this form below.<br />
+ 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>
+</p>
+
+<div>
<form class="cmxform form-horizontal" id="commentForm" action="#" method="post" role="form">{% csrf_token %}
<fieldset>
{% for field in form %}
<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">Submit to OneLab Support</button>
+ <div class="col-xs-5">
+ </div>
+ <button class="submit btn btn-default col-xs-2" type="submit">Create Ticket</button>
</fieldset>
</form>
</div>
-<div class="well">
+<div class="well login-widget">
{% if state %}
<span class="help-block">{{ state }}</span>
{% endif %}
<td><img src="{{ STATIC_URL }}img/icon_support.png" alt="" /></td>
</tr>
<tr>
- <td>
{% if person %}
+ <td class="logged-in">
<button id="logoutbtn" type="button" class="btn btn-default" data-username="{{ username }}"><span class="glyphicon glyphicon-off"></span> Logout</button>
<div>
{% if person.last_name %}
<span class="label">Email:</span> <a href='mailto:{{person.email}}'>{{person.email}}</a>
</div>
{% else %}
+ <td>
{% include 'onelab/_widget-login-user.html' %}
{% endif %}
</td>
<td>
+ {% if person %}
<button id="slicerequestbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Request a Slice</button>
+ {% else %}
+ {% endif %}
</td>
<td class="support">
<button id="ticketbtn" type="button" class="btn btn-default"><span class="glyphicon glyphicon-plus"></span> Create Ticket</button>
<td><img src="{{ STATIC_URL }}img/icon_testbed_color.png" alt="" /></td>
</tr>
<tr>
- <td>
{% if person %}
+ <td class="logged-in">
{% if person.last_name %}
<div><span id='username'>{{person.first_name}} {{person.last_name}}</span></div> {% endif %}
<div><b>Email: </b><a href='mailto:{{person.email}}'>{{person.email}}</a></div>
{% else %}
+ <td>
{% include 'onelab/_widget-login-manager.html' %}
{% endif %}
</td>