Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from qiita_db.exceptions import QiitaDBUnknownIDError
from qiita_pet.handlers.base_handlers import BaseHandler
from qiita_core.util import execute_as_transaction
from qiita_core.qiita_settings import qiita_config


class MetadataSummaryHandler(BaseHandler):
Expand Down Expand Up @@ -65,14 +66,14 @@ def get(self, arguments):
# The prep template has been provided
template = self._get_template(PrepTemplate, prep_template)
back_button_path = (
"/study/description/%s?top_tab=prep_template_tab&sub_tab=%s"
% (study_id, template.id))
"%s/study/description/%s?top_tab=prep_template_tab&sub_tab=%s"
% (qiita_config.portal_dir, study_id, template.id))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qiita_config is not imported in this file - I'm assuming that flake8 will complain

elif sample_template:
# The sample template has been provided
template = self._get_template(SampleTemplate, sample_template)
back_button_path = (
"/study/description/%s"
% study_id)
"%s/study/description/%s"
% (qiita_config.portal_dir, study_id))
else:
# Neither a sample template or a prep template has been provided
# Fail nicely
Expand Down
4 changes: 2 additions & 2 deletions qiita_pet/templates/ebi_submission.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<h1>Submission summary for study: <b>{{study_title}}</b></h1>

<form role="form" action="/ebi_submission/{{preprocessed_data_id}}" method="post">
<form role="form" action="{% raw qiita_config.portal_dir %}/ebi_submission/{{preprocessed_data_id}}" method="post">
<div class="panel panel-default">
<div class="panel-heading">
The information below describes information contained in the sample
Expand Down Expand Up @@ -45,6 +45,6 @@ <h1>Submission summary for study: <b>{{study_title}}</b></h1>
<b>You need to set an investigation type to continue!</b>
{% end %}
<br/><br/>
<a class="btn btn-primary" href="/study/description/{{study_id}}?top_tab=preprocessed_data_tab&sub_tab={{preprocessed_data_id}}">Return to study</a>
<a class="btn btn-primary" href="{% raw qiita_config.portal_dir %}/study/description/{{study_id}}?top_tab=preprocessed_data_tab&sub_tab={{preprocessed_data_id}}">Return to study</a>
</form>
{% end %}
8 changes: 4 additions & 4 deletions qiita_pet/templates/edit_study.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% extends sitebase.html %}
{% block head %}
<script type="text/javascript" src="/static/vendor/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="{% raw qiita_config.portal_dir %}/static/vendor/js/jquery.validate.min.js"></script>
<style>
.custom-combobox {
position: relative;
Expand Down Expand Up @@ -38,7 +38,7 @@
// fire off ajax the request
request = $.ajax({
type: "GET",
url: '/check_study/',
url: '{% raw qiita_config.portal_dir %}/check_study/',
data: {study_title: $("#study_title")[0].value {% if study %}, old_study_title: '{{study.title}}'{% end %} }
});

Expand Down Expand Up @@ -121,7 +121,7 @@
{% if study %}
function cancel_edition(){
if (confirm("Are you sure you want to go to the study description page? None of the changes will be stored")){
window.location.href = "/study/description/{{study.id}}";
window.location.href = "{% raw qiita_config.portal_dir %}/study/description/{{study.id}}";
}
}
{% end %}
Expand All @@ -138,7 +138,7 @@ <h3>
<span id="errorspan" name="errorspan" style="color: red"></span>
<span id="messagespan" name="messagespan" style="color: red"></span>
<br />
<form id="create_study" name="create_study" action={%if study%}'/study/edit/{{study.id}}'{%else%}'/study/create/'{%end%} method="POST">
<form id="create_study" name="create_study" action={%if study%}'{% raw qiita_config.portal_dir %}/study/edit/{{study.id}}'{%else%}'{% raw qiita_config.portal_dir %}/study/create/'{%end%} method="POST">
<table>
{% for idx, form_item in enumerate(creation_form, start=1) %}
{% set kwargs = {'tabindex': idx, 'class_': 'form-control'} %}
Expand Down
2 changes: 1 addition & 1 deletion qiita_pet/templates/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ <h1 style="text-align:center">ERROR: CODE {{status_code}}!</h1>
<p style="text-align:center">The error has been logged and will be looked at.</p>
<p style="text-align:center">Need help? Send us an <a href="mailto:qiita.help@gmail.com">email</a>.</p>
{% if is_admin %}
<p style="text-align:center">Go to the <a href="/admin/error/">error page</a> to view the logs</p>
<p style="text-align:center">Go to the <a href="{% raw qiita_config.portal_dir %}/admin/error/">error page</a> to view the logs</p>
{% end %}
{% end %}
6 changes: 3 additions & 3 deletions qiita_pet/templates/login.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends sitebase.html %}
{%block content %}
<div id="login-form">
<form action="/auth/login/" method="post" id="login_form">
<form action="{% raw qiita_config.portal_dir %}/auth/login/" method="post" id="login_form">
<fieldset>
<label for="username">Username</label>
<input autocapitalize="off" autocorrect="off" class="text-input" id="username" name="username" tabindex="1" type="text" value="">
Expand All @@ -20,6 +20,6 @@
</div>
</form>
<br>
<a class="link" href="../../auth/create/">Create User</a>
<a class="link" href="{% raw qiita_config.portal_dir %}/auth/create/">Create User</a>
</div>
{% end %}
{% end %}
4 changes: 2 additions & 2 deletions qiita_pet/templates/lost_pass.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{%extends sitebase.html%}
{%block head%}
<script type="text/javascript" src="/static/vendor/js/jquery.validate.min.js"></script>
<script type="text/javascript" src="{% raw qiita_config.portal_dir %}/static/vendor/js/jquery.validate.min.js"></script>
<script type="text/javascript">
// http://www.9lessons.info/2012/04/bootstrap-registration-form-tutorial.html
$(document).ready(function() {
Expand Down Expand Up @@ -33,7 +33,7 @@
<div style='width: 50%;'>
<h1>Lost Password</h1>
<h3>Enter email for account</h3>
<form class="form-horizontal" role="form" action="/auth/forgot/" method="post" id="lost_pass" name="lost_pass">
<form class="form-horizontal" role="form" action="{% raw qiita_config.portal_dir %}/auth/forgot/" method="post" id="lost_pass" name="lost_pass">
<div class="form-group">
<label for="email" class="col-sm-2 control-label">Email</label>
<div class="col-sm-10">
Expand Down
10 changes: 5 additions & 5 deletions qiita_pet/templates/portals_edit.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends sitebase.html%}

{%block head%}
<link rel="stylesheet" href="/static/vendor/css/jquery.dataTables.css" type="text/css">
<link rel="stylesheet" href="{% raw qiita_config.portal_dir %}/static/vendor/css/jquery.dataTables.css" type="text/css">
<style type="text/css">
.navlist li
{
Expand All @@ -19,7 +19,7 @@
white-space: nowrap;
}
</style>
<script src="/static/vendor/js/jquery.dataTables.min.js"></script>
<script src="{% raw qiita_config.portal_dir %}/static/vendor/js/jquery.dataTables.min.js"></script>
<script type="text/javascript">
function check_submit(action) {
//disable submit buttons
Expand Down Expand Up @@ -57,7 +57,7 @@
bootstrapAlert(data, "danger", 2200);
}
else {
$('#info-table').DataTable().ajax.url("/admin/portals/studiesAJAX/" + echo).load();
$('#info-table').DataTable().ajax.url("{% raw qiita_config.portal_dir %}/admin/portals/studiesAJAX/" + echo).load();
bootstrapAlert(data, "success", 2200);
}
$("#portal").val('');
Expand Down Expand Up @@ -99,7 +99,7 @@
{ 'mRender': render_checkbox, 'mData': 2, 'aTargets': [ 0 ] }
],
"ajax": {
"url": "/admin/portals/studiesAJAX/?sEcho=" + Math.floor(Math.random()*1001) + "&view-portal=QIITA",
"url": "{% raw qiita_config.portal_dir %}/admin/portals/studiesAJAX/?sEcho=" + Math.floor(Math.random()*1001) + "&view-portal=QIITA",
"aoColumns": [
{"sSortDataType": "dom-checkbox", "bSearchable": false, "bSortable": false},
{% for h in headers %}
Expand All @@ -120,7 +120,7 @@

$('#view-portal').change(function() {
var echo = "?sEcho=" + Math.floor(Math.random()*1001) + "&view-portal=" + $("#view-portal").val();
$('#info-table').DataTable().ajax.url("/admin/portals/studiesAJAX/" + echo).load();
$('#info-table').DataTable().ajax.url("{% raw qiita_config.portal_dir %}/admin/portals/studiesAJAX/" + echo).load();
});
});
</script>
Expand Down
2 changes: 1 addition & 1 deletion qiita_pet/templates/select_commands.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<h1>Select Commands</h1>
<span id="error" style="color:red"></span>
<form role="form" action="/analysis/wait/{{aid}}" method="post" onsubmit="return check_selection()">
<form role="form" action="{% raw qiita_config.portal_dir %}/analysis/wait/{{aid}}" method="post" onsubmit="return check_selection()">

<div>
<table class="table">
Expand Down
10 changes: 5 additions & 5 deletions qiita_pet/templates/show_analyses.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<div id='no-analyses' class='jumbotron'>
<h1>No Analyses available</h1>
<h3><a href="/study/list/">Create an analysis</a></h3>
<h3><a href="{% raw qiita_config.portal_dir %}/study/list/">Create an analysis</a></h3>
</div>

{% if analyses %}
Expand All @@ -34,19 +34,19 @@ <h3><a href="/study/list/">Create an analysis</a></h3>
{% if status == "in_construction"%}
<tr>
<td>
<a href="/analysis/{{analysis.step}}?aid={{analysis.id}}">{{analysis.name}}</a>
<a href="{% raw qiita_config.portal_dir %}/analysis/{{analysis.step}}?aid={{analysis.id}}">{{analysis.name}}</a>
{% elif status == "running" %}
<tr class="active">
<td>
<a href="/analysis/wait/{{analysis.id}}">{{analysis.name}}</a>
<a href="{% raw qiita_config.portal_dir %}/analysis/wait/{{analysis.id}}">{{analysis.name}}</a>
{% elif status == "completed" %}
<tr class="success">
<td>
<a href="/analysis/results/{{analysis.id}}">{{analysis.name}}</a>
<a href="{% raw qiita_config.portal_dir %}/analysis/results/{{analysis.id}}">{{analysis.name}}</a>
{% elif status == "error" %}
<tr class="danger">
<td>
<a href="/analysis/results/{{analysis.id}}">{{analysis.name}}</a>
<a href="{% raw qiita_config.portal_dir %}/analysis/results/{{analysis.id}}">{{analysis.name}}</a>
{% else %}
<tr class="active">
<td>
Expand Down
6 changes: 3 additions & 3 deletions qiita_pet/templates/stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
streetViewControl: false,
mapTypeControl: false
};

var map = new google.maps.Map(document.getElementById('map-canvas'),
mapOptions);

Expand All @@ -27,7 +27,7 @@
new google.maps.Size(40, 37),
new google.maps.Point(0, 0),
new google.maps.Point(12, 35));

{% for lat, lng in lat_longs %}
setMarker(map, {{ lat }}, {{ lng }}, pinImage, pinShadow, pinColor);
{% end %}
Expand Down Expand Up @@ -75,7 +75,7 @@ <h3>{{ random_study_title }}</h3>
<p align="justify">{{ random_study_info['study_abstract'] }}</p>
<p>
{% if user is not None %}
<a href="/study/description/{{ random_study_id }}">Go to the study <span class="glyphicon glyphicon-arrow-right"></span></a>
<a href="{% raw qiita_config.portal_dir %}/study/description/{{ random_study_id }}">Go to the study <span class="glyphicon glyphicon-arrow-right"></span></a>
{% else %}
<h4>Log in above to see this and other public studies</h4>
{% end %}
Expand Down
8 changes: 4 additions & 4 deletions qiita_pet/templates/study_description.html
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
var qual = result[6];

var form = $("<form>")
.attr("action", "/study/create_raw_data")
.attr("action", "{% raw qiita_config.portal_dir %}/study/create_raw_data")
.attr("method", "post")
.append($("<input>")
.attr("type", "hidden")
Expand Down Expand Up @@ -207,7 +207,7 @@
bootstrapAlert("You need to select a raw data used in a previous study");
} else {
var form = $("<form>")
.attr("action", "/study/create_raw_data")
.attr("action", "{% raw qiita_config.portal_dir %}/study/create_raw_data")
.attr("method", "post")
.append($("<input>")
.attr("type", "hidden")
Expand Down Expand Up @@ -577,9 +577,9 @@ <h2><i>{{study_alias}}</i></h2>
<tr>
<td style="vertical-align: middle; text-align:left; width: 50%;" colspan="2">
{% if show_edit_btn %}
<a class="btn btn-default glyphicon glyphicon-edit" href="/study/edit/{{study.id}}" title="Edit the study information" style="margin:5px; word-spacing: -10px;"> Edit</a>
<a class="btn btn-default glyphicon glyphicon-edit" href="{% raw qiita_config.portal_dir %}/study/edit/{{study.id}}" title="Edit the study information" style="margin:5px; word-spacing: -10px;"> Edit</a>
{% end %}
<a href="/study/upload/{{study.id}}" class="btn btn-default glyphicon glyphicon-upload" title="Upload study files" style="margin:5px; word-spacing: -10px;"> Upload</a>
<a href="{% raw qiita_config.portal_dir %}/study/upload/{{study.id}}" class="btn btn-default glyphicon glyphicon-upload" title="Upload study files" style="margin:5px; word-spacing: -10px;"> Upload</a>
<a class="btn btn-danger glyphicon glyphicon-trash" style="display: inline-block;" data-toggle="modal" data-target="#delete-study"> Delete-study</a>
</td>
</tr>
Expand Down
10 changes: 5 additions & 5 deletions qiita_pet/templates/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<li>fastq or fastq.gz (gziped fastq) for sequences. Note that zip files can not be processed</li>
<li>tab separated text files for sample and prep templates, the extension should be txt</li>
</ul>
<a href="/study/description/{{study_id}}">Go to study description</a>
<a href="{% raw qiita_config.portal_dir %}/study/description/{{study_id}}">Go to study description</a>
</td>
</tr>

Expand Down Expand Up @@ -62,10 +62,10 @@


<!-- Upload required files and JS code -->
<script src="/static/vendor/js/resumable.js"></script>
<script src="/static/vendor/js/resumable-uploader.js"></script>
<script src="/static/vendor/js/underscore.min.js"></script>
<script src="/static/vendor/js/string.min.js"></script>
<script src="{% raw qiita_config.portal_dir %}/static/vendor/js/resumable.js"></script>
<script src="{% raw qiita_config.portal_dir %}/static/vendor/js/resumable-uploader.js"></script>
<script src="{% raw qiita_config.portal_dir %}/static/vendor/js/underscore.min.js"></script>
<script src="{% raw qiita_config.portal_dir %}/static/vendor/js/string.min.js"></script>

<script>
var meta = { fileType: [] };
Expand Down