Can the Gerrit login page be replaced? - gerrit

I want to edit the gerrit login page or add the background image myself.Who can tell me how to set it.
Thanks
I didn't find a solution online.I use ldap for authentication.

I have done this in the past. You need to add a custom css file, named GerritSite.css, to your etc folder.
I have uploaded my version as a gist, see https://gist.github.com/uncletall/5fb0cf342cf358fa67f53c1851587aa1
My images are in the static folder and you will need to change lines 46 and 47 is for the logo:
background-image: url(/r/static/your_logo.png);
background-image: linear-gradient(transparent,transparent), url(/r/static/your_logo.png);
and line 223 is the background image:
background-image: url(/r/static/your_image.jpg) !important;
To be honest, I have done this a while back so I can't remember the exact details of this.
You also need to add a LoginForm.html in the etc folder, see in this gist: https://gist.github.com/uncletall/d216e76c81fa861fb8583137efa71d69

Related

How can I change the color of the progress bar of a task in Redmine or where is the code located?

I want to change the color of the progress bar of a task. I've located the .erb source file for the gantt chart page and the .rb source code for the computation of % done progress but it seems it's not the right file to edit.
You should actually edit image located at:
your_redmine_root/public/images/task_late.png
Where your_redmine_root is a place where your Redmine is physically installed, and it depends upon underlaying operating system, etc...
So gannt is a combination of html code generated from underlaying RoR application which's view you can edit in app/views/gantts/show.html.erb. Javascript code from public/javascripts/gantt.js and CSS style (theme), which actually might differ if you are using some custom theme or plugin, at default install it's in public/stylesheet/application.css
The particular codes might also be different due to Redmine version, but you are looking for
.task_late { background:#f66 url(../images/task_late.png); border: 1px solid #f66; }
On Redmine 3.0 it's at line 986. .task_late is ordinary div, and you can set it's css style any way you want...
Don't forget to restart Redmine after editing, and also make sure to refresh your browser's cache.

Rails fine-uploader icons can't show in browser give error without gems

In console screenshots is that, also in /assets/admin included images, and in fine-uploader-gallery.css included like
background: url("edit.gif"); that. How we can fix this images or icons?
I hope, explaining well.
Thanks in advance
change the file .css to .scss and use the syntax of scss:
background: image-url("admin/edit.gif") no-repeat 0 0;

CKEditor toolbar using wrong icon file (via Rails "rich" gem)

I'm using CKEditor via the 'rich' gem for Ruby on Rails.
It has historically worked fine, but at some point my editor icons started looking like this:
I'm not sure what caused was, whether I upgraded something or what.
(I do know that it's not a browser-cache issue.)
How I can fix these icons?
The code:
This is the HTML for the Bold button's span element (whitespace added for readability):
<span class="cke_button_icon cke_button__bold_icon"
style="background-image:url(http://localhost:5000/assets/ckeditor/plugins/icons.png?t=E4KA);
background-position:0 -24px;
background-size:auto;">
</span>
And the styles as interpreted by Chromium:
In that last line, url(icons.png) actually resolves to http://localhost:5000/assets/ckeditor/skins/moono/icons.png
What I can see but don't know how to resolve:
There are two different icons.png files at play here:
<gem_path>/vendor/assets/images/ckeditor/plugins/icons.png
(works correctly with background-position offset -24px)
<gem_path>/vendor/assets/images/ckeditor/skins/moono/icons.png
(is calibrated for a different offset value)
In the code snippets, you can see that the CSS specifies offset -24px, thus the first image is the correct one. The inline-element style specifies the first image, but is overridden by an !important-ified url(icons.png) which loads the second image (which is wrong).
Why the heck is it doing that?
Can I somehow fix this without forking the gem? (I can fork the gem, but I'd rather not maintain a separate fork if possible.)
Add below CSS in the application.html.erb file
.cke_ltr .cke_button_icon {
background-image: url('/assets/ckeditor/plugins/icons.png?t=H5SC') !important;
}

How to add an image to be used in the customized css file - Swagger UI - Swashbuckle

I'm using Swagger(Swashbuckle) as the documentation tool for our Web API project. I'm able to customize index.html using customized css file.
Everything's works great, except, I want to add our company's specific logo in the index page & I couldn't get it to work.
Suggestions ??
I realize this is an older question, but I just ran into this today. If you want to embed an image file, you can do it similar to how you do for the css and index file.
Add a line in the SwaggerConfig like the following:
c.CustomAsset("mylogo", thisAssembly, "YourWebApiProject.SwaggerExtensions.mylogo.png");
You can then reference that file either in your modified css or custom index page by using <img src="mylogo" /> in your modified html or url(../mylogo) for the path if using it in your custom css file.
Similar to your index and css files, make sure it's set as an embedded resource.
What about including this in your CSS:
.swagger-section #header a#logo {
background-image: url(path/to/my/logo);
}

Background images do not render on Ruby on Rails application

I am attempting to have a image render in the background of a div with the class head.
My application view is written Haml and the body is defined as follows:
%body
.container
.head
.sixteen_columns
.top-nav
Included in my application stylesheet is:
.head {
background-image: url(/images/background_image.jpg);
width: 100%;
height: auto;
}
I have tried a number of variations to specify the path of the image and altered the image name several times but to no avail.
What is the issue?
Consider using the asset_path helper when referencing images in your stylesheet. Documentation may be found here (check out 2.2.1)In the context the CSS you listed you would heave
.head {
background-image:url(<%= asset_path 'background_image.jpg'%>);
width:100%;
height:auto;
}
Note: This requires that your style sheet be an erb.
Doing so offers a number of advantages over explicitly stating the path, one being that as the structure of rails application changes with new version releases, you will not need to change anything in your code in order for that image to be referenced properly.
This may seem like overkill just to reference an image but it's one of the many conventions of Rails that are difficult to get used but great! as your application grows and changes, hopefully enabling it to better endure the test of time.
Assuming you're using Rails 3.1 or beyond, and that you're using the asset pipeline properly for your images, you can include your image file by doing the following:
.head {
background-image: url(/assets/background_image.jpg);
width: 100%;
height: auto;
}
The reason for this is because of the way the asset pipeline works. It compiles your assets at run time and it places all of your assets in a folder called /assets/. It also ignores subfolder structuring and it just dumps everything into the root /assets/ folder, not /assets/subfolder/.
Try running
rails -v
from the console to confirm what version of Rails you're on.
It sounds like you're running a rails 2.x application, correct? That should mean that you're serving images, js etc from the /public directory. One important gotcha that tripped me up setting background images in css is that the paths you specify are relative to the directory the stylesheet is in(e.g /public/stylesheets), not the root directory of the project itself.
Have you tried changing the path to go up one directory from where the stylesheet is located?
.head {
background-image: url(../images/background_image.jpg);
width: 100%;
height: auto;
}
EDIT: What other paths to the bg image have you tried?
Some other possibilities could be:
background-image: url(images/background_image.jpg);
background-image: url('../images/background_image.jpg');
One other thing to check would be to load the view and examine the div in Google Chrome using the inspector (Ctrl Shift + I). Select the div and examine the styles Chrome is assigning to it.
Also, double check that it's still named background_image.jpg Can't tell you how many times I've gotten burned by some typo I overlooked ;)
Solution:
It turned out to be a combination of two things. I used this format for the background image:
background-image: url(../images/background_image.jpg);
However, the .head div was renbdering with a height of 0. I added a fixed height to test, and it all showed up perfectly. I can work with this from here.
Thank you all so much for the help!!
In rails 4 you can now use a css and sass helper image-url:
div.logo {background-image: image-url("logo.png");}
If your background images aren't showing up consider looking at how you're referencing them in your css files.

Resources