Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelGauthier committed Dec 14, 2016
1 parent 3b84a19 commit 7fc59d3
Show file tree
Hide file tree
Showing 5 changed files with 291 additions and 49 deletions.
Expand Up @@ -231,8 +231,8 @@ object DisplayDirectiveTree extends Loggable {
val tooltipId = Helpers.nextFuncName
<span class="treeActions">
<span class="tooltipable treeAction noRight directiveDetails fa fa-pencil" tooltipid={tooltipId} title="" onclick={redirectToDirectiveLink(directive.id).toJsCmd}> </span>
<div class="tooltipContent" id={tooltipId}><div>Configure this Directive.</div></div>
</span>
<div class="tooltipContent" id={tooltipId}><div>Configure this Directive.</div></div>
</span>
} else {
NodeSeq.Empty
}
Expand Down Expand Up @@ -292,7 +292,7 @@ object DisplayDirectiveTree extends Loggable {
}
}

displayCategory(directiveLib, "jstn_0").toXml
displayCategory(directiveLib, "jstn_0").toXml ++ Script(OnLoad(JsRaw("angular.bootstrap('#showFiltersDirective', ['filters']);")))
}

}
56 changes: 56 additions & 0 deletions rudder-web/src/main/webapp/javascript/rudder/angular/filters.js
@@ -0,0 +1,56 @@
var app = angular.module('filters', []);

app.controller('filterTagCtrl', function ($scope, $http, $location, $timeout) {

$scope.showFilters = false;
$scope.only = {"key":false , "value":false};
$scope.newTag = {"key":"" , "value":""};
$scope.tags = [];

$scope.resetNewTag = function(){
$scope.newTag = {"key":"" , "value":""};
}

$scope.addTag = function(){
$scope.tags.push($scope.newTag);
$scope.resetNewTag();
$('.input-key').focus();
}

$scope.removeTag = function(index){
$scope.tags.splice(index, 1);
}

$scope.toggleFilter = function(event,tree){
$('#form-tag').toggleClass('in');
$($(event.currentTarget).find('span.pull-right')).toggleClass('in');
$(tree).toggleClass('filter-resize')
$scope.showFilters = !$scope.showFilters;
}

$scope.onlyKey = function(elem){
var button = $(elem.currentTarget);
button.toggleClass('active');
$scope.only.key = !$scope.only.key;
$scope.only.value = false;
}
$scope.onlyValue = function(elem){
var button = $(elem.currentTarget);
button.toggleClass('active');
$scope.only.value = !$scope.only.value;
$scope.only.key = false;
}
$scope.onlyAll = function(elem){
var button = $(elem.currentTarget);
button.addClass('active');
$scope.only.key = false;
$scope.only.value = false;
}
});

app.config(function($locationProvider) {
$locationProvider.html5Mode({
enabled: true,
requireBase: false
});
})
@@ -1,53 +1,46 @@

<lift:surround with="common-layout" at="content">

<head>
<title>Rudder - Directives Management</title>

<style type="text/css">

#versionTable thead tr {
border: 1px solid #666 !important;
padding: 0px;
list-style: none inside none;
font-weight: bold;
background-color: #666;
color: #FFF;
font-size: 13px;
}

#versionTable thead tr th {
padding: 3px;
text-align: center;
}

#versionTable tbody tr {
border: 1px solid #666 !important;
padding: 4px 3px;
margin: 0px;
padding: 0px;
list-style: none inside none;
font-size: 12px;
}

#versionTable tbody tr td {
text-align: center;
}

#editForm {
padding-bottom:70px;
}

</style>

<title>Rudder - Directives Management</title>
<style type="text/css">
#versionTable thead tr {
border: 1px solid #666 !important;
padding: 0px;
list-style: none inside none;
font-weight: bold;
background-color: #666;
color: #FFF;
font-size: 13px;
}
#versionTable thead tr th {
padding: 3px;
text-align: center;
}
#versionTable tbody tr {
border: 1px solid #666 !important;
padding: 4px 3px;
margin: 0px;
padding: 0px;
list-style: none inside none;
font-size: 12px;
}
#versionTable tbody tr td {
text-align: center;
}
#editForm {
padding-bottom:70px;
}
</style>
<link media="screen" href="/style/rudder/rudder-tags.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/javascript/rudder/angular/filters.js"></script>
</head>

<div data-lift="configuration.DirectiveManagement.head"></div>

<div class="tw-bs col-sm directiveTree">
<div class="page-title">Directive Library</div>
<div id="activeTechniquesTree_actions_zone" >
<div class="col-xs-12 tree">
<div id="activeTechniquesTree_actions_zone">
<div class="tree">
<div class="filter-tree">
<div class="input-group">
<div class="input-group-btn">
Expand All @@ -68,10 +61,58 @@
</div>
</div>
<div class="clearfix "></div>
<div id="showFiltersDirective" class="filters">
<div class="filters-container">
<div ng-controller="filterTagCtrl" ng-cloak>
<form class="filterTag">
<div class="panel-group" role="tablist" aria-multiselectable="true">
<div class="panel panel-default">
<div class="panel-heading" role="tab" id="headingOne">
<h4 class="panel-title">
<a role="button" href="#form-tag" ng-click="toggleFilter($event,'#activeTechniquesTree')" aria-expanded="true" aria-controls="form-tag">
Filter by tag
<i class="fa fa-question-circle" aria-hidden="true"></i>
<span class="glyphicon glyphicon-chevron-down pull-right"></span>
</a>
</h4>
</div>
<div id="form-tag" class="panel-collapse collapse" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div class="form-group">
<div class="input-group">
<input placeholder="key" class="form-control input-sm input-key " type="text" ng-model="newTag.key">
<span class="input-group-addon addon-json">=</span>
<input placeholder="value" class="form-control input-sm input-value" type="text" ng-model="newTag.value">
<span class="input-group-btn">
<button type="button" class="btn btn-success btn-sm" ng-click="addTag()"><span class="fa fa-plus"></span></button>
</span>
</div>
</div>
<div class="only-tags">
<a href="" ng-click="onlyAll($event) " class="all" ng-class="{'active':(!only.key && !only.value)}"> All </a>
<span class="separator">/</span>
<a href="" ng-click="onlyKey($event) " class="key" ng-class="{'active':only.key} "> Only keys </a>
<span class="separator">/</span>
<a href="" ng-click="onlyValue($event)" class="value" ng-class="{'active':only.value}"> Only values </a>
</div>
<div class="tags-container">
<span class="rudder-tag" ng-repeat="tag in tags" ng-class="{'onlyKey':only.key, 'onlyValue':only.value}">
<span class="tag-key">{{tag.key}}</span>
<span class="tag-separator">=</span>
<span class="tag-value">{{tag.value}}</span>
<span class="fa fa-times" ng-click="removeTag($index)"></span>
</span>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>

<div data-lift="configuration.DirectiveManagement.userLibrary" ></div>

</div>

<div class="col col-xl" id="directiveDetails">
Expand Down
7 changes: 4 additions & 3 deletions rudder-web/src/main/webapp/style/rudder/rudder-menu.css
Expand Up @@ -987,15 +987,16 @@ a.sidebar-toggle{
border-left: 15px solid #ECF0F5;
max-height:88vh;
}
#directiveDetails,.directiveTree{
#directiveDetails{
overflow-y:auto;
overflow-x:hidden;
padding-bottom: 20px;
}
.directiveTree {
padding-left: 10px;
padding-right: 10px;
max-height: calc(100vh - 70px);
padding: 0 10px;
overflow-y:auto;
overflow-x:hidden;
}
.ui-widget.ui-tooltip h4{
margin-bottom: 10px;
Expand Down
144 changes: 144 additions & 0 deletions rudder-web/src/main/webapp/style/rudder/rudder-tags.css
@@ -0,0 +1,144 @@
.tags-container{
position:relative;
float:left;
width:auto;
margin-right:-2px;
margin-left:-2px;
}
#activeTechniquesTree_actions_zone{
position:relative;
}
#activeTechniquesTree{
max-height: calc(100vh - 220px);
overflow-y: auto;
margin: 50px -10px 0 -10px;
width: auto;
padding: 0 25px 10px 25px;
transition-duration:.2s;
}
#activeTechniquesTree.filter-resize{
max-height: calc(100vh - 300px);
margin-top: 130px;
}
.filters{
margin: 0 -15px 5px -15px;
position: absolute;
z-index: 100;
width: calc(100% + 30px);
background-color: #fff;
padding: 0 15px;
border-bottom: 2px solid #ddd;
box-shadow: 0px 2px 10px 0px rgba(187, 187, 187, 0.62);
}
.filters-container{
float:left;
width:100%;
}
.filterTag .panel-default{
margin-top:10px;
box-shadow:none !important;
}
.filterTag .panel-group {
margin-bottom: 10px;
}
.filterTag .panel-default .panel-body {
padding: 10px 15px;
}
.filterTag .panel-default .panel-heading{
background-color:#f5f5f5;
border-color: #ddd;
margin:0;
padding:0;
}
.filterTag .panel-default .panel-heading a{
padding: 6px 15px;
display: block;
font-size:12px;
}
.filterTag .panel-default .panel-heading a > span.pull-right{
transition-duration:.2s;
transform:rotate(-90deg);
}
.filterTag .panel-default .panel-heading a > span.pull-right.in{
transform:rotate(0deg);
}
.filterTag .panel-default .panel-heading a > .fa{
font-size: 16px;
position: relative;
top: 1px;
margin-left: 5px;
color: #999;
cursor:help;
}
.filterTag .panel-default .panel-heading a > .fa:hover{
color: #555;
}
.form-control.tags-search{
width:150px;
display:inline-block;
float:right;
}
.input-group-addon.addon-json{
border-left: none;
border-right: none;
background: #f4f4f4;
font-weight: bold;
}
.rudder-tag{
background-color: #f4f4f4;
padding: 3px 24px 3px 10px;
border-radius: 20px;
border: 1px solid #ddd;
position: relative;
float: left;
margin: 0 2px 4px 2px;
cursor:default;
}
.rudder-tag .tag-separator{
padding: 3px;
font-size: 12px;
line-height: 0;
color: #333;
}
.rudder-tag .fa-times{
position: absolute;
right: 7px;
top: 6px;
opacity: 0.3;
cursor:pointer;
}
.rudder-tag:hover .fa-times{
opacity: 1;
}
.rudder-tag.simple{
padding: 3px 10px;
}
.rudder-tag.onlyKey .tag-key,.rudder-tag.onlyValue .tag-value{

}
.rudder-tag.onlyKey .tag-value,.rudder-tag.onlyValue .tag-key{
opacity:.5;
}
.only-tags a,.only-tags a:focus{
display:inline-block;
color: #999;
padding: 2px;
text-align:center;
font-size: 12px;
}
.only-tags a.all{
width:20px;
}
.only-tags a.key{
width:65px;
}
.only-tags a.value{
width:75px;
}
.only-tags a.active{
color: #555;
font-weight:bold;
}
.only-tags a:hover{
color: #333;
}

0 comments on commit 7fc59d3

Please sign in to comment.