Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

themes #9

Open
rebornishard opened this issue May 24, 2016 · 5 comments
Open

themes #9

rebornishard opened this issue May 24, 2016 · 5 comments

Comments

@rebornishard
Copy link

how to include themes ?
or at least provide responsive theme as default,
thanks

btw great package, i'm stuck including adminer.php standalone

@ergonomicus
Copy link

Adminer is expecting the .css file in the same folder where it is being executed, so you can download any theme from adminer website and put it in your public folder (where index.php is located). Just leave the default name 'adminer.css' and you should see the theme applied.

I hope that's good enough for your case.

@rebornishard
Copy link
Author

rebornishard commented Jul 7, 2016

@ergonomicus since i move default index to / so i must add adminer.css to dir / ?
let me try it,

ok i try both on public/ and / , both of them none worked. i put adminer.css into attachment
endorse.zip

btw adminer 1.2.5 released

@bkoch31
Copy link

bkoch31 commented Dec 15, 2016

Having some trouble here too. I tried adding the adminer.css file to the laravel public folder, my public_html/ folder and into the composer package src directory without any luck. Love this package just want this theme added.

@cweiske
Copy link

cweiske commented Aug 1, 2018

With 4.3.1, I adjusted the CSS as follows:

  1. Extend AdminerAutologinController
  2. Overwrite function index()
  3. In there, check if request()->query->get('file') equals default.css
  4. If yes, echo custom CSS (this is prepended before the adminer CSS, but there is no other way. You have to use !important)
  5. Call parent index() method

@jtallinger
Copy link

jtallinger commented Oct 11, 2018

Hi,

Here is my solution (based on @cweiske's idea):

  1. Create a new controller for adminer, include needed auth/acl middlewares (I want to wrap adminer with my normal ACL control).
  2. Add: use Illuminate\Support\Facades\Response;
  3. Create index function in the new controller:

`
public function index() {
// Manual override of CSS
if (request()->query->get('file') == 'default.css') {
// Location of css theme file
$file = 'css/adminer/adminer-haeckel.css';

        // Retrieve contents of css file
        if (file_exists($file)) {
            $contents = file_get_contents($file);

            // Create response
            $response = Response::make($contents);

            // Set header to text/css
            $response->header('Content-Type', 'text/css');

            // Send response to client
            return $response;
        }
    }

    require('../vendor/miroc/laravel-adminer/src/adminer-4.5.0-en.php');
}

`

  1. Download CSS theme file from adminer. Copy content of default adminer css file (default.css) and add to the top of new theme file.

/r annoying code block feature...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants