Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ust 2950/dev 3320/directive help tooltip #134

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class DirectiveEditForm(
JsRaw("""activateButtonOnFormChange("%s", "%s"); """
.format(htmlId_policyConf, htmlId_save)) &
JsRaw("""
correctButtons();
correctButtons();createTooltip();
""") &
JsVar("""
$("input").not("#treeSearch").keydown( function(event) {
Expand Down Expand Up @@ -395,7 +395,7 @@ class DirectiveEditForm(
}

def initJs : JsCmd = {
JsRaw("correctButtons();")
JsRaw("correctButtons(); createTooltip();")
}

///////////// Remove /////////////
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,14 @@ trait DirectiveField extends BaseField with SectionChildField {
<td class="directiveVarValue">{ form }</td>
</tr>
case Full(form) =>
<tr>
val tooltipid = Helpers.nextFuncName
<tr class = "tooltipable" title="" tooltipid={tooltipid}>
<td class="directiveVarLabel">
{ displayName + { if (optional) " (optional)" else "" } }:
<div class="tooltipContent" id={tooltipid}>{tooltip}</div>
{ displayName + { if (optional) " (optional)" else "" } }:
</td>
<td class="directiveVarValue">{ form }</td>
</tr>
<tr class="tooltip">
<td colspan="2" style="text-align:center">
{tooltip}
</td>
</tr>
}
}

Expand All @@ -190,17 +187,14 @@ trait DirectiveField extends BaseField with SectionChildField {
<td class="directiveVarValue">{ displayValue }</td>
</tr>
} else {
<tr>
val tooltipid = Helpers.nextFuncName
<tr class = "tooltipable" title="" tooltipid={tooltipid}>
<td class="directiveVarLabel">
<div class="tooltipContent" id={tooltipid}>{tooltip}</div>
{ displayName + { if (optional) " (optional)" else "" } }
</td>
<td class="directiveVarValue">{ displayValue }</td>
</tr>
<tr class="tooltip">
<td colspan="2" style="text-align:center">
{tooltip}
</td>
</tr>
}
}

Expand Down Expand Up @@ -252,12 +246,12 @@ case class SectionFieldImp(
if(childrenXml.isEmpty) NodeSeq.Empty
else
<tr><td colspan="2">
<fieldset class="sectionFieldset">
<legend>Section: { name }</legend>
<div class="sectionFieldset">
<div class="inner-portlet-header-lower">Section: { name }</div>
<table class="directiveSectionDef">
{ childrenXml }
</table>
</fieldset>
</div>
</td></tr>
}

Expand All @@ -266,14 +260,14 @@ case class SectionFieldImp(
if(childrenXml.isEmpty) NodeSeq.Empty
else
<tr><td colspan="2">
<fieldset>
<legend>Section: { name }</legend>
<div>
<div class="inner-portlet-header-lower">Section: { name }</div>
<table class="directiveSectionDisplay">
<tbody>
{ childrenXml }
</tbody>
</table>
</fieldset>
</div>
</td></tr>
}
}
Expand Down Expand Up @@ -381,8 +375,8 @@ case class MultivaluedSectionField(
<div class="directiveGroup">{
(allSections.zipWithIndex.map {
case (section, i) =>
<fieldset class="groupFieldset">
<legend>{ "%s #%s".format(name, i + 1) }</legend>
<div class="groupFieldset">
<div class="inner-portlet-header-lower">{ "%s #%s".format(name, i + 1) }</div>
{ showFormEntry(section, i) }
{ // showAddAnother under the last element
if ((i + 1) == size) {
Expand All @@ -391,7 +385,7 @@ case class MultivaluedSectionField(
NodeSeq.Empty
}
}
</fieldset>
</div>
})
}</div>
</td> ++ Script(OnLoad(JsVar("""
Expand Down Expand Up @@ -432,14 +426,14 @@ case class MultivaluedSectionField(
<tr><td colspan="2">
<div class="directiveGroup">{
(allSections.map { sect =>
<fieldset class="groupFieldset">
<legend>{ "%s".format(name) }</legend>
<div class="groupFieldset">
<div class="inner-portlet-header-lower">{ "%s".format(name) }</div>
<table class="directiveGroupDisplay">
<tbody>
{ sect.toHtmlNodeSeq }
</tbody>
</table>
</fieldset>
</div>
})
}</div>
</td></tr>
Expand Down
6 changes: 5 additions & 1 deletion rudder-web/src/main/webapp/javascript/rudder/rudder.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,14 @@ function createTooltip() {
$(".tooltipable").tooltip({
show: {
effect: "none",
delay: 100
delay: 100,
},
content: function() {
return $("#"+$(this).attr("tooltipid")).html();
},
position: { my: "left top+15",
at: "right top",
collision: "flipfit"
}
});
}
Expand Down
15 changes: 15 additions & 0 deletions rudder-web/src/main/webapp/style/rudder.css
Original file line number Diff line number Diff line change
Expand Up @@ -1551,6 +1551,15 @@ p img {
padding: 5px 0 2px 5px;
}

.inner-portlet-header-lower {
padding: 5px 0 5px 5px;
font-size: 1.3em;
cursor: default;
background: none;
border-bottom: 1px solid #F79D10;
padding: 5px 0 2px 5px;
}

.inner-portlet-content {
padding: 5px 0 2px 5px;
}
Expand Down Expand Up @@ -1874,6 +1883,12 @@ popin Alert
padding-top: 0px;
}

.tooltipable > .directiveVarValue {
background-image: url("../images/icInfo.png");
background-repeat: no-repeat;
background-position: center right;
padding-right: 18px;
}

#tooltip {
position: absolute;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@
<component:form>
<div id="editForm" class="object-details">
<lift:authz role="directive_edit">
<fieldset class="topLevelAction">
<div class="topLevelAction">
<p class="clearable">
This is the zone for top level actions which does not take into account
modifications done in the edit zone.
</p>

<legend>Actions</legend>
<div class="inner-portlet-header">Actions</div>

<div id="removeAction" class="twoColumns">
</div>
Expand All @@ -104,10 +104,10 @@
Note: A Directive's status may be Enabled, but it will be effectively disabled
if the Technique it's based on is disabled.
</div>
</fieldset>
</div>
</lift:authz>
<fieldset class="editZone">
<legend>Directive settings</legend>
<div class="editZone">
<div class="inner-portlet-header">Directive settings</div>

<div id="notifications">
<!-- <ul> -->
Expand All @@ -118,7 +118,7 @@

<p>This Directive is based on the <b><span id="techniqueName"/></b> Technique.</p>
<p id="isSingle">Unique Technique</p>
<fieldset><legend>Description of the Technique</legend><span id="techniqueDescription"/></fieldset>
<div><div class="inner-portlet-header">Description of the Technique</div><span id="techniqueDescription"/></div>
<br/>
<div id="nameField">
Here comes the name field
Expand Down Expand Up @@ -148,12 +148,12 @@
</div>

<hr class="spacer" />
<fieldset><legend>Parameters</legend>
<div><div class="inner-portlet-header">Parameters</div>
<span id="parameters">Here goes the list of parameters</span>
</fieldset>
</div>
<lift:authz role="directive_edit">
<fieldset class="reasonsFieldset">
<legend>Change Message</legend>
<div class="reasonsFieldset">
<div class="inner-portlet-header">Change Message</div>

<div id="explanationMessage">
Here comes the explanation to reasons field
Expand All @@ -162,15 +162,15 @@
<div id="reasonsField">
Here comes the reasons field
</div>
</fieldset>
</div>

<div class="cpiefsave">
<button id="save">Save</button>
</div>


</lift:authz>
</fieldset>
</div>
</div>

<div id="createCloneDirectivePopup" class="nodisplay">
Expand Down