Displaying announcement on all Jenkins pages - jenkins

Is there a simple way or a plugin to display any custom message on Jenkins pages for all users? I wanted to display important changes or actions directly on Jenkins instead of emailing everyone.
What I mean is to have configurable panel similar to "Jenkins is going to shut down" which I could display and possibly change color. I tried to find plugins for that but found nothing.

Ok, I'll answer my dummy question, maybe someone will look for it later.
There's a plugin for injecting code to page header and footer:
https://wiki.jenkins-ci.org/display/JENKINS/Page+Markup+Plugin
It's not as easy to find as it should be downloaded from creators' page (link in description).
Without an extra plugin: In my case it was simpler as it was enough to add system message (manage jenkins -> configure system -> system message).
You can add CSS to Jenkins\war\css\style.css and use it in system message. I reused "shutdown-msg" which is displayed when jenkins is going to shut down.
#shutdown-msg {
font-weight: bold;
color: white;
background-color: #ef2929;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
#yellow-msg {
font-weight: bold;
color: black;
background-color: #eded78;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
#green-msg {
font-weight: bold;
color: white;
background-color: #34ba51;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
#blue-msg {
font-weight: bold;
color: white;
background-color: #2d72d8;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
#grey-msg {
font-weight: bold;
color: white;
background-color: #6b7777;
text-align: center;
margin-left: 2em;
margin-right: 2em;
margin-bottom: 0.5em;
padding: 0.5em;
-moz-border-radius: 0.5em;
}
<div id="shutdown-msg">Red message</div>
<div id="green-msg">Green message</div>
<div id="yellow-msg">Yellow message</div>
<div id="blue-msg">Blue message</div>
<div id="grey-msg">Grey message</div>

Related

Tip/warning/definition/description boxes in Markdown

I need to create an usage instruction document and wanted to use Markdown for it.
To do this I need to create "eye catching" textbox like blocks containing definitions, warnings etc.
examples in this link
how do I do something like that ?
Edit 1:
I discovered callouts, this semms exactly what I need, but I fail to use them in Markdown. Any tips on that?
That is not possible directly in Markdown. However, most Markdown convertes allow you to use HTML and CSS code mixed in the Markdown code. For example:
<div style="padding: 15px; border: 1px solid transparent; border-color: transparent; margin-bottom: 20px; border-radius: 4px; color: #3c763d; background-color: #dff0d8; border-color: #d6e9c6;">
I am a success message
</div>
<div style="padding: 15px; border: 1px solid transparent; border-color: transparent; margin-bottom: 20px; border-radius: 4px; color: #a94442; background-color: #f2dede; border-color: #ebccd1;">
I am an error message
</div>
<div style="padding: 15px; border: 1px solid transparent; border-color: transparent; margin-bottom: 20px; border-radius: 4px; color: #31708f; background-color: #d9edf7; border-color: #bce8f1;">
I am a info message
</div>
<div style="padding: 15px; border: 1px solid transparent; border-color: transparent; margin-bottom: 20px; border-radius: 4px; color: #8a6d3b;; background-color: #fcf8e3; border-color: #faebcc;">
I am a warning message
</div>
The result looks like that:

Getting Error in Self hosted WCF Service

We have WCF Service using basichttpbinding and it is hosted inside MVC application.On Testing stage,SSL certificate is enabled on MVC application site and load balancer is also there.
We are getting below error while accessing service in console app.
The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8).
If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.
The first 932 bytes of the response were: '#content{ FONT-SIZE: 0.7em; PADDING-BOTTOM: 2em;
MARGIN-LEFT: 30px}BODY{MARGIN-TOP: 0px; MARGIN-LEFT: 0px; COLOR: #000000; FONT-FAMILY: Verdana; BACKGROUND-COLOR: white}
P{MARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR: #000000; FONT-FAMILY: Verdana}PRE{BORDER-RIGHT: #f0f0e0 1px solid; PADDING-RIGHT:
5px; BORDER-TOP: #f0f0e0 1px solid; MARGIN-TOP: -5px; PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px; BORDER-LEFT:
#f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e5e5cc}.
heading1{MARGIN-TOP: 0px; PADDING-LEFT: 15px; FONT-WEIGHT: normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px;
MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 10px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366}.intro{'.

CSS background image not showing up on rails site

I'm trying to use the background-image css property with a website I'm building with Ruby on Rails.
I've tried several different variations of background-image: url, background: url, with and without quotations, and several paths to the image. The image is currently located in app/assets/images/upload.png.
background: url(upload.png);
custom.css.scss
/* UNIVERSAL */
body {
background-color: black;
padding-top: 8px;
width: 800px;
margin-left: auto;
margin-right: auto;
font-family: arial, sans-serif;
font-size: 16px;
}
.content {
background-color: white;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
-khtml-border-radius: 10px;
border-radius: 10px;
padding: 1px 15px;
}
h2 {
font-size: 18px;
}
p {
font-size: 16px;
}
ol {
font-size: 16px;
}
/* NAVIGATION */
ul {
padding: 0px;
}
#navtop {
float: right;
display: inline-block;
position: relative;
bottom: 47px;
right:4px;
letter-spacing:1px;
}
#topnavcontainer {
margin-bottom: -40px;
}
#navtop li, #navbottom li, #navbuttons li {
display: inline;
margin: 0px;
padding: 0px;
}
#navbuttons {
word-spacing: 25px;
position: relative;
left: 400px;
bottom: 60px;
display: inline-block;
}
#navbottom {
text-align: center;
word-spacing:90px;
letter-spacing:1px;
margin-top:25px;
}
#navtop a:link, #navbottom a:link, #navtop a:visited, #navbottom a:visited {
text-decoration: none;
font-size: 12px;
color: #999999;
}
#navtop a:hover, #navbottom a:hover {
color: white;
}
#uploadbutton a:link, #uploadbutton a:visited, #viewbutton a:link, #viewbutton a:visited {
text-decoration: none;
border-style:solid;
border-width:3px;
border-color:#666666;
padding: 5px;
color: white;
font-size: 14px;
font-weight: bold;
letter-spacing:2px;
}
#uploadbutton a:hover {
color: #FF0000;
}
#viewbutton a:hover {
color: #0066FF;
}
/*style the main menu*/
.myMenu {
margin:0;
padding:0;
text-align: left;
}
.myMenu li {
list-style:none;
float:left;
}
.myMenu li a:link, .myMenu li a:visited {
display:block;
text-decoration:none;
padding: 0.5em 1em;
margin:0;
}
.myMenu li a:hover {
background-color:black;
}
/*style the sub menu*/
.myMenu li ul {
position:absolute;
visibility:hidden;
margin:0;
padding:0;
}
.myMenu li ul li {
display:inline;
float:none;
}
.myMenu li ul li a:link, .myMenu li ul li a:visited {
background-color:black;
width:55px;
}
.myMenu li ul li a:hover {
background-color:#999999;
}
/* HOME PAGE */
#homepage {
text-align: center;
}
#homeheadline {
color: white;
background-color: #333333;
font-weight:normal;
border-style:solid;
border-width:6px;
border-color:#333333;
letter-spacing:1px;
margin-bottom: 45px;
}
a#clickhere , a#clickhere:visited {
text-decoration: none;
color: #0066FF;
}
#videotitle {
color: #FF0000;
position: absolute;;
bottom: 70px;
display: inline;
font-size: 19px;
left: 60px;
}
#videolist {
position: absolute;
left: 40px;
display: inline-block;
}
#audiencetitle {
color: #0066FF;
position: absolute;
bottom: 70px;
left: 340px;
display: inline;
font-size: 19px;
}
#audiencelist {
position: absolute;
display: inline-block;
left: 320px;
}
a.greenbutton, a.greenbutton:visited, {
font-size: 14px;
color: white;
font-weight: bold;
text-decoration: none;
background-color: #009900;
border-style:solid;
border-width:7px;
border-color:#009900;
letter-spacing:1px;
}
#homead {
margin-bottom: 25px;
margin-top: 45px;
display: block;
}
#lists {
width: 538px;
height: 100px;
position: relative;
margin-bottom: 35px;
margin-left: auto;
margin-right: auto;
text-align: left;
}
/* FORMS */
.greenbutton {
font-family: arial, sans-serif;
font-size: 14px;
color: white;
font-weight: bold;
text-decoration: none;
background-color: #009900;
border-style:solid;
border-width:3px;
border-color:#009900;
letter-spacing:1px;
margin-bottom: 40px;
}
.textinput {
border: 1px solid #bbb;
height: 18px;
width: 300px;
margin-bottom:30px;
}
.signform {
text-align: center;
width:300px;
margin-left: auto;
margin-right: auto;
}
.signformfields {
text-align: left;
}
#error_explanation {
color:#f00;
font-size: 16px;
ul { list-style: none;
margin: 0 0 18px 0;
}
}
.field_with_errors {
#extend .control-group;
#extend .error;
}
/* Upload Menu */
#uploadpage {
height: 580px;
}
.uploadnav ul {
list-style-type: none;
}
.uploadnav {
width: 200px;
text-align: center;
float:left;
}
.uploadbox {
background-color: black;
background-image: url( image_path ("upload.png"));
border-style:solid;
border-width:25px;
border-color: black;
margin-top: 20px;
}
.uploadgreybox {
background-color: #CCCCCC;
border-style:solid;
border-width:25px;
border-color: #CCCCCC;
margin-top: 20px;
}
.uploadtext {
color: white;
background-color: black;
padding: 5px;
}
.uploadgreytext {
color: #666666;
background-color: #CCCCCC;
padding: 5px;
}
.uploadpagecontent {
float:right;
}
The most correct way:
background-image: url(<%= asset_path 'upload.png' %>)
See the Guide for details: http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets (sec. 2.2.1 CSS and ERB)
NOTE: If you're doing this in your application.css then add .erb extension to it to become application.css.erb
if somebody comes by and still looking for an answer and you're using SASS and bootstrap, you can try
background: image-url('bgImage.jpg');
that worked for me. You can as well take a look on http://guides.rubyonrails.org/asset_pipeline.html#coding-links-to-assets as jdoe mentioned.
You need to point to the image path correctly. It should be:
background: url(/assets/url.png);
Try using the Inspector in Google Chrome - useful for checking resources like this that are called by CSS.
I have had the similar problem and I found that the following code works
background-image: url('/assets/xyz.jpg');
you probably need to change the path to the image. Where is the css file in relation to the images folder, eg app/assets/css/style.css.
If it is here then your path the the upload.png will be background: url(../images/upload.png); background: url(/images/upload.png); or background: url(images/upload.png);
You shouldn't have to change the extention to your custom.css.scss or your importantly no need to add erb to the scss file
in application.css file in your /assets/stylesheets directory
all you need is an element
html{
background: url('/images/test.jpg');
text-align:center;
color:#fff;
}
Poss your css file, move the
try
background: white;z-index:-1;

how to beautify validations in rails

I have a simple scaffold rails application that is doing validataes_presence_of.
The validation is making each textfield bordered. I just want the error messages to be displayed on top.
How can I make these type of changes or color changes to the validation
Rails applications store their CSS in [application_root]/public/stylesheets. A new rails app will have a file called default.css in this directory. This file contains the following:
#errorExplanation {
width: 400px;
border: 2px solid red;
padding: 7px;
padding-bottom: 12px;
margin-bottom: 20px;
background-color: #f0f0f0;
}
#errorExplanation h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px;
background-color: #c00;
color: #fff;
}
#errorExplanation p {
color: #333;
margin-bottom: 0;
padding: 5px;
}
#errorExplanation ul li {
font-size: 12px;
list-style: square;
}
If you play about with the values of some of the parameters here - in particular border - you might find something that looks more to your taste.
Have you checked rails guide about validation errors?
I would suggest having a look at Formtastic. Easy to setup, works great with scaffold-type apps and has some nice clean HTML and CSS.

CSS question. How can I get blueprint css to work rails tabnav widget?

I need a quick solution to getting some decent layout working within the tabnav widget display area. I'm already using blueprint css for other aspects of the layout but I don't have enough CSS chops to figure out how to get blueprint containers to display within the tabnav's content area.
The tabnav's content area is <div class="main_tabnav_content" id="main_tabnav_content">
and this is the related css:
.main_tabnav {
color: #000;
border-bottom: 1px solid #ccc;
margin: 13px 0px 0px 0px;
padding: 0px;
z-index: 1;
padding-left: 10px }
.main_tabnav ul {
margin: 0px;
padding: 0px;
}
.main_tabnav li {
display: inline;
overflow: hidden;
list-style-type: none; }
.main_tabnav li span.disabled {
color: #888888;
background: #FAFAFA;
border: 2px solid #DDDDDD;
border-bottom: none;
padding: 2px 5px 0px 5px;
margin: 0;
text-decoration: none;}
.main_tabnav a, main_tabnav a.active {
color: #000000;
background: #EEEEEE;
font-weight: bold;
border: 1px solid #ccc;
padding: 2px 5px 0px 5px;
margin: 0;
text-decoration: none; }
.main_tabnav a.active {
background: #FFFFFF;
border-bottom: 3px solid #FFFFFF; }
.main_tabnav a:hover {
color: #FFFFFF;
background: #CCCCCC; }
.main_tabnav a:visited {
color: #000000; }
.main_tabnav a.active:hover {
background: #FFFFFF;
color: #000000; }
.main_tabnav_content {
background: #FFFFFF;
padding: 20px;
border:1px solid #ccc;
border-top: none;
z-index: 2;
}
I'd like to be able to put some columns inside the main_tabnav_content area like this
<div class="span-5 colborder">
stuff
</div>
<div class="span-5 colborder">
stuff
</div>
<div class="span-5 colborder">
stuff
</div>
At the moment the columns are displayed but the main_tabnav_content box doesn't expand around them. Any suggestions for how to get the blueprint layout nested inside the main_tabnav_content area?
From Blueprint: screen.css:
.column, div.span-1, div.span-2, div.span-3, div.span-4, div.span-5, div.span-6, div.span-7, div.span-8, div.span-9, div.span-10, div.span-11, div.span-12, div.span-13, div.span-14, div.span-15, div.span-16, div.span-17, div.span-18, div.span-19, div.span-20, div.span-21, div.span-22, div.span-23, div.span-24 {float:left;margin-right:10px;}
.last, div.last {margin-right:0;}
.span-1 {width:30px;}
.span-2 {width:70px;}
.span-3 {width:110px;}
.span-4 {width:150px;}
.span-5 {width:190px;}
and also:
div.colborder {padding-right:24px;margin-right:25px;border-right:1px solid #eee;}
I think if you add this <div class="clearfix"></div> before the end of the main_tabnav_content div it should fix the float problem.
Do you have the css for the span-5 & colborder classes? It sounds like it might be a float problem. Basically what's happening is when you add the columns to the main_tabnav_content div, the div doesn't expand, right?

Resources