Commit 2b16e458 authored by Alain Takoudjou's avatar Alain Takoudjou

Update template and Js for Project management

parent f5b737c4
// jQuery File Tree Plugin // jQuery File Tree
// //
// Version 1.01 // Usage: $('.tree').fileTree( options, callback )
//
// Cory S.N. LaViska
// A Beautiful Site (http://abeautifulsite.net/)
// 24 March 2008
//
// Visit http://abeautifulsite.net/notebook.php?article=58 for more information
//
// Usage: $('.fileTreeDemo').fileTree( options, callback )
// //
// Options: root - root folder to display; default = / // Options: root - root folder to display; default = /
// script - location of the serverside AJAX file to use; default = jqueryFileTree.php // script - location of the serverside AJAX file to use;
// folderEvent - event to trigger expand/collapse; default = click // folderEvent - event to trigger expand/collapse; default = click
// expandSpeed - default = 500 (ms); use -1 for no animation // expandSpeed - default = 500 (ms); use -1 for no animation
// collapseSpeed - default = 500 (ms); use -1 for no animation // collapseSpeed - default = 500 (ms); use -1 for no animation
...@@ -19,16 +11,7 @@ ...@@ -19,16 +11,7 @@
// collapseEasing - easing function to use on collapse (optional) // collapseEasing - easing function to use on collapse (optional)
// multiFolder - whether or not to limit the browser to one subfolder at a time // multiFolder - whether or not to limit the browser to one subfolder at a time
// loadMessage - Message to display while initial tree loads (can be HTML) // loadMessage - Message to display while initial tree loads (can be HTML)
// // selectFolder - if true, also return path of folder when event happen on it
// History:
//
// 1.01 - updated to work with foreign characters in directory/file names (12 April 2008)
// 1.00 - released (24 March 2008)
//
// TERMS OF USE
//
// This plugin is dual-licensed under the GNU General Public License and the MIT License and
// is copyright 2008 A Beautiful Site, LLC.
// //
if(jQuery) (function($){ if(jQuery) (function($){
...@@ -37,7 +20,7 @@ if(jQuery) (function($){ ...@@ -37,7 +20,7 @@ if(jQuery) (function($){
// Defaults // Defaults
if( !o ) var o = {}; if( !o ) var o = {};
if( o.root == undefined ) o.root = '/'; if( o.root == undefined ) o.root = '/';
if( o.script == undefined ) o.script = 'jqueryFileTree.php'; if( o.script == undefined ) o.script = '';
if( o.folderEvent == undefined ) o.folderEvent = 'click'; if( o.folderEvent == undefined ) o.folderEvent = 'click';
if( o.expandSpeed == undefined ) o.expandSpeed= 500; if( o.expandSpeed == undefined ) o.expandSpeed= 500;
if( o.collapseSpeed == undefined ) o.collapseSpeed= 500; if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
......
...@@ -16,7 +16,9 @@ $(document).ready( function() { ...@@ -16,7 +16,9 @@ $(document).ready( function() {
$("#flash").fadeOut('normal'); $("#flash").fadeOut('normal');
$("#flash").empty(); $("#flash").empty();
$("#flash").fadeIn('normal'); $("#flash").fadeIn('normal');
repo_url = $("input#repo").val(); var repo_url = $("input#repo").val();
var email = "";
var name = ""
/* /^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/ */ /* /^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/ */
if($("input#repo").val() == "" || !repo_url.match(/^[\w\d\.\/:~@_-]+$/)){ if($("input#repo").val() == "" || !repo_url.match(/^[\w\d\.\/:~@_-]+$/)){
$("#flash").append("<ul class='flashes'><li>Error: Invalid url for the repository</li></ul>"); $("#flash").append("<ul class='flashes'><li>Error: Invalid url for the repository</li></ul>");
...@@ -26,14 +28,18 @@ $(document).ready( function() { ...@@ -26,14 +28,18 @@ $(document).ready( function() {
$("#flash").append("<ul class='flashes'><li>Error: Invalid project name</li></ul>"); $("#flash").append("<ul class='flashes'><li>Error: Invalid project name</li></ul>");
return false; return false;
} }
if($("input#user").val() == "" || $("input#user").val() == "Enter your name..."){ if($("input#user").val() != "" && $("input#user").val() != "Enter your name..."){
$("#flash").append("<ul class='flashes'><li>Error: Please enter your name!</li></ul>"); //$("#flash").append("<ul class='flashes'><li>Error: Please enter your name!</li></ul>");
return false; //return false;
name = $("input#user").val();
} }
if($("input#email").val() == "" || !$("input#email").val().match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){ if($("input#email").val() != "" && $("input#email").val() != "Enter your email adress..."){
$("#flash").append("<ul class='flashes'><li>Error: Please enter your email adress!</li></ul>"); if(!$("input#email").val().match(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/)){
$("#flash").append("<ul class='flashes'><li>Error: Please enter a valid email adress!</li></ul>");
return false; return false;
} }
email = $("input#email").val();
}
$("#imgwaitting").fadeIn('normal'); $("#imgwaitting").fadeIn('normal');
$("#clone").empty(); $("#clone").empty();
$("#clone").append("Stop"); $("#clone").append("Stop");
...@@ -41,8 +47,8 @@ $(document).ready( function() { ...@@ -41,8 +47,8 @@ $(document).ready( function() {
cloneRequest = $.ajax({ cloneRequest = $.ajax({
type: "POST", type: "POST",
url: $SCRIPT_ROOT + '/cloneRepository', url: $SCRIPT_ROOT + '/cloneRepository',
data: "repo=" + repo_url + "&name=" + $("input#name").val() + "&email=" + $("input#email").val() + data: "repo=" + repo_url + "&name=" + $("input#name").val() + "&email=" + email +
"&user=" + $("input#user").val(), "&user=" + name,
success: function(data){ success: function(data){
if(data.code == 1){ if(data.code == 1){
$("#file_navigation").fadeIn('normal'); $("#file_navigation").fadeIn('normal');
......
...@@ -2,7 +2,7 @@ $(document).ready( function() { ...@@ -2,7 +2,7 @@ $(document).ready( function() {
var method = $("input#method").val(); var method = $("input#method").val();
var workdir = $("input#workdir").val(); var workdir = $("input#workdir").val();
if (method != "file"){ if (method != "file"){
script = (method == "new") ? "/openFolder" : "/readFolder"; script = "/openFolder";
$('#fileTree').fileTree({ root: workdir, script: $SCRIPT_ROOT + script, folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false, selectFolder: true }, function(file) { $('#fileTree').fileTree({ root: workdir, script: $SCRIPT_ROOT + script, folderEvent: 'click', expandSpeed: 750, collapseSpeed: 750, multiFolder: false, selectFolder: true }, function(file) {
selectFile(file); selectFile(file);
}); });
...@@ -42,7 +42,7 @@ $(document).ready( function() { ...@@ -42,7 +42,7 @@ $(document).ready( function() {
$("#flash").empty(); $("#flash").empty();
$("#flash").fadeIn('normal'); $("#flash").fadeIn('normal');
if($("input#path").val() == ""){ if($("input#path").val() == ""){
$("#flash").append("<ul class='flashes'><li>Error: Select the folder of your software</li></ul>"); $("#flash").append("<ul class='flashes'><li>Error: Select a valid Software Release folder</li></ul>");
return false; return false;
} }
$.ajax({ $.ajax({
...@@ -64,12 +64,20 @@ $(document).ready( function() { ...@@ -64,12 +64,20 @@ $(document).ready( function() {
function selectFile(file){ function selectFile(file){
var relativeFile = file.replace(workdir, ""); var relativeFile = file.replace(workdir, "");
$("#info").empty(); $("#info").empty();
$("#info").append("Selection: " + relativeFile);
$("input#subfolder").val(file); $("input#subfolder").val(file);
path = ""; path = "";
if(method == "open"){ if(method == "open"){
$("#info").append("Selection: " + relativeFile);
checkFolder(file); checkFolder(file);
} }
else{
if($("input#software").val() != "" && $("input#software").val().match(/^[\w\d._-]+$/)){
$("#info").append("New Software in: " + relativeFile + $("input#software").val());
}
else{
$("#info").append("Selection: " + relativeFile);
}
}
return; return;
} }
......
...@@ -9,26 +9,26 @@ ...@@ -9,26 +9,26 @@
{% block body %} {% block body %}
<div id="repository"> <div id="repository">
<h2>Clone your repository into the workspace</h2> <h2>Clone your repository into the workspace</h2><br/>
<label for='name'>Project name: </label> <label for='name'>Project name*: </label>
<input type="text" name="name" id="name" size='20' value="Enter the project name..." /> <input type="text" name="name" id="name" size='20' value="Enter the project name..." />
<label for='repo'>url: &nbsp;&nbsp;&nbsp;</label> <label for='repo'>&nbsp;url: &nbsp;&nbsp;&nbsp;</label>
<input type="text" name="repo" id="repo" size='25' value="Enter the url of your repository..." /><br/> <input type="text" name="repo" id="repo" size='25' value="Enter the url of your repository..." /><br/>
<label for='user'>Your name: &nbsp;&nbsp;</label> <label for='user'>Your name: &nbsp;&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="user" id="user" size='20' value="Enter your name..." /> <input type="text" name="user" id="user" size='20' value="Enter your name..." />
<label for='email'>Email: </label> <label for='email'>Email: </label>
<input type="text" name="email" id="email" size='25' value="Enter your email adress..." /> <input type="text" name="email" id="email" size='25' value="Enter your email adress..." />
<input type="hidden" name="workdir" id="workdir" value="{{workDir}}" /> <input type="hidden" name="workdir" id="workdir" value="{{workDir}}" />
<button class="button" id="clone">clone</button> <button class="button" id="clone">clone</button>
<img class="waitting" id="imgwaitting" src="{{ url_for('static', filename='images/waiting.gif') }}" alt="" /> <img class="waitting" id="imgwaitting" src="{{ url_for('static', filename='images/waiting.gif') }}" alt="" />
<br/><br/> <br/><br/><br/>
</div> </div>
<h2>You can use this public key for Git SSH</h2> <h2>You can use this public key for Git SSH</h2>
<textarea class="public_key" readonly> <textarea class="public_key" readonly>
{{public_key}} {{public_key}}
</textarea> </textarea>
<p>to use git with https, please enter your repository url like this <p>to use git with https, please enter your repository url like this
<strong><i>https://your_login:your_passeword@your_repository_url</i></strong></p><br/> <strong><i>https://your_login:your_passeword@your_repository_url</i></strong></p><br/><br/>
<div id="file_navigation"> <div id="file_navigation">
<h2>Your project folder</h2> <h2>Your project folder</h2>
<div id="fileTree" class="file_tree"></div> <div id="fileTree" class="file_tree"></div>
......
{% extends "layout.html" %} {% extends "layout.html" %}
{% block title %}Log for {{ process }}{% endblock %}
{% block body %} {% block body %}
<h2>Displaying log for {{ process }}</h2><br/> <h2>Displaying log for {{ process }}</h2><br/>
<textarea cols=103 rows=40 readonly>{{ process_log }}</textarea> <textarea cols=103 rows=40 readonly>{{ process_log }}</textarea>
......
{% extends "layout.html" %} {% extends "layout.html" %}
{% block title %}Webrunner software content{% endblock %} {% block title %}Webrunner software Inspection{% endblock %}
{% block head %} {% block head %}
{{ super() }} {{ super() }}
<link href="{{ url_for('static', filename='css/jqueryFileTree.css', _external=False) }}" rel="stylesheet" type="text/css" media="screen" /> <link href="{{ url_for('static', filename='css/jqueryFileTree.css', _external=False) }}" rel="stylesheet" type="text/css" media="screen" />
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<script src="{{ url_for('static', filename='scripts/inspectSoftware.js') }}" type="text/javascript" charset="utf-8"></script> <script src="{{ url_for('static', filename='scripts/inspectSoftware.js') }}" type="text/javascript" charset="utf-8"></script>
{% endblock %} {% endblock %}
{% block body %} {% block body %}
<h2>All compiled software</h2> <h2>Inspect software</h2>
<input type="hidden" name="runnerdir" id="runnerdir" value="{{softwareRoot}}" /> <input type="hidden" name="runnerdir" id="runnerdir" value="{{softwareRoot}}" />
<label for='softwarelist'>Select software: </label> <label for='softwarelist'>Select software: </label>
<select name="softwarelist" id="softwarelist"> <select name="softwarelist" id="softwarelist">
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
&nbsp;&nbsp;<button id ="delete" class="button" title="Remove this software">Remove</button> &nbsp;&nbsp;<button id ="delete" class="button" title="Remove this software">Remove</button>
&nbsp;&nbsp;<button id ="open" class="button" title="Set this software as current software">Open</button> &nbsp;&nbsp;<button id ="open" class="button" title="Set this software as current software">Open</button>
<br/><br/> <br/><br/>
<p><strong><u>Notes:</u> </strong> You can open any software release in the list by cliking on the "Open" button. Now compiling this software will take a very short time</p>
<br/>
<h2 id="softcontent">No content to displays</h2> <h2 id="softcontent">No content to displays</h2>
<div id="fileTree" class="file_tree"></div> <div id="fileTree" class="file_tree"></div>
<div id="file_info" class="file_info"> <div id="file_info" class="file_info">
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment