Looker will not show values and custom html together - looker

Going off of this article
I'm trying to create a widget for my Looker dashboard that has multiple values in a single cell. Something akin to:
When using the code below, it just shows the value of the measure, with no HTML applied.
measure: custom_single_viz {
type: count
html: <div class="vis">
<div class="vis-single-value" style="font-size:30px; background-image: linear-gradient(to right, #5A2FC2, #F84066); color:#ffffff">
<font color="#5A2FC2"><center><b> {{user_id._rendered_value}}- a field was here </b> </font>
<p><em>35%</em></p>
</div>
</div>
;;
}
When I remove the measure {{user_id._rendered_value}} from the code, it shows all the html beautificaiton... it's as if by having a rendered_value there it destroys all the html and ignores it...
measure: custom_single_viz {
type: count
html: <div class="vis">
<div class="vis-single-value" style="font-size:30px; background-image: linear-gradient(to right, #5A2FC2, #F84066); color:#ffffff">
<font color="#5A2FC2"><center><b> - a field was here </b> </font>
<p><em>35%</em></p>
</div>
</div>
;;
}
What am I doing wrong here?

Related

Angular UI Bootstrap datepicker half date coloring

I have a question that is similar to this question on jQuery datepicker show half day blocked
I need to style a date field diagonally.
For example, in booking calendars when people are leaving in the morning or coming at the afternoon.
Well the solution in the problem you linked to was to use a linear gradient like this:
.css-class-to-highlight a {
background: linear-gradient(red 50%, green 50%);
}
I'm not sure what it buys you, but you can use a linear-gradient() and specify the angle in degrees like this:
div[datepicker] table td button {
background: linear-gradient(-45deg, #4AD34A 50%, #009EFF 50%) !important;
}
You've asked for a CSS only solution that will only affect the visual presentation of the data. If that's what you want you're all set. If you wanted to take different actions based each quadrant, you'd need a more sophisticated setup.
Demo in Stack Snippets
var app = angular.module('ui.bootstrap.module', ['ui.bootstrap']);
app.controller('ui.bootstrap.ctrl', function ($scope) {
$scope.open = function($event) {
$event.preventDefault();
$event.stopPropagation();
$scope.opened = true;
};
});
div[datepicker] table td button {
background: linear-gradient(-45deg, #4AD34A 50%, #009EFF 50%) !important;
}
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.css" rel="stylesheet">
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.15/angular.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.13.0/ui-bootstrap-tpls.js"></script>
<div ng-app="ui.bootstrap.module" >
<div ng-controller="ui.bootstrap.ctrl">
<div class="row">
<div class="col-xs-6">
<p class="input-group">
<input type="text" class="form-control"
datepicker-popup
ng-model="dt"
is-open="opened"
ng-required="true"
close-text="Close" />
<span class="input-group-btn">
<button type="button" class="btn btn-default"
ng-click="open($event)">
<i class="glyphicon glyphicon-calendar"></i>
</button>
</span>
</p>
</div>
</div>
</div>
</div>

Bootstrap 3.2 Resizing causes popover placement issue using input field and form

Fee fiddle below. Put the focus in the input field and resize your browser wid. The popover will be misplaced when the container div is re-sized.
http://jsfiddle.net/024pvz9d/
<div class="container">
<div class="panel panel-primary">
<div class="panel-heading">Labor Start</div>
<div class="panel-body">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-3 control-label" for="employee_number">Employee Number:</label>
<div class="col-sm-6 input-group">
<input class="form-control" type="text" id="fieldModePopover" href="#" data-html="true"
data-content="word word word word word word word word word word word word word word word word word word word word word word word"
rel="popover" data-placement="right"
data-original-title="Title">
</div>
</div>
</form>
</div>
</div>
</div>
I would like the popover to remain on the right side of the input field.
Is this possible ?
This is a known "bug" of boostrap, since the popovers were not really build for this case. You can try a simple hack like this.
Just add the following code to your JS:
$(window).resize(function()
{
if ($(".popover").is(":visible"))
{
var popover = $(".popover");
popover.addClass("noTransition");
$("input:focus").popover('show');
popover.removeClass("noTransition");
}
});
And this class to your css:
.noTransition {
-moz-transition: none !important;
-webkit-transition: none !important;
-o-transition: none !important;
transition: none !important;
}
Working Example

Reducing Foundation's row spacing

I am using Found 4.04. I have a text box inside a form and I am trying to place some text right beneath the text box. However, there is a bit more space than I would like and I want to cut it down. I tried tweaking the margin, padding, etc. using Firebug and nothing has worked.
Is there a way to reduce the vertical space between the text boxes and their corresponding placement text? i.e., "Small text goes here" will move up closer to the text box.
Here is the JSFiddle link (you will have to shrink the code panel so you can see the boxes side by side): http://jsfiddle.net/R95JL/
<html>
<head><meta charset="utf-8">
<meta content="width=device-width" name="viewport">
<link href="http://cdn.jsdelivr.net/foundation/4.0.4/css/foundation.min.css" rel="stylesheet">
</head>
<body>
<h4> Test form </h4>
<br> <br>
<div class="container">
<div class="row">
<form enctype="application/x-www-form-urlencoded" action="" method="post">
<div class="large-3 columns"> Text </div>
<div class="large-2 columns"><input type="number" value="" required="" name="f2" id="myid1"></div>
<div class="large-2 large-offset-1 columns end"><input type="number" value="" required="" name="f3" id="myid2"></div>
</form>
</div>
<div class="row">
<div class="large-offset-3 large-2 columns"><small> Small text goes here </small> </div>
<div class="large-2 large-offset-1 columns end"><small> Small text goes here </small> </div>
</div>
</div>
</body>
</html>
Just remove the margin from the input boxes in your CSS.
input { margin:0px !important; }
Your solution is unlikely a simple hack :
#myid2 {
margin-bottom:0px;
}
working demo
Also note that your form is float'ed....so you'll have to use
.clr{
clear:both;
}
and unlike the other answers, using input {margin:0px !important;} is not recommended as this will affect all the input fields and the form layout too... see what i mean!!
your input is having default margin. Use this rule in css:
input {margin:0px !important;}

Inserting Search box into header image

I am looking to insert/move my search bar into my header image similar to the example below. If someone had a minute to show me how to accomplish this it would be greatly appreciated. Thanks for your time. Here is the link to my website http://www.jobspark.ca/
Chris
Just add your search box inside
<div id="logo" class="image">
...
<h1>
...
</h1>
"search box code goes here"
</div>
Give an id in the search div and Finally position using CSS padding.
you can keep the background image into body tag. set no repeat, use background-size to 100% width.
example:
body{
backgroud-image:url() no-repeat center;
background-size: --;
}
HTML STRUCTURE:
<div id="header">
<div ="#">
<h1></h1> //float:left
<div id="menu"></div> //float:right;
</div>
<div ="search-box">
<form>
</form> //use margin and padding for keep it center;
</div>
</div>

How to prevent the loading of background image in each page?

I am using jquery mobile. I have defined a background image in index page inside css body{} tag. Back ground is coming fine but it's automatically loading in different pages also though I didn't declare the body css part in following pages. How to prevent that? and css body{background: url()} is only working on index page. here is my code
<style type="text/css">
body {
background: url(images/login2.png);
background-repeat:repeat-y;
background-position:center;
background-attachment:scroll;
background-size:100% 100% ;
}
.ui-page {
background: transparent;
}
.ui-content{
background: transparent;
}
</style>
</head>
<body>
<div align="center" data-role="fieldcontain" id="contentConfirmation" name="contentConfirmation">
<div >
<label class="userlabelclass" for="url" style="float:left" ><p>Username:</p></label>
<input class="userfieldclass" id="Lusername" name="uid_r" type="text" value="John Doe" " style="width:230px;float:right">
</div>
<div >
<label class="pswdlebelclass" for="url" style="float:left"><p>Password:</p></label>
<input class="pswdfieldclass" id="Lpassword" name="pwd_r" type="password" value="123456789" style="width:230px;float:right">
<label class="forgotclass" for="url" style="float:left"><p>Forgot Password?</p></label>
</div>
<div align="center">
<a href="listview_page.html" data-role="button" data-inline="true" data-theme="e" class="buttonclass" >Log In</a>
</div>
</div>
</body>
Jquery mobile navigation uses Ajax to load the body part only of the pages you navigate to. This means that the header of subsequent pages is ignored, and that the header of your first page is "applied" to all pages. If you want your background to apply only to your first page, I would recommend:
you create a data-role="page" div to hold the content of your first page, as recommended when using jquery mobile
You apply your background to this specific page element

Resources