Skip to content

Commit 490dab3

Browse files
author
Saqib
committed
Customise Decap CMS admin portal branding
- Add branded splash screen with CDL logo that fades out on load - Replace Decap login logo with CDL logo via logo_url in config.yml - Hide Decap footer SVG attribution using MutationObserver - Document admin portal branding in README
1 parent 4804607 commit 490dab3

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ Visit `https://civicdatalab.in/admin/` and log in with your GitHub account.
7171
3. Set **Authorization callback URL** to `https://civicdatalab.in/admin/`
7272
4. Copy the **Client ID** and update `app_id` in `static/admin/config.yml`
7373

74+
### Admin portal branding
75+
76+
The CMS login page (`/admin/`) has been customised:
77+
- **Splash screen** — a full-page branded loading screen with the CivicDataLab logo (`/static/cdl_logo.png`) is shown while the CMS loads, then fades out.
78+
- **Login page logo** — the default Decap logo is replaced with the CivicDataLab logo via the `logo_url` field in `static/admin/config.yml`.
79+
- **Decap footer** — the Decap attribution SVG at the bottom of the login page is hidden via a `MutationObserver` in `static/admin/index.html`.
80+
81+
To update the logo, replace `/static/cdl_logo.png` and update the `logo_url` in `static/admin/config.yml` if the path changes.
82+
7483
### CMS collections available
7584

7685
| Collection | Content folder |

static/admin/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ backend:
55
auth_type: pkce
66
app_id: YOUR_GITHUB_OAUTH_APP_CLIENT_ID # TODO: Create a GitHub OAuth App and replace this before merging to main
77

8+
logo_url: /cdl_logo.png
9+
810
media_folder: "static/images/uploads"
911
public_folder: "/images/uploads"
1012

static/admin/index.html

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,51 @@
55
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
66
<title>CivicDataLab | Content Manager</title>
77
</head>
8+
<style>
9+
#splash {
10+
position: fixed;
11+
inset: 0;
12+
background: #eff0f4;
13+
display: flex;
14+
flex-direction: column;
15+
align-items: center;
16+
justify-content: center;
17+
z-index: 9999;
18+
transition: opacity 0.4s ease;
19+
}
20+
#splash img { width: 180px; }
21+
img[src="/cdl_logo.png"] { width: 180px !important; }
22+
#splash p {
23+
margin-top: 16px;
24+
font-family: sans-serif;
25+
font-size: 14px;
26+
color: #666;
27+
}
28+
</style>
829
<body>
30+
<div id="splash">
31+
<img src="/cdl_logo.png" alt="CivicDataLab" />
32+
<p>Loading Content Manager...</p>
33+
</div>
934
<script src="https://unpkg.com/decap-cms@^3.0.0/dist/decap-cms.js"></script>
35+
<script>
36+
window.addEventListener('load', function () {
37+
var splash = document.getElementById('splash');
38+
splash.style.opacity = '0';
39+
setTimeout(function () { splash.style.display = 'none'; }, 400);
40+
});
41+
42+
// Hide Decap footer SVG branding once it renders
43+
function hideDecapBranding() {
44+
document.querySelectorAll('svg[viewBox="0 0 335 90"]').forEach(function (el) {
45+
var parent = el.parentElement;
46+
(parent || el).style.display = 'none';
47+
});
48+
}
49+
var observer = new MutationObserver(hideDecapBranding);
50+
observer.observe(document.body, { childList: true, subtree: true });
51+
var interval = setInterval(hideDecapBranding, 500);
52+
setTimeout(function () { clearInterval(interval); }, 10000);
53+
</script>
1054
</body>
1155
</html>

0 commit comments

Comments
 (0)