forked from Normation/rudder
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b84a19
commit 7fc59d3
Showing
5 changed files
with
291 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
rudder-web/src/main/webapp/javascript/rudder/angular/filters.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
}); | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
144 changes: 144 additions & 0 deletions
144
rudder-web/src/main/webapp/style/rudder/rudder-tags.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |