Commit c760301b authored by Leigh Stoller's avatar Leigh Stoller

Add a button in the Classic Profiles list to convert to a Profile.

Also add a help modal with some information about conversions, needs
some more work.
parent 36442af2
......@@ -85,6 +85,7 @@ function ClassicExperimentList($which, $target, $state = "active")
$blob["idx"] = $idx;
$blob["pid"] = "<a href='show-project.php?project=$pid'>$pid</a>";
$blob["eid"] = "<a href='$url'>$eid</a>";
$blob["uuid"] = $experiment->uuid();
if (ISADMIN() || $which == "project") {
$blob["creator"] =
......
......@@ -2,7 +2,7 @@ $(function ()
{
'use strict';
var templates = APT_OPTIONS.fetchTemplateList(['show-project', 'experiment-list', 'profile-list', 'member-list', 'dataset-list', 'project-profile', 'classic-explist', 'group-list', 'waitwait-modal', 'oops-modal']);
var templates = APT_OPTIONS.fetchTemplateList(['show-project', 'experiment-list', 'profile-list', 'member-list', 'dataset-list', 'project-profile', 'classic-explist', 'group-list', 'waitwait-modal', 'oops-modal','conversion-help-modal']);
var mainString = templates['show-project'];
var experimentString = templates['experiment-list'];
var profileString = templates['profile-list'];
......@@ -13,7 +13,7 @@ $(function ()
var groupsString = templates['group-list'];
var waitString = templates['waitwait-modal'];
var oopsString = templates['oops-modal'];
var converterHelpTemplate = _.template(templates['conversion-help-modal']);
var mainTemplate = _.template(mainString);
function initialize()
......@@ -29,6 +29,7 @@ $(function ()
$('#main-body').html(html);
$('#waitwait_div').html(waitString);
$('#oops_div').html(oopsString);
$('#conversion_help_div').html(converterHelpTemplate({}));
// Javascript to enable link to tab
var hash = document.location.hash;
......
......@@ -2,7 +2,7 @@ $(function ()
{
'use strict';
var templates = APT_OPTIONS.fetchTemplateList(['user-dashboard', 'experiment-list', 'profile-list', 'project-list', 'dataset-list', 'user-profile', 'oops-modal', 'waitwait-modal', 'classic-explist']);
var templates = APT_OPTIONS.fetchTemplateList(['user-dashboard', 'experiment-list', 'profile-list', 'project-list', 'dataset-list', 'user-profile', 'oops-modal', 'waitwait-modal', 'classic-explist','conversion-help-modal']);
var mainString = templates['user-dashboard'];
var experimentString = templates['experiment-list'];
var profileListString = templates['profile-list'];
......@@ -12,7 +12,7 @@ $(function ()
var oopsString = templates['oops-modal'];
var waitwaitString = templates['waitwait-modal'];
var classicString = templates['classic-explist'];
var converterHelpTemplate = _.template(templates['conversion-help-modal']);
var mainTemplate = _.template(mainString);
function initialize()
......@@ -28,6 +28,7 @@ $(function ()
$('#main-body').html(html);
$('#oops_div').html(oopsString);
$('#waitwait_div').html(waitwaitString);
$('#conversion_help_div').html(converterHelpTemplate({}));
// Javascript to enable link to tab
var hash = document.location.hash;
......
......@@ -74,6 +74,6 @@ SPITREQUIRE("js/show-project.js",
"<script src='js/lib/sugar.min.js'></script>".
"<script src='js/lib/jquery.tablesorter.parser-date.js'></script>");
AddTemplateList(array("show-project", "experiment-list", "profile-list", "member-list", "dataset-list", "project-profile", "classic-explist", "group-list", "waitwait-modal", "oops-modal"));
AddTemplateList(array("show-project", "experiment-list", "profile-list", "member-list", "dataset-list", "project-profile", "classic-explist", "group-list", "waitwait-modal", "oops-modal", "conversion-help-modal"));
SPITFOOTER();
?>
......@@ -3,7 +3,14 @@
<table class='tablesorter'>
<thead>
<tr>
<th>Name</th>
<th>Name
<% if (asProfiles) { %>
<a href='#' class='btn btn-xs pull-right'
data-toggle='modal' data-target='#conversion-help-modal'>
<span class='glyphicon glyphicon-question-sign pull-right'></span>
</a>
<% } %>
</th>
<% if (showCreator) { %>
<th>Creator</th>
<% } %>
......@@ -25,7 +32,13 @@
<tbody>
<% _.each(experiments, function(value, name) { %>
<tr>
<td><%= value.eid %></td>
<td><%= value.eid %>
<% if (asProfiles) { %>
<a href='manage_profile.php?fromexp=<%- value.uuid %>'
<span class='glyphicon glyphicon-export pull-right'></span>
</a>
<% } %>
</td>
<% if (showCreator) { %>
<td><%= value.creator %></td>
<% } %>
......@@ -49,5 +62,3 @@
</table>
[1] <b>PHours</b>: Number of nodes times number of hours in use.<br>
</div>
<div id='conversion-help-modal' class='modal fade'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-header'>
<button type='button' class='close' data-dismiss='modal'
aria-hidden='true'>&times;</button>
<center><h4>Convert your Classic experiment to a Profile</h4></center>
</div>
<div class='modal-body'>
<p>
To ease the process of moving from NS file based
experiments, to profile based experiments, we have a simple
converter you can use that will auto generate geni-lib python
code from your NS file.
</p>
<p>
When you click on the convert button, you will be taken to
the Create Profile page, where we will generate the geni-lib
python code. You can then edit the geni-lib code, before
saving the new profile. More information about creating and
instantiating profiles can be found in the
<a href="<%- window.MANUAL %>">Manual</a>.
</p>
</div>
</div>
</div>
</div>
......@@ -146,3 +146,4 @@
</div>
<div id='waitwait_div'></div>
<div id='oops_div'></div>
<div id='conversion_help_div'></div>
......@@ -188,3 +188,4 @@
</div>
<div id='waitwait_div'></div>
<div id='oops_div'></div>
<div id='conversion_help_div'></div>
......@@ -79,6 +79,6 @@ SPITREQUIRE("js/user-dashboard.js",
"<script src='js/lib/sugar.min.js'></script>".
"<script src='js/lib/jquery.tablesorter.parser-date.js'></script>");
AddTemplateList(array("user-dashboard", "experiment-list", "profile-list", "project-list", "dataset-list", "user-profile", "oops-modal", "waitwait-modal", "classic-explist"));
AddTemplateList(array("user-dashboard", "experiment-list", "profile-list", "project-list", "dataset-list", "user-profile", "oops-modal", "waitwait-modal", "classic-explist", "conversion-help-modal"));
SPITFOOTER();
?>
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