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
//
// 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 )
// Usage: $('.tree').fileTree( options, callback )
//
// 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
// expandSpeed - default = 500 (ms); use -1 for no animation
// collapseSpeed - default = 500 (ms); use -1 for no animation
......@@ -19,16 +11,7 @@
// collapseEasing - easing function to use on collapse (optional)
// 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)
//
// 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.
// selectFolder - if true, also return path of folder when event happen on it
//
if(jQuery) (function($){
......@@ -37,7 +20,7 @@ if(jQuery) (function($){
// Defaults
if( !o ) var o = {};
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.expandSpeed == undefined ) o.expandSpeed= 500;
if( o.collapseSpeed == undefined ) o.collapseSpeed= 500;
......
......@@ -15,8 +15,10 @@ $(document).ready( function() {
}
$("#flash").fadeOut('normal');
$("#flash").empty();
$("#flash").fadeIn('normal');
repo_url = $("input#repo").val();
$("#flash").fadeIn('normal');
var repo_url = $("input#repo").val();
var email = "";
var name = ""
/* /^(ht|f)tps?:\/\/[a-z0-9-\.]+\.[a-z]{2,4}\/?([^\s<>\#%"\,\{\}\\|\\\^\[\]`]+)?$/ */
if($("input#repo").val() == "" || !repo_url.match(/^[\w\d\.\/:~@_-]+$/)){
$("#flash").append("<ul class='flashes'><li>Error: Invalid url for the repository</li></ul>");
......@@ -26,23 +28,27 @@ $(document).ready( function() {
$("#flash").append("<ul class='flashes'><li>Error: Invalid project name</li></ul>");
return false;
}
if($("input#user").val() == "" || $("input#user").val() == "Enter your name..."){
$("#flash").append("<ul class='flashes'><li>Error: Please enter your name!</li></ul>");
return false;
if($("input#user").val() != "" && $("input#user").val() != "Enter your name..."){
//$("#flash").append("<ul class='flashes'><li>Error: Please enter your name!</li></ul>");
//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})+$/)){
$("#flash").append("<ul class='flashes'><li>Error: Please enter your email adress!</li></ul>");
return false;
if($("input#email").val() != "" && $("input#email").val() != "Enter your email adress..."){
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;
}
email = $("input#email").val();
}
$("#imgwaitting").fadeIn('normal');
$("#clone").empty();
$("#clone").append("Stop");
send = true;
send = true;
cloneRequest = $.ajax({
type: "POST",
url: $SCRIPT_ROOT + '/cloneRepository',
data: "repo=" + repo_url + "&name=" + $("input#name").val() + "&email=" + $("input#email").val() +
"&user=" + $("input#user").val(),
data: "repo=" + repo_url + "&name=" + $("input#name").val() + "&email=" + email +
"&user=" + name,
success: function(data){
if(data.code == 1){
$("#file_navigation").fadeIn('normal');
......
......@@ -2,7 +2,7 @@ $(document).ready( function() {
var method = $("input#method").val();
var workdir = $("input#workdir").val();
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) {
selectFile(file);
});
......@@ -42,7 +42,7 @@ $(document).ready( function() {
$("#flash").empty();
$("#flash").fadeIn('normal');
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;
}
$.ajax({
......@@ -63,13 +63,21 @@ $(document).ready( function() {
function selectFile(file){
var relativeFile = file.replace(workdir, "");
$("#info").empty();
$("#info").append("Selection: " + relativeFile);
$("#info").empty();
$("input#subfolder").val(file);
path = "";
if(method == "open"){
$("#info").append("Selection: " + relativeFile);
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;
}
......
......@@ -9,26 +9,26 @@
{% block body %}
<div id="repository">
<h2>Clone your repository into the workspace</h2>
<label for='name'>Project name: </label>
<h2>Clone your repository into the workspace</h2><br/>
<label for='name'>Project name*: </label>
<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/>
<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..." />
<label for='email'>Email: </label>
<input type="text" name="email" id="email" size='25' value="Enter your email adress..." />
<input type="hidden" name="workdir" id="workdir" value="{{workDir}}" />
<button class="button" id="clone">clone</button>
<img class="waitting" id="imgwaitting" src="{{ url_for('static', filename='images/waiting.gif') }}" alt="" />
<br/><br/>
<br/><br/><br/>
</div>
<h2>You can use this public key for Git SSH</h2>
<textarea class="public_key" readonly>
{{public_key}}
</textarea>
<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">
<h2>Your project folder</h2>
<div id="fileTree" class="file_tree"></div>
......
{% extends "layout.html" %}
{% block title %}Log for {{ process }}{% endblock %}
{% block body %}
<h2>Displaying log for {{ process }}</h2><br/>
<textarea cols=103 rows=40 readonly>{{ process_log }}</textarea>
......
{% extends "layout.html" %}
{% block title %}Webrunner software content{% endblock %}
{% block title %}Webrunner software Inspection{% endblock %}
{% block head %}
{{ super() }}
<link href="{{ url_for('static', filename='css/jqueryFileTree.css', _external=False) }}" rel="stylesheet" type="text/css" media="screen" />
......@@ -7,7 +7,7 @@
<script src="{{ url_for('static', filename='scripts/inspectSoftware.js') }}" type="text/javascript" charset="utf-8"></script>
{% endblock %}
{% block body %}
<h2>All compiled software</h2>
<h2>Inspect software</h2>
<input type="hidden" name="runnerdir" id="runnerdir" value="{{softwareRoot}}" />
<label for='softwarelist'>Select software: </label>
<select name="softwarelist" id="softwarelist">
......@@ -18,6 +18,8 @@
&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>
<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>
<div id="fileTree" class="file_tree"></div>
<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