Skip to content

Commit

Permalink
Fixes #23826: Reorganize the header of the node page (Normation#5241)
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelGauthier committed Dec 14, 2023
1 parent 302b515 commit af845fa
Show file tree
Hide file tree
Showing 13 changed files with 692 additions and 682 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,24 +95,6 @@ function refuseEnter(event)
}
}

/* portlet */

$(function() {

$(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix arrondis")
.find(".portlet-header")
.addClass("ui-widget-header")
.end()
.find(".portlet-content");

$(".portlet-header .ui-icon").click(function() {
$(this).toggleClass("ui-icon-minusthick").toggleClass("ui-icon-plusthick");
$(this).parents(".portlet:first").find(".portlet-content").toggle();
});

});


/**
* Check all checkbox named name according to the status of the checkbox with id id
* @param id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import com.normation.rudder.web.ChooseTemplate
import com.normation.rudder.web.model.JsNodeId
import com.normation.rudder.web.services.CurrentUser
import com.normation.rudder.web.services.DisplayNode
import com.normation.rudder.web.services.DisplayNode.showDeleteButton
import com.normation.rudder.web.services.DisplayNodeGroupTree
import net.liftweb.common._
import net.liftweb.http.DispatchSnippet
Expand Down Expand Up @@ -210,12 +211,12 @@ class ShowNodeDetailsFromNode(
val jsId = JsNodeId(nodeId, "")
def htmlId(jsId: JsNodeId, prefix: String): String = prefix + jsId.toString
val detailsId = htmlId(jsId, "details_")

configService.rudder_global_policy_mode().toBox match {
case Full(globalMode) =>
bindNode(node, nf.toFullInventory, withinPopup, globalMode) ++ Script(
DisplayNode.jsInit(node.id, "") &
JsRaw(s"""
$$('#nodeHostname').html("${xml.Utility.escape(nf.fqdn)}");
$$( "#${detailsId}" ).tabs({ active : ${tab} } );
$$('#nodeInventory .ui-tabs-vertical .ui-tabs-nav li a').on('click',function(){
var tab = $$(this).attr('href');
Expand Down Expand Up @@ -248,9 +249,12 @@ class ShowNodeDetailsFromNode(
* Show the content of a node in the portlet
* @return
*/

private def bindNode(node: NodeInfo, inventory: FullInventory, withinPopup: Boolean, globalMode: GlobalPolicyMode): NodeSeq = {
val id = JsNodeId(node.id)
("#node_groupTree" #>
("#nodeHeader" #> DisplayNode.showNodeHeader(inventory, Some(node)) &
"#confirmNodeDeletion" #> showDeleteButton(inventory.node.main) &
"#node_groupTree" #>
<div id={groupTreeId}>
<ul>{DisplayNodeGroupTree.buildTreeKeepingGroupWithNode(groupLib, node, None, None, Map(("info", _ => Noop)))}</ul>
</div> &
Expand Down
Loading

0 comments on commit af845fa

Please sign in to comment.