Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Updated templates with individual sidebars for experiment and developer
  • Loading branch information
dtraviglia committed Apr 14, 2015
1 parent c3cbd11 commit 679a1cb9654f727c773dfeda65b42f6a23c8db52
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 14 deletions.
@@ -8,7 +8,7 @@
</div>
<div class="panel-body">
<a href="{% url 'developer:home' %}">Developer Portal Home</a><br>
<a href="{% url 'developer:view_dev_products' %}">Available products</a><br>
<a href="{% url 'developer:view_dev_products' %}">Manage products</a><br>
<a href="{% url 'developer:submit_product' %}">Submit a new product</a><br>
</div>
</div>
@@ -10,6 +10,7 @@
<a href="{% url 'exp_portal:home' %}">Experiment Portal Home</a><br>
<a href="{% url 'exp_portal:view_status' %}">Check experiment status</a><br>
<a href="{% url 'exp_portal:submit_task' %}">Submit a new task</a><br>
<a href="{% url 'exp_portal:manage_tasks' %}">Manage Tasks</a><br>
</div>
</div>

@@ -5,23 +5,22 @@
<h1>Please enter your task information:</h1>
<form method="POST" action="/experiment/newTask">
Task Name:<br>
<input name="task_name" id='id_task_name' placeholder='Enter the task name' size="60" required/><br>
<input class="form-control" name="task_name" id='id_task_name' placeholder='Enter the task name' size="60" required/><br>
Task Version:<br>
<input name="task_version" id='id_task_version' placeholder="Task version number" size="25" required/><br>
<input class="form-control" name="task_version" id='id_task_version' placeholder="Task version number" size="25" required/><br>
Instructions URL:<br>
<input name="task_instructions" id='id_task_instructions' type='url' placeholder='Enter the url for the task instructions' size="60" required/><br>
<input class="form-control" name="task_instructions" id='id_task_instructions' type='url' placeholder='Enter the url for the task instructions' size="60" required/><br>
Dataset:<br>
<select name="task_dataset" id='id_task_dataset' placeholder='Select Dataset' required>
<select class="form-control" name="task_dataset" id='id_task_dataset' placeholder='Select Dataset' required>
<option value="" style="display:none;"></option>
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="husqvarna">Husqvarna</option>
</select><br>
Task URL:<br>
<input name="task_url" id='id_task_url' type='url' placeholder='Enter the task url' size="60" required/><br>
<input class="form-control" name="task_url" id='id_task_url' type='url' placeholder='Enter the task url' size="60" required/><br>
Exit survey URL:<br>
<input name="exit_url" id='id_exit_url' type='url' placeholder='Enter the exit survey url' size ="60"><br>
<input name="active_check" id='id_active_check' type="checkbox" value="True">Is this task active?<br>
<input class="form-control" name="exit_url" id='id_exit_url' type='url' placeholder='Enter the exit survey url' size ="60"><br>
<input class="btn btn-primary" type="submit" value="Submit"/>
{% csrf_token %}
</form>
@@ -14,4 +14,5 @@
url(r'^tasks$', views.view_tasks, name='view_tasks'),
url(r'^tasks/completed$', views.view_completed, name='view_completed'),
url(r'^tasks/incomplete$', views.view_incomplete, name='view_incomplete'),
url(r'^manage$', views.manage_tasks, name='manage_tasks'),
)
@@ -52,4 +52,7 @@ def new_task(request):
return redirect('/experiment/taskAdded/')

def task_added(request):
return render(request, 'task_added.html')
return render(request, 'task_added.html')

def manage_tasks(request):
return view_tasks(request)
@@ -4,6 +4,7 @@
from django.contrib.auth.models import User
from django.conf import settings
from django.conf.urls.static import static
import sys

from op_tasks.models import Dataset, Product, OpTask, UserProfile, TaskListItem

@@ -12,6 +13,20 @@

class NewVisitorTest(LiveServerTestCase):

@classmethod
def setUpClass(cls):
for arg in sys.argv:
if 'liveserver' in arg:
cls.server_url = 'http://' + arg.split('=')[1]
return
super(NewVisitorTest, cls).setUpClass()
cls.server_url = cls.live_server_url

@classmethod
def tearDownClass(cls):
if cls.server_url == cls.live_server_url:
super(NewVisitorTest, cls).tearDownClass()

def setUp(self):
# TODO find a way to call populate_db
test_tasks = [
@@ -46,7 +61,10 @@ def tearDown(self):

def test_can_register_a_user_with_tasks(self):
# browse to online portal
self.browser.get(self.live_server_url)
self.browser.get(self.server_url)

# check the title of the webpage
self.assertIn('XDATA', self.browser.title)

# click the sign in page
self.browser.find_element_by_link_text("Register").click()
@@ -80,3 +98,11 @@ def test_can_register_a_user_with_tasks(self):

# self.browser.implicitly_wait(25)

# def test_can_show_STOUT_and_ALE_integration(self):
# experiment admin page load showing experiment setup
# what does experiment setup process look like?

# user registers and browses to task list
# completes first part of experiment

# browse back to experiment admin page to show results
@@ -88,6 +88,6 @@ class Meta:
ordering = ('userprofile', 'index')
# index = models.IntegerField()

class UserSessionID(models.Model):
userprofile = models.ForeignKey(UserProfile)
datecreated = models.DateTimeField(default=None, blank=True, null=True)
# class UserSessionID(models.Model):
# userprofile = models.ForeignKey(UserProfile)
# datecreated = models.DateTimeField(default=None, blank=True, null=True)
@@ -91,7 +91,8 @@
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.6/howto/static-files/

STATIC_ROOT = "/var/www/html/stout/static/"
# STATIC_ROOT = "/var/www/html/stout/static/"
STATIC_ROOT = os.path.join(BASE_DIR, '/static')

STATIC_URL = '/static/'

0 comments on commit 679a1cb

Please sign in to comment.