Skip to content

Commit

Permalink
flex box and non radio button version
Browse files Browse the repository at this point in the history
  • Loading branch information
argvader committed Oct 24, 2014
1 parent 6e53bda commit 25cc8a7
Show file tree
Hide file tree
Showing 15 changed files with 644 additions and 170 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# Changelog
All notable changes to this project will be documented in this file.

0.2.5 - 2014-10-21
LATEST
------------------
### Fixed
- Ability to actually run an image from a private registry (#404)
- Service health error bubbling supressed (#403)

### Added
- tab based service management view


0.2.5 - 2014-10-20
------------------
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/assets/javascripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,7 @@
$('[data-toggle-target]').toggleTargetClass();

$('form.edit-registry').registryEditForm();

$('.tab-container').fingerTabs();
};
})(jQuery);
68 changes: 68 additions & 0 deletions app/assets/javascripts/jquery.finger_tabs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
(function($) {
$.PMX.FingerTabs = function($el, options) {
var base = this;

base.$el = $el;

base.defaultOptions = {
cardSelector: '.card',
tabSelector: '.tab',
activeIconSelector: '.tab.active .icon',
tabsSelector: '.tabs',
hideSelector: '.hide',
labelSelector: 'label',
updateFormEvent: { event: 'progressiveForm:changed',
target: 'body'
}
};

base.init = function () {
base.options = $.extend({}, base.defaultOptions, options);
base.initializeTabs();
base.bindEvents();
};

base.initializeTabs = function() {
base.selectTab($(base.$el.find(base.options.tabSelector).first()));
};

base.bindEvents = function() {
base.$el.on('click', base.options.tabSelector, base.tabClickHandler);
base.$el.on('click', base.options.hideSelector, base.hideHandler);
$(base.options.updateFormEvent.target).on(base.options.updateFormEvent.event, base.dataChangedHandler);
};

base.hideHandler = function(e) {
base.$el.find(base.options.tabsSelector).toggleClass('slim');
};

base.selectTab = function($tab_element) {
var tab_for = $tab_element.find(base.options.labelSelector).attr('for');
base.resetTabs();
$tab_element.addClass('active');
base.$el.find(base.options.cardSelector + '.' + tab_for).addClass('active');

};

base.resetTabs = function() {
base.$el.find(base.options.cardSelector).removeClass('active');
base.$el.find(base.options.tabSelector).removeClass('active');
};

base.tabClickHandler = function(e) {
var $target = $(e.currentTarget);
base.selectTab($target);
};

base.dataChangedHandler = function(e) {
base.$el.find(base.options.activeIconSelector).addClass('changed');
};
};

$.fn.fingerTabs = function(options){
return this.each(function(){
(new $.PMX.FingerTabs($(this), options)).init();
});
};

})(jQuery);
157 changes: 157 additions & 0 deletions app/assets/stylesheets/panamax.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -762,3 +762,160 @@ pre.prettyprint {

}
}
.tab-container {
display: flex;
border-collapse: separate;
border-spacing: 10px 0;
width: 100%;
min-height: 460px;

.tab, .tab > * {
box-sizing: border-box;
}

.column {
flex-grow: 1;
flex-shrink: 1;
box-sizing: border-box;
vertical-align: top;
transition: all 0.6s;
-webkit-transition: all 0.6s;
-o-transition: all 0.6s;
-moz-transition: all 0.6s;

.title {
height: 55px;

h3 {
@include border-radius(3px);
background: $blue_grey;
color: $white;
font-weight: normal;
padding: 13px 15px;
font-size: 16px;
}
}

.content {
box-sizing: border-box;
width: 100%;
min-height: 400px;
padding: 10px;
border: 1px solid #ccc;
}
}

.card {
display: none;
padding-right: 10px;

&.active {
display: block;
}
}

.tabs {
flex-basis: 185px;
clear: both;
position: relative;

.tab, .hide {
width: 185px;
height: 54px;
margin-bottom: 10px;
border-top-left-radius: 3px;
border-bottom-left-radius: 3px;
border: 1px solid #ccc;
border-right: none;
position: relative;
background: $light_grey;
@include transition('all 0.6s');

&:hover {
background: $white;
}

&.active {
background: $white;

.text {
color: $dark_grey;
font-weight: bold;
}

label {
border-right: 1px solid $white;
}

}

label {
left: 1px;
padding: 10px;
height: 52px;
position: absolute;
width: 100%;
display: inline-block;

.icon {
float: left;
width: 20px;
height: 20px;
margin-top: 5px;
background-repeat: no-repeat;
}

.text {
float: left;
font-size: 12px;
margin: 10px 0 0 10px;
color: $blue_grey;
@include transition('opacity 0s');
transition-delay: 0.5s;
-webkit-transition-delay: 0.5s;
-o-transition-delay: 0.5s;
-moz-transition-delay: 0.5s;
opacity: 1.0;
}
}
}

.hide:hover {
background: none;
.icon {
background-position: -20px 0;
}
}

.hide {
border: none;
background: none;
height: 55px;
margin: 0;

.icon {
background-position: 0 0;
}
}

&.slim {
flex-basis: 40px;

.tab {
width: 40px;
}

label .text {
opacity: 0;
transition-delay: 0s;
-webkit-transition-delay: 0s;
-o-transition-delay: 0s;
-moz-transition-delay: 0s;
}
}
}

.cards {
flex-basis: 510px;
}
}
3 changes: 1 addition & 2 deletions app/assets/stylesheets/panamax/service_details.scss
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@
.service-attributes {
clear: both;
padding-top: 10px;
margin-bottom: 20px;

&:after {
content: '';
Expand Down Expand Up @@ -214,7 +215,6 @@

.service-detail {
width: 100%;
margin-bottom: 40px;
font-size: 13px;

> dl {
Expand Down Expand Up @@ -395,7 +395,6 @@
}

div.port-bindings {
margin-bottom: 50px;

a + a#copy-endpoint {
margin-left: 6px;
Expand Down
105 changes: 105 additions & 0 deletions app/assets/stylesheets/panamax/service_tabs.css.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
@import 'ctl_base_ui/mixins';
@import 'ctl_base_ui/colors';
@import 'ctl_base_ui/icons';
@import 'panamax/buttons';


.tab-container {
.column {
flex-grow: 0;
flex-shrink: 0;
}

.card {
display: none;
padding-right: 10px;

&.active {
display: block;
}
}

.tabs {
.tab, .hide {
label {
.icon {
background-image: image-url('service_icons/icons_tabs_services.png');
}
}
}
}

.cards {
flex-basis: 510px;
}

.docker-run {
flex-grow: 1;
flex-shrink: 1;
* {
box-sizing: border-box;
}
.content {
background: $light_grey;

#docker-string {
margin: 0;
padding: 0;

.run-segment {
white-space: normal;
}
}
}
}
}

.tab label[for='links'] {
.icon {
background-position: 0 -30px;

&.changed {
background-position: -21px -30px;
}
}
}

.tab label[for='vars'] {
.icon {
background-position: 0 -60px;

&.changed {
background-position: -21px -60px;
}
}
}

.tab label[for='ports'] {
.icon {
background-position: 0 -90px;

&.changed {
background-position: -21px -90px;
}
}
}

.tab label[for='vols'] {
.icon {
background-position: 0 -120px;

&.changed {
background-position: -21px -120px;
}
}
}

.tab label[for='run'] {
.icon {
background-position: 0 -180px;

&.changed {
background-position: -21px -180px;
}
}
}
Loading

0 comments on commit 25cc8a7

Please sign in to comment.