Commit 394b3fd2 authored by Leigh B Stoller's avatar Leigh B Stoller

Address part of issue #185; when using a geni-lib script, add a message

indicating that the description/instructions are set withing the script.
Also added a help modal with extra detail about doc string and format.
parent 5b5df261
...@@ -497,6 +497,7 @@ $(function () ...@@ -497,6 +497,7 @@ $(function ()
//$('#edit_copy_button').removeClass("hidden"); //$('#edit_copy_button').removeClass("hidden");
$('#profile_instructions').prop("readonly", true); $('#profile_instructions').prop("readonly", true);
$('#profile_description').prop("readonly", true); $('#profile_description').prop("readonly", true);
$('.geni-lib-warning').removeClass("hidden");
} }
} }
else { else {
......
...@@ -158,7 +158,8 @@ ...@@ -158,7 +158,8 @@
<a href='#' class='btn btn-xs' <a href='#' class='btn btn-xs'
data-toggle='popover' data-toggle='popover'
data-content='alphanumeric, dash, underscore, no whitespace'> data-content='alphanumeric, dash, underscore, no whitespace'>
<span class='glyphicon glyphicon-question-sign'></span> <span style='margin-bottom: 4px;'
class='glyphicon glyphicon-question-sign'></span>
</a> </a>
</label> </label>
<div class='col-sm-3'> <div class='col-sm-3'>
...@@ -262,31 +263,52 @@ ...@@ -262,31 +263,52 @@
type='textarea' type='textarea'
data-key='profile_script' data-key='profile_script'
rows=5><%- formfields.profile_script %></textarea> rows=5><%- formfields.profile_script %></textarea>
</fieldset>
<fieldset>
<div class="form-group"> <div class="form-group">
<textarea name=formfields[profile_description] <div class="format-me"
id='profile_description' data-key='profile_description'
rows=3 data-label='Description'
class='form-control format-me' data-help='Briefly describe what this profile
type='textarea' does. Use <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target=_blank>Markdown format</a>, double click
data-key='profile_description' to see a rendering.'>
data-label='Description' <textarea name=formfields[profile_description]
data-help='Briefly describe what this profile id='profile_description'
does. Use <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target=_blank>Markdown format</a>, double click rows=3
to see a rendering.' class='form-control'
><%- formfields.profile_description %></textarea> type='textarea'></textarea>
<div class="geni-lib-warning hidden"><small class="pull-right">
Description set by geni-lib script
<a href='#' class='btn btn-xs'
data-toggle='modal'
data-target="#docstring-help-modal">
<span style='margin-bottom: 4px; margin-left: 0px;'
class='glyphicon glyphicon-question-sign'></span></a>
</small></div>
</div>
</div> </div>
<div class="form-group"> <div class="form-group">
<div class='format-me'
data-key='profile_instructions'
data-label='Instructions'
data-help='Briefly describe how to use this
profile after it starts.
Use <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target=_blank>Markdown format</a>, double click
to see a rendering.'>
<textarea name=formfields[profile_instructions] <textarea name=formfields[profile_instructions]
id='profile_instructions' id='profile_instructions'
rows=3 class='form-control'
class='form-control format-me' rows=3
data-key='profile_instructions' type='textarea'></textarea>
data-label='Instructions' <div class="geni-lib-warning hidden"><small class="pull-right">
data-help='Briefly describe how to use this Instructions set by geni-lib script
profile after it starts. <a href='#' class='btn btn-xs'
Use <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target=_blank>Markdown format</a>, double click data-toggle='modal'
to see a rendering.' data-target="#docstring-help-modal">
type='textarea'></textarea> <span style='margin-bottom: 4px; margin-left: 0px;'
class='glyphicon glyphicon-question-sign'></span></a>
</small></div>
</div>
</div> </div>
<!-- Tour Table; hidden until the table is initialized <!-- Tour Table; hidden until the table is initialized
...@@ -595,6 +617,38 @@ ...@@ -595,6 +617,38 @@
</div> </div>
</div> </div>
</div> </div>
<!-- Docstring help -->
<div id='docstring-help-modal' class='modal fade'
data-keyboard='false' data-backdrop='static'>
<div class='modal-dialog'>
<div class='modal-content'>
<div class='modal-body'>
<p>
When using a geni-lib python script, you set the profile
description and instructions <b>within</b> the script source using
a <a href="https://en.wikipedia.org/wiki/Docstring">
python module docstring</a>, typically at the very beginning of
the script. For example:
</p>
<pre>
"""This is a description of your profile, it can be multi-line.
Every profile must include a description.
Instructions:
These are instructions for using your profile after it is instantiated.
Instructions are optional.
""" </pre>
<br>
<center>
<button type='button'
class='btn btn-default btn-sm'
data-dismiss='modal'>
Close</button>
</center>
</div>
</div>
</div>
</div>
<!-- Warn parameterized profile --> <!-- Warn parameterized profile -->
<div id='warn_pp_modal' class='modal fade'> <div id='warn_pp_modal' class='modal fade'>
<div class='modal-dialog'> <div class='modal-dialog'>
......
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