mirror of
https://github.com/gitpitch/gitpitch.git
synced 2024-04-18 07:30:55 +08:00
Updated custom css overrides handling for offline slideshows.
This commit is contained in:
parent
b212f66686
commit
3170ff886d
|
@ -376,24 +376,6 @@ public class PitchController extends Controller {
|
|||
|
||||
} // offline action
|
||||
|
||||
/*
|
||||
* CustomCSS returns text/css overrides for a slideshow.
|
||||
*/
|
||||
public Result customCSS(String grs,
|
||||
String user,
|
||||
String repo,
|
||||
String branch) {
|
||||
|
||||
PitchParams pp =
|
||||
PitchParams.build(grsOnCall(grs), user, repo, branch);
|
||||
Optional<SlideshowModel> ssmo = pitchService.cachedYAML(pp);
|
||||
String customStyle = CUSTOM_CSS_NOT_FOUND;
|
||||
if(ssmo.isPresent()) {
|
||||
customStyle = ssmo.get().fetchThemeOverride();
|
||||
}
|
||||
return ok(customStyle).as("text/css");
|
||||
} // customCss action
|
||||
|
||||
/*
|
||||
* Gist generates and renders GitHub-Gist HTML for
|
||||
* embedding within slideshows.
|
||||
|
@ -413,7 +395,4 @@ public class PitchController extends Controller {
|
|||
"GitPitch Slideshow print service temporarily unavailable.";
|
||||
private static final String PITCHME_OFFLINE_ERROR =
|
||||
"GitPitch Slideshow offline service temporarily unavailable.";
|
||||
|
||||
private static final String CUSTOM_CSS_NOT_FOUND =
|
||||
"// Custom CSS not found.";
|
||||
}
|
||||
|
|
|
@ -185,17 +185,6 @@ public class SlideshowModel {
|
|||
return customCSS;
|
||||
}
|
||||
|
||||
/*
|
||||
* Return theme override css for slideshow.
|
||||
*/
|
||||
public String fetchThemeOverrideCSS() {
|
||||
|
||||
return com.gitpitch.controllers.routes.PitchController.customCSS(_pp.grs,
|
||||
_pp.user,
|
||||
_pp.repo,
|
||||
_pp.branch).url();
|
||||
}
|
||||
|
||||
/*
|
||||
* Return active theme font for slideshow.
|
||||
*/
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
<link href="@deps.fontawesome(offline)/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
|
||||
@SlideshowStyle()
|
||||
@if(ssm.hasThemeOverride()) {
|
||||
<link href="@ssm.fetchThemeOverrideCSS()" rel="stylesheet" type="text/css"/>
|
||||
<style>
|
||||
@Html(ssm.fetchThemeOverride())
|
||||
</style>
|
||||
}
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
@ -20,9 +20,6 @@ GET /pitchme/offline/:grs/:user/:repo/:b/:t/PITCHME.zip com.gitpitch.cont
|
|||
# Handle GitHub OAuth Callback
|
||||
# GET /pitchme/authorized com.gitpitch.controllers.AuthController.authorized(code:String ?= null, state:String ?= null)
|
||||
|
||||
# Serve PITCHME.css custom theme styling.
|
||||
GET /pitchme/custom-css/:grs/:user/:repo/:b/PITCHME.css com.gitpitch.controllers.PitchController.customCSS(grs:String, user:String, repo:String, b:String)
|
||||
|
||||
# Serve PITCHME.md markdown.
|
||||
GET /pitchme/markdown/:grs/:user/:repo/:b/PITCHME.md com.gitpitch.controllers.PitchController.markdown(grs:String, user:String, repo:String, b:String)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user