Skip to content
Snippets Groups Projects
Commit c60d2852 authored by Hernandez-Courbevoie Yohan's avatar Hernandez-Courbevoie Yohan
Browse files

Small modifications and bug fixes

Add a footer to python-generated pages. The footer is described in
footer.php.

Add "push_in_history" in ajax request when retrieving result with ID.

Tabs names are now in lowercase.
parent 242ddc32
Branches pre_jobim_updates
No related tags found
No related merge requests found
...@@ -58,7 +58,7 @@ def peak_parser_mzml(peak_file_name): ...@@ -58,7 +58,7 @@ def peak_parser_mzml(peak_file_name):
intensity_array = f[0]["intensity array"] #pour avoir l'intensité des pics intensity_array = f[0]["intensity array"] #pour avoir l'intensité des pics
for mass, intensity in zip(mass_array.tolist(), intensity_array.tolist()): for mass, intensity in zip(mass_array.tolist(), intensity_array.tolist()):
couple = (float(mass), intfloat((intensity))) couple = (float(mass), float(intensity))
if couple not in peak_list: if couple not in peak_list:
peak_list.append(couple) peak_list.append(couple)
...@@ -357,7 +357,9 @@ def write_details_page(spectrum_name, run_id, job_name=None): ...@@ -357,7 +357,9 @@ def write_details_page(spectrum_name, run_id, job_name=None):
html += '<script> if (performance.navigation.type == 2 || performance.navigation.type == 0) {location.reload(true);}</script>' html += '<script> if (performance.navigation.type == 2 || performance.navigation.type == 0) {location.reload(true);}</script>'
# Insert page footer # Insert page footer
html += '</div></div></body>' html += '</div></div>'
html += open(f"{common.HTML_PATH}/footer.php", "r").read()
html +='</body></html>'
# Write details page # Write details page
open(f'{common.RESULT_DIR}{run_id}/details_{os.path.splitext(spectrum_name)[0].replace(" ", "_")}.html', "w").write(html) open(f'{common.RESULT_DIR}{run_id}/details_{os.path.splitext(spectrum_name)[0].replace(" ", "_")}.html', "w").write(html)
......
...@@ -10,7 +10,12 @@ import common ...@@ -10,7 +10,12 @@ import common
def write_main_page(result_path, run_id, error_list): def write_main_page(result_path, run_id, error_list):
"""Write a HTML page. This result page display errors made by the user when filling the formular.""" """Write a HTML page. This result page display errors made by the user when filling the formular."""
main_page = open(result_path + run_id + "/results.php", "w") main_page = open(result_path + run_id + "/results.php", "w")
main_page.write('<div id="center">')
# Insert page header
main_page.write(open(f"{common.HTML_PATH}/header.php", "r").read())
main_page.write('<div class="frametitle"><h1 id="title">Pampa</h1></div><div id="center_sup"><div class="theme-border" style="display:none"></div><div id="link_home" style="display:inline-block"><a href="/" class="text_onglet"><img src="/Style/icon/home_w.png" alt="home_general"/></a></div><div class="tabs" id="menu_central" style="display:inline-block">')
main_page.write(open(f"{common.HTML_PATH}/menu_central.txt", 'r').read())
main_page.write('</div></div><div id="main"><div id="center">')
# Show the error messages # Show the error messages
main_page.write("<div class='formulaire'>") main_page.write("<div class='formulaire'>")
...@@ -22,7 +27,11 @@ def write_main_page(result_path, run_id, error_list): ...@@ -22,7 +27,11 @@ def write_main_page(result_path, run_id, error_list):
# Back to the formular # Back to the formular
main_page.write('<a href="/pampa/form.php" class="aLoad" >Back to PAMPA classify</a>') main_page.write('<a href="/pampa/form.php" class="aLoad" >Back to PAMPA classify</a>')
main_page.write("</div>") # Insert page footer
html += '</div></div>'
html += open(f"{common.HTML_PATH}/footer.php", "r").read()
html +='</body></html>'
main_page.close() main_page.close()
......
...@@ -9,7 +9,12 @@ import common ...@@ -9,7 +9,12 @@ import common
def write_main_page(run_id): def write_main_page(run_id):
"""Write a HTML page. This result page display errors made by the user when filling the formular.""" """Write a HTML page. This result page display errors made by the user when filling the formular."""
main_page = open(common.RESULT_DIR + run_id + "/results.php", "w") main_page = open(common.RESULT_DIR + run_id + "/results.php", "w")
main_page.write('<div id="center">')
# Insert page header
main_page.write(open(f"{common.HTML_PATH}/header.php", "r").read())
main_page.write('<div class="frametitle"><h1 id="title">Pampa</h1></div><div id="center_sup"><div class="theme-border" style="display:none"></div><div id="link_home" style="display:inline-block"><a href="/" class="text_onglet"><img src="/Style/icon/home_w.png" alt="home_general"/></a></div><div class="tabs" id="menu_central" style="display:inline-block">')
main_page.write(open(f"{common.HTML_PATH}/menu_central.txt", 'r').read())
main_page.write('</div></div><div id="main"><div id="center">')
# Show the error messages # Show the error messages
main_page.write("<div class='formulaire'>") main_page.write("<div class='formulaire'>")
...@@ -21,7 +26,11 @@ def write_main_page(run_id): ...@@ -21,7 +26,11 @@ def write_main_page(run_id):
# Back to the formular # Back to the formular
main_page.write('<a href="/pampa/form.php" class="aLoad" >Back to PAMPA classify</a>') main_page.write('<a href="/pampa/form.php" class="aLoad" >Back to PAMPA classify</a>')
main_page.write("</div>") # Insert page footer
html += '</div></div>' # center - main
html += open(f"{common.HTML_PATH}/footer.php", "r").read()
html +='</body></html>'
main_page.close() main_page.close()
......
...@@ -154,7 +154,9 @@ def write_main_page(run_id, taxo_used, job_name=None): ...@@ -154,7 +154,9 @@ def write_main_page(run_id, taxo_used, job_name=None):
html += ('<br>') html += ('<br>')
# Insert page footer # Insert page footer
html += '</div></div></body>' html += '</div></div>'
html += open(f"{common.HTML_PATH}/footer.php", "r").read()
html +='</body></html>'
open(common.RESULT_DIR + run_id + "/results.php", "w").write(html) open(common.RESULT_DIR + run_id + "/results.php", "w").write(html)
......
<div id='footer'>
<table id="footerTable">
<tr>
<td id='footer_left'></td>
<td id='footer_right'>
2024 - <a href="http://cristal.univ-lille.fr/bonsai" target="_blank">Bonsai bioinformatics</a>
<br>
</td>
</tr>
</table>
</div> <!-- footer -->
\ No newline at end of file
...@@ -26,16 +26,19 @@ ...@@ -26,16 +26,19 @@
<h2>How to use PAMPA ?</h2> <h2>How to use PAMPA ?</h2>
<p>PAMPA is available in two versions.</p> <p>PAMPA is available in two versions.</p>
<p><B>Download :</B> the source code is available at <a href="https://github.com/touzet/pampa" target="_blank">https://github.com/touzet/pampa</a></p> <p><B>Download :</B> the source code for local installation is available at <a href="https://github.com/touzet/pampa" target="_blank">https://github.com/touzet/pampa</a>. This version includes the complete range of features offered by the software.</p>
<p><B>Web interface :</B> most facilities</p> <p><B>Web interface :</B> user-friendly web application for fast and easy species identification from mass spectra. It is accessible <a href="/pampa/form.php" class="mc aLoad">here</a>.</p>
<h2>Authors</h2> <h2>Authors</h2>
<p> <p>
The program has been developed by Hélène Touzet in close collaboration with Fabrice Bray (Lille ZooMS platform). The program has been developed by <a href="https://helene-touzet.cnrs.fr/" target="_blank">Hélène Touzet</a> (CRIStAL) in close collaboration with Fabrice Bray (Lille ZooMS platform).
The web interface has been designed by Yohan Hernandez-Courbevoie, Areski Flissi and Hélène Touzet. The web interface has been designed by Yohan Hernandez-Courbevoie (CRIStAL), Areski Flissi (CRIStAL) and Hélène Touzet.
</p> </p>
<!--h2>Feedbacks</h2--> <h2>Feedbacks</h2>
<p>
Please send comments and questions to <a href="mailto:pampa@univ-lille.fr?Subject=[Feedbacks]">PAMPA</a>.
</p>
</div><!-- center --> </div><!-- center -->
</div><!-- main--> </div><!-- main-->
......
...@@ -47,13 +47,6 @@ $(document).on("click", ".link_img", function() { ...@@ -47,13 +47,6 @@ $(document).on("click", ".link_img", function() {
}); });
}); });
document.addEventListener('DOMContentLoaded', function() {
if (window.location.pathname.includes("details_")) {
if (performance.navigation.type == 2 || performance.navigation.type == 0) {
location.reload(true);
}
}
});
$(document).on("click", "#search", function(){ $(document).on("click", "#search", function(){
var formData = new FormData(document.querySelector("#retrieve")); var formData = new FormData(document.querySelector("#retrieve"));
...@@ -69,6 +62,7 @@ $(document).on("click", "#search", function(){ ...@@ -69,6 +62,7 @@ $(document).on("click", "#search", function(){
setTimeout(function() { setTimeout(function() {
url_result = response.url_result; url_result = response.url_result;
$('#main').load(url_result+" #center"); $('#main').load(url_result+" #center");
push_in_history(url_result);
}, 200); }, 200);
}, },
error: function(request, status, error){ error: function(request, status, error){
...@@ -80,7 +74,7 @@ $(document).on("click", "#search", function(){ ...@@ -80,7 +74,7 @@ $(document).on("click", "#search", function(){
$(document).on("click", "#add_organism", function() { $(document).on("click", "#add_organism", function() {
var $rows = $("#table_organism"); var $rows = $("#table_organism");
var i = $("#table_organism tr:last-child input").data("i") + 1; var i = $("#table_organism tr:last-child input").data("i") + 1;
$rows.append(`<tr><td><input list="taxonomic_node_list" name="taxonomic_node_${i}" data-i=${i} placeholder="Ex: Mammalia (mammals) - [40674; class]" autocomplete="off"/></td></tr>`); $rows.append(`<tr><td><input list="taxonomic_node_list" name="taxonomic_node_${i}" data-i=${i} placeholder="Ex: Mammalia - [40674; class]" autocomplete="off"/></td></tr>`);
}); });
$(document).on("click", "#example_1", function() { $(document).on("click", "#example_1", function() {
......
<ul id="menu"> <ul id="menu">
<li class="onglet onglet_left"> <li class="onglet onglet_left">
<a href="/pampa/" class="mc aLoad">Pampa</a> <a href="/pampa/" class="mc aLoad">pampa</a>
</li> </li>
<li class="onglet"> <li class="onglet">
<a href="/pampa/form.php" class="mc aLoad" >Pampa web</a> <a href="/pampa/form.php" class="mc aLoad" >web server</a>
</li> </li>
<li class="onglet"> <li class="onglet">
<a href="/pampa/result.php" class="mc aLoad" >Results</a> <a href="/pampa/help.php" class="mc aLoad" >help</a>
</li> </li>
<li class="onglet onglet_right"> <li class="onglet onglet_right">
<a href="/pampa/help.php" class="mc aLoad" >Help</a> <a href="/pampa/result.php" class="mc aLoad" >retrieve result with an ID</a>
</li> </li>
</ul> </ul>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment