From f2f751e092674a0e49d664e8c0cac5f494d93306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Gauthier?= Date: Fri, 27 Jan 2017 12:15:41 +0100 Subject: [PATCH] Work in progress --- .../web/components/DirectiveEditForm.scala | 2 +- .../rudder/web/components/RuleDisplayer.scala | 4 +- .../configuration/DirectiveManagement.scala | 10 +- .../javascript/rudder/angular/filters.js | 14 +- .../webapp/javascript/rudder/directive.js | 2 + .../main/webapp/javascript/rudder/rudder.js | 23 +- .../directiveManagement.html | 296 +++++++------- .../configurationManager/ruleManagement.html | 3 - .../main/webapp/style/rudder/rudder-menu.css | 89 +++- .../main/webapp/style/rudder/rudder-tags.css | 6 +- .../src/main/webapp/style/rudder/rudder.css | 6 - .../ComponentDirectiveEditForm.html | 385 +++++++++--------- .../components/ComponentRuleEditForm.html | 3 - .../components/ComponentTags.html | 2 +- 14 files changed, 449 insertions(+), 396 deletions(-) diff --git a/rudder-web/src/main/scala/com/normation/rudder/web/components/DirectiveEditForm.scala b/rudder-web/src/main/scala/com/normation/rudder/web/components/DirectiveEditForm.scala index 756499b17da..55e68891b4a 100644 --- a/rudder-web/src/main/scala/com/normation/rudder/web/components/DirectiveEditForm.scala +++ b/rudder-web/src/main/scala/com/normation/rudder/web/components/DirectiveEditForm.scala @@ -303,12 +303,12 @@ class DirectiveEditForm( processKey(event , '${htmlId_save}'); } ); checkMigrationButton("${currentVersion}","${versionSelectId}"); - $$('#${versionSelect.uniqueFieldId.getOrElse("id_not_found")}').change( function () { checkMigrationButton("${currentVersion}","${versionSelectId}") } ); + adjustHeight("#edit-box","#directiveToolbar") """) ) diff --git a/rudder-web/src/main/scala/com/normation/rudder/web/components/RuleDisplayer.scala b/rudder-web/src/main/scala/com/normation/rudder/web/components/RuleDisplayer.scala index 392fca39b2a..31e9904c0df 100644 --- a/rudder-web/src/main/scala/com/normation/rudder/web/components/RuleDisplayer.scala +++ b/rudder-web/src/main/scala/com/normation/rudder/web/components/RuleDisplayer.scala @@ -295,7 +295,7 @@ class RuleDisplayer ( -
+
{viewCategories(ruleCategoryTree)} @@ -414,6 +414,6 @@ class RuleDisplayer (
} SetHtml(htmlId_popup, popupHtml) & - JsRaw( s""" createPopup("${htmlId_popup}") """) + JsRaw( s"""createPopup("${htmlId_popup}");""") } } \ No newline at end of file diff --git a/rudder-web/src/main/scala/com/normation/rudder/web/snippet/configuration/DirectiveManagement.scala b/rudder-web/src/main/scala/com/normation/rudder/web/snippet/configuration/DirectiveManagement.scala index b2ceca386d4..83e2022ffb0 100644 --- a/rudder-web/src/main/scala/com/normation/rudder/web/snippet/configuration/DirectiveManagement.scala +++ b/rudder-web/src/main/scala/com/normation/rudder/web/snippet/configuration/DirectiveManagement.scala @@ -236,9 +236,8 @@ class DirectiveManagement extends DispatchSnippet with Loggable { def initTechniqueDetails(workflowEnabled: Boolean) : MemoizeTransform = SHtml.memoize { "#techniqueDetails *" #> ( currentTechnique match { case None => - ".page-title *" #> "Usage" & + "#info-title *" #> "Usage" & "#details *" #> { -
@@ -265,7 +264,6 @@ class DirectiveManagement extends DispatchSnippet with Loggable {

-
} case Some((fullActiveTechnique,version)) => @@ -316,15 +314,15 @@ class DirectiveManagement extends DispatchSnippet with Loggable { { if(comp.os.isEmpty) { NodeSeq.Empty } else { -

Supported operating systems: {comp.os.mkString(", ")}

+
  • Supported operating systems: {comp.os.mkString(", ")}
  • } } ++ { if (comp.agents.isEmpty) { NodeSeq.Empty } else { -

    Supported agents: {comp.agents.mkString(", ")}

    +
  • Supported agents: {comp.agents.mkString(", ")}
  • } } } & - "#techniqueDescription" #> technique.description & + "#techniqueDescription *" #> technique.description & "#techniqueLongDescription" #> technique.longDescription & "#isSingle *" #> showIsSingle(technique) & "#techniqueVersion *+" #> showVersions(fullActiveTechnique, validTechniqueVersions, workflowEnabled) diff --git a/rudder-web/src/main/webapp/javascript/rudder/angular/filters.js b/rudder-web/src/main/webapp/javascript/rudder/angular/filters.js index 93cfac441ea..22638844580 100644 --- a/rudder-web/src/main/webapp/javascript/rudder/angular/filters.js +++ b/rudder-web/src/main/webapp/javascript/rudder/angular/filters.js @@ -374,16 +374,4 @@ app.config(function($locationProvider) { enabled: true, requireBase: false }); -}) - -// Adjust tree height -function adjustHeight(treeId){ - var tree = $(treeId); - var treeOffset = tree.offset() - if(treeOffset){ - var offsetTop = treeOffset.top + 10; - var maxHeight = 'calc(100vh - '+ offsetTop + 'px)'; - tree.css('max-height',maxHeight); - } -} - +}); \ No newline at end of file diff --git a/rudder-web/src/main/webapp/javascript/rudder/directive.js b/rudder-web/src/main/webapp/javascript/rudder/directive.js index 294fd772668..ee25783fa39 100644 --- a/rudder-web/src/main/webapp/javascript/rudder/directive.js +++ b/rudder-web/src/main/webapp/javascript/rudder/directive.js @@ -37,8 +37,10 @@ $(document).ready(function(){ var treeId = '#activeTechniquesTree'; + var formId = '#edit-box'; $(window).on('resize',function(){ adjustHeight(treeId); + adjustHeight(formId,"#directiveToolbar"); }); $(treeId).on("searchtag.jstree",function(e, data){ data.res.length>0 ? $('#activeTechniquesTree_alert').hide() : $('#activeTechniquesTree_alert').show(); diff --git a/rudder-web/src/main/webapp/javascript/rudder/rudder.js b/rudder-web/src/main/webapp/javascript/rudder/rudder.js index 7e0f1eb30b7..66da895937d 100644 --- a/rudder-web/src/main/webapp/javascript/rudder/rudder.js +++ b/rudder-web/src/main/webapp/javascript/rudder/rudder.js @@ -650,10 +650,23 @@ function hideFileManager(){ } //Adjust tree height -function adjustHeight(treeId, height){ +function adjustHeight(treeId, toolbar){ var tree = $(treeId); - var offsetTop = tree.offset().top + 12; - var maxHeight = 'calc(100vh - '+ offsetTop + 'px)'; - var cssProp = height ? 'height' : 'max-height' - tree.css(cssProp,maxHeight); + var maxHeight; + if(window.innerWidth>=992){ + var treeOffset = tree.offset(); + if(treeOffset){ + var toolbarHeight; + if(toolbar && $(toolbar).offset()){ + toolbarHeight = parseFloat($(toolbar).css('height')); + }else{ + toolbarHeight = 0; + } + var offsetTop = treeOffset.top + 15 + toolbarHeight; + maxHeight = 'calc(100vh - '+ offsetTop + 'px)'; + } + }else{ + maxHeight = "none"; + } + tree.css('max-height',maxHeight); } \ No newline at end of file diff --git a/rudder-web/src/main/webapp/secure/configurationManager/directiveManagement.html b/rudder-web/src/main/webapp/secure/configurationManager/directiveManagement.html index 61d5f10f0ec..d9108e471d5 100644 --- a/rudder-web/src/main/webapp/secure/configurationManager/directiveManagement.html +++ b/rudder-web/src/main/webapp/secure/configurationManager/directiveManagement.html @@ -27,12 +27,8 @@ #versionTable tbody tr td { text-align: center; } - .rudder-col,body{ - overflow:hidden; - } - @@ -40,51 +36,46 @@
    -
    -
    Directive Library - - Edit Techniques -
    -
    -
    -
    -
    -
    - -
    - -
    - +
    +
    +
    +
    +
    +

    Filters

    +
    +
    -
    -
    -
    -
    -
    -
    -
    -
    - - -
    -
    -
    -
    - -
    -
    -
    Technique information
    -
    -
    - The Directive [Directive] is based on following Technique: -
    -
    -

    [Technique name]

    -
    -
    -
    - Description - [technique.description] -
    -
    -
    - Characteristics -

    [technique.longDescription]

    -

    [Unique Technique]

    -

    [Supported operating systems : debian-5]

    -
    -
    -
    - Available versions - - - - - - - - - - - - - - - - - - - -
    VersionLast updated onUse this version
    {{technique.version}} - -
    -
    Deprecated: {{technique.deprecationMessage}}
    +
    +
    +
    +
    +
    +

    Technique ''

    +
    +
    +
    +
    + The Directive [Directive] is based on following Technique: +
    +
    +

    Description

    + [technique.description] +
    +
    +

    Characteristics

    +
      +
    • [technique.longDescription]
    • +
    • [Unique Technique]

      +
    • [Supported operating systems : debian-5]
    • +
    +
    +
    +

    Available versions

    + + + + + + + + + + + + + + + + + + + +
    VersionLast updated onUse this version
    {{technique.version}} + +
    +
    Deprecated: {{technique.deprecationMessage}}
    +
    +
    {{technique.acceptationDate}}
    +
    + +
    -
    {{technique.acceptationDate}}
    - -
    - - - - - -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    - - This div gets the content of the createDirective injected within - -
    + +
    + +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    + + This div gets the content of the createDirective injected within + +
    -
    - + diff --git a/rudder-web/src/main/webapp/secure/configurationManager/ruleManagement.html b/rudder-web/src/main/webapp/secure/configurationManager/ruleManagement.html index 8eb88559286..fc987835251 100644 --- a/rudder-web/src/main/webapp/secure/configurationManager/ruleManagement.html +++ b/rudder-web/src/main/webapp/secure/configurationManager/ruleManagement.html @@ -22,10 +22,7 @@
    - -
    - diff --git a/rudder-web/src/main/webapp/style/rudder/rudder-menu.css b/rudder-web/src/main/webapp/style/rudder/rudder-menu.css index 76a9c3d4826..84a87249d84 100644 --- a/rudder-web/src/main/webapp/style/rudder/rudder-menu.css +++ b/rudder-web/src/main/webapp/style/rudder/rudder-menu.css @@ -338,7 +338,7 @@ div.topQuickSearchResults.ac_results li { .skin-yellow.sidebar-collapse div.topQuickSearchResults.ac_results,.skin-yellow div.topQuickSearchResults.ac_results, .skin-yellow.sidebar-open div.topQuickSearchResults.ac_results { width: 120px !important; } -} +}
    .tw-bs #searchInput::-webkit-input-placeholder { color: #964; -webkit-transition-duration:.3s; @@ -870,7 +870,11 @@ a.sidebar-toggle{ position:relative; opacity:1; } -/* RULE PAGE */ +/* RULES PAGE */ +#boxTreeRules{ + overflow-y: auto; + overflow-x: hidden; +} i#changeIconRule { min-width: 25px; } @@ -1044,6 +1048,46 @@ table.tablewidth{ } /* --- DIRECTIVE PAGE --- */ +#details{ + background-color: #fff; + padding-left:0; + padding-right:0; +} +#details .callout-fade{ + margin-top:15px; +} +#details .box-body div{ + color:#555; +} +#details .box-body h4{ + color:#333; + margin-bottom: 4px; + border-bottom: 1px solid #eaeaea; + padding-bottom: 7px; +} +#details .box-body ul{ + margin-left: 10px; + padding-left: 10px; + list-style-type: disc; +} +#details .box-body ul>li{ + list-style-type: disc; +} +#versionTable + .checkbox-group{ + margin-top:4px; +} +#versionTable + .checkbox-group input{ + margin: 0px 2px 0px 0px; + position:relative; + top:2px; +} +#versionTable + .checkbox-group input + label{ + font-weight:normal; + font-size:13px; +} +#directiveToolbar{ + border-top-color:#e2e2e2; +} .editTech{ margin-top:4px; } @@ -1057,14 +1101,6 @@ table.tablewidth{ #technicalDetails > .directiveTechnicalInfo:first-child{ margin-top:0; } -#directiveDetails{ - border-left: 15px solid #ECF0F5; - max-height:88vh; -} -#directiveDetails{ - overflow-y:auto; - overflow-x:hidden; -} .directiveTree { padding-left: 10px; padding-right: 10px; @@ -1108,6 +1144,20 @@ table.tablewidth{ #directiveRulesTab .only-tags .btn-xs.pull-right{ float:left !important; } +#edit-box{ + padding:10px; + overflow-y:auto; + overflow-x:hidden; +} +#editForm{ + padding:0; +} + +@media (min-width: 992px){ + #boxDirectiveTree,#editForm{ + margin-bottom:0; + } +} .tw-bs .filters-container .input-group{ width: 100%; } @@ -1161,8 +1211,9 @@ table.tablewidth{ .directiveDeleteGroup .btn-danger{ padding-right:28px; } -.fixed-footer.directive-footer .btn,.fixed-footer.rule-footer .btn{ - min-width:80px; +#directiveToolbar .btn,.fixed-footer.rule-footer .btn{ + width:auto; + min-width:80px; } #priority select.form-control,#version select.form-control{ width: 70px; @@ -2286,6 +2337,9 @@ ul > li.rudder-form > .input-group.disabled *{ margin-bottom: 14px; border-top-width:2px; } +h3.box-title { + padding:0; +} .nav-tabs-custom>.nav-tabs, .box-header.with-border,.nav-tabs-custom>.nav-tabs>li.active>a{ border-color: #e2e2e2 !important; } @@ -2325,6 +2379,10 @@ ul > li.rudder-form > .input-group.disabled *{ top:-2px; max-height: 21px; } +.box-tools > .btn.tech{ + position: relative; + top: -2px; +} .box-tools > .btn-sm.btn-box-tool > .fa { font-size: 14px; } @@ -2371,6 +2429,13 @@ ul > li.rudder-form > .input-group.disabled *{ margin-left: 7px; top: 1px; } + +/* JUMBOTRON */ +.rudder-jumbotron > .jumbotron{ + background-color:transparent; + padding:60px; +} + @keyframes opacity-1 { 0% {opacity:0;visibility: visible;} 100% {opacity:1;visibility: visible;} diff --git a/rudder-web/src/main/webapp/style/rudder/rudder-tags.css b/rudder-web/src/main/webapp/style/rudder/rudder-tags.css index 0c5e0e2ef56..98716c7eecd 100644 --- a/rudder-web/src/main/webapp/style/rudder/rudder-tags.css +++ b/rudder-web/src/main/webapp/style/rudder/rudder-tags.css @@ -64,11 +64,14 @@ padding: 0 10px 4px 10px; border-top:none; } +.tags-container.noTags{ + margin-bottom:0; +} #activeTechniquesTree{ overflow-y: auto; overflow-x: hidden; margin: 0 -10px; - padding: 0 15px; + padding: 0 30px 0 15px; width: calc(100% + 20px); } .filterTag .panel-default{ @@ -336,6 +339,7 @@ } #activeTechniquesTree_alert .alert{ margin-bottom:10px; + margin-top: 10px; } #activeTechniquesTree_alert .alert > i{ margin-right: 10px; diff --git a/rudder-web/src/main/webapp/style/rudder/rudder.css b/rudder-web/src/main/webapp/style/rudder/rudder.css index a0db14df600..c4d2f30d315 100644 --- a/rudder-web/src/main/webapp/style/rudder/rudder.css +++ b/rudder-web/src/main/webapp/style/rudder/rudder.css @@ -2398,12 +2398,6 @@ li.excluded a{ .deprecatedTechniqueIcon { margin-left : 3px; } - -#displayDeprecation { - margin-right:5px; - margin-top : 2px; -} - table.directiveGroupDef, table.directiveVarDef, table.directiveSectionDef { width:100%; padding-left: 15px; diff --git a/rudder-web/src/main/webapp/templates-hidden/components/ComponentDirectiveEditForm.html b/rudder-web/src/main/webapp/templates-hidden/components/ComponentDirectiveEditForm.html index a3efd1fea8c..66dffdca7de 100644 --- a/rudder-web/src/main/webapp/templates-hidden/components/ComponentDirectiveEditForm.html +++ b/rudder-web/src/main/webapp/templates-hidden/components/ComponentDirectiveEditForm.html @@ -1,7 +1,6 @@ - + - @@ -12,7 +11,6 @@
    Col1Col2Col3
    Col1Col2Col3
    -
    @@ -22,225 +20,216 @@ -
    - - - - - - -
    Directive
    - -
    - + + + + + + +
    +
    +

    Directive

    - - -
    -
    Pending change requests
    -
    -
    - Warning! -
    - The following pending change requests affect this Directive, you should check that your modification is not already pending: -
      +
      + -
      -
      - - -
      -
      Directive information
      -
      -
      -
      - Here comes the name field -
      -
      - Here comes the tag field -
      -
      - Here comes the shortDescription field -
      -
      - Here comes the longDescription field -
      -
      - Here come the priority field -
      -
      - Here come the policy mode field -
      -
      - Here come the version field -
      -
      - Here come the migrate field -
      -
      -