Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
check for admin, show appropriate links according to status
  • Loading branch information
dtraviglia committed Apr 27, 2015
1 parent 4683b58 commit 7bec14f506c1211d06ce1c6353669ee6850c7f7a
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
@@ -1,8 +1,10 @@
from django.shortcuts import render
from op_tasks.models import UserProfile, Product, Dataset, OpTask, TaskListItem
from django.contrib.auth.decorators import login_required

# Create your views here.

@login_required(login_url='/tasking/login')
def home_page(request):
return render(request, 'experimenthome.html')

@@ -2,6 +2,18 @@

{% block side_block %}

{% if user.is_staff %}
<div class="panel panel-default">
<div class="panel-heading">
<b class="panel-title">Admininstration</b>
</div>
<div class="panel-body">
<a href="{% url 'exp_portal:home' %}">Experiment Portal</a><br>
<a href="{% url 'developer:home' %}">Developer Portal</a><br>
</div>
</div>
{% endif %}

<div class="panel panel-default">
<div class="panel-heading">
<b class="panel-title">Navigation</b>
@@ -12,6 +24,7 @@
<a href="{% url 'op_tasks:instruct' %}">Instructions</a><br>
</div>
</div>

<div class="panel panel-default">
<div class="panel-heading">
<b class="panel-title">Achievements</b>
@@ -0,0 +1,26 @@
ac.registerActivityLogger(
"http://10.1.93.208",
"STOUT",
"v0.1"
);

$('#open-task-button').click(function() {
ac.logUserActivity('User opened task form', // description
'open_modal_tools', // activity_code
ac.WF_CREATE // workflow State
);
})

$('#task-complete-button').click(function() {
ac.logUserActivity('User submitted task complete', // description
'task_complete', // activity_code
ac.WF_OTHER // workflow State
);
})

$('#hide-button').click(function() {
ac.logUserActivity('User hid task form', // description
'hide_modal_tools', // activity code
ac.WF_CREATE
);
})

0 comments on commit 7bec14f

Please sign in to comment.