From 3170ff886d949d268c3bb16088ea8c10e90b57af Mon Sep 17 00:00:00 2001 From: David Russell Date: Thu, 29 Sep 2016 20:34:39 +0700 Subject: [PATCH] Updated custom css overrides handling for offline slideshows. --- .../gitpitch/controllers/PitchController.java | 21 ------------------- app/com/gitpitch/models/SlideshowModel.java | 11 ---------- app/com/gitpitch/views/Slideshow.scala.html | 4 +++- conf/routes | 3 --- 4 files changed, 3 insertions(+), 36 deletions(-) diff --git a/app/com/gitpitch/controllers/PitchController.java b/app/com/gitpitch/controllers/PitchController.java index 9af15fe..c4c1d56 100644 --- a/app/com/gitpitch/controllers/PitchController.java +++ b/app/com/gitpitch/controllers/PitchController.java @@ -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 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."; } diff --git a/app/com/gitpitch/models/SlideshowModel.java b/app/com/gitpitch/models/SlideshowModel.java index d55feef..571c455 100644 --- a/app/com/gitpitch/models/SlideshowModel.java +++ b/app/com/gitpitch/models/SlideshowModel.java @@ -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. */ diff --git a/app/com/gitpitch/views/Slideshow.scala.html b/app/com/gitpitch/views/Slideshow.scala.html index 7e097ba..7409e47 100755 --- a/app/com/gitpitch/views/Slideshow.scala.html +++ b/app/com/gitpitch/views/Slideshow.scala.html @@ -21,7 +21,9 @@ @SlideshowStyle() @if(ssm.hasThemeOverride()) { - + } diff --git a/conf/routes b/conf/routes index 485b1ff..52dbbad 100644 --- a/conf/routes +++ b/conf/routes @@ -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)