[jenkinscat-docs] master: File handlers are now handled by different module. (390a50c)

immanetize at fedoraproject.org immanetize at fedoraproject.org
Fri Feb 6 07:40:44 UTC 2015


Repository : http://git.fedorahosted.org/cgit/jenkinscat-docs.git

On branch  : master

>---------------------------------------------------------------

commit 390a50c42850b211ce87791f1c72b6a84cda6cd8
Author: Pavel Tisnovsky <ptisnovs at redhat.com>
Date:   Fri Dec 19 16:49:18 2014 +0100

    File handlers are now handled by different module.


>---------------------------------------------------------------

 ChangeLog                 |    5 +++++
 src/jenkinscat/server.clj |   43 ++-----------------------------------------
 2 files changed, 7 insertions(+), 41 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 564b918..7a73176 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 2014-12-19  Pavel Tisnovsky  <ptisnovs at redhat.com>
 
 	* src/jenkinscat/server.clj:
+	File handlers are now handled by different module.
+
+2014-12-19  Pavel Tisnovsky  <ptisnovs at redhat.com>
+
+	* src/jenkinscat/server.clj:
 	Job configuration page and build page are now handled by different
 	modules.
 
diff --git a/src/jenkinscat/server.clj b/src/jenkinscat/server.clj
index e67f31b..2789fd4 100644
--- a/src/jenkinscat/server.clj
+++ b/src/jenkinscat/server.clj
@@ -909,7 +909,7 @@
     [uri params session]
     (read-books-if-not-loaded)
     (let [statistics (compute-statistics books/books)
-          page-content (render-statistics-page statistics)]
+          page-content (statistics-page-renderer/render-statistics-page statistics)]
          (generate-response-html page-content session)))
 
 (defn print-request-info
@@ -931,46 +931,6 @@
           session             (request :session)]
           (selected-handler uri params session)))
 
-(defn return-file
-    "Return given file with proper content type as a response to a HTTP request."
-    [file-name content-type]
-    (let [file (new-file "www" file-name)]
-         (println "Returning file " (.getAbsolutePath file))
-         (println "")
-         (-> (http-response/response file)
-             (http-response/content-type content-type))))
-
-(def file-handlers
-    "Map of file handlers, ie. map of known files included from the generated HTML page."
-    {"/"                            '(jenkinscat.server/return-file "index.html"                   "text/html")
-     "/favicon.ico"                 '(jenkinscat.server/return-file "favicon.ico"                  "image/x-icon")
-     "/jenkinscat.gif"              '(jenkinscat.server/return-file "jenkinscat.gif"               "image/gif")
-     "/jenkinscat.png"              '(jenkinscat.server/return-file "jenkinscat.png"               "image/png")
-     "/stopwatch2.png"              '(jenkinscat.server/return-file "stopwatch2.png"               "image/png")
-     "/erase-l.gif"                 '(jenkinscat.server/return-file "erase-l.gif"                  "image/gif")
-     ; this one is there only for test purposes
-     ;"/data.json"                   '(jenkinscat.server/return-file "data.json"                    "application/json")
-
-     "/css/bootstrap.css"           '(jenkinscat.server/return-file "/css/bootstrap.css"           "text/css")
-     "/css/bootstrap.css.map"       '(jenkinscat.server/return-file "/css/bootstrap.css.map"       "text/css")
-     "/css/bootstrap.min.css"       '(jenkinscat.server/return-file "/css/bootstrap.min.css"       "text/css")
-     "/css/bootstrap-theme.css"     '(jenkinscat.server/return-file "/css/bootstrap-theme.css"     "text/css")
-     "/css/bootstrap-theme.css.map" '(jenkinscat.server/return-file "/css/bootstrap-theme.css.map" "text/css")
-     "/css/bootstrap-theme.min.css" '(jenkinscat.server/return-file "/css/bootstrap-theme.min.css" "text/css")
-     "/css/Jenkinscat.css"          '(jenkinscat.server/return-file "/css/Jenkinscat.css"          "text/css")
-
-     "/js/angular.min.js"           '(jenkinscat.server/return-file "/js/angular.min.js"           "application/javascript")
-     "/js/bootstrap.js"             '(jenkinscat.server/return-file "/js/bootstrap.js"             "application/javascript")
-     "/js/bootstrap.min.js"         '(jenkinscat.server/return-file "/js/bootstrap.min.js"         "application/javascript")
-     "/js/jenkinscat.js"            '(jenkinscat.server/return-file "/js/jenkinscat.js"            "application/javascript")
-     "/js/jquery.min.js"            '(jenkinscat.server/return-file "/js/jquery.min.js"            "application/javascript")
-
-     "/fonts/glyphicons-halflings-regular.eot"  '(jenkinscat.server/return-file "/fonts/glyphicons-halflings-regular.eot"  "application/vnd.ms-fontobject")
-     "/fonts/glyphicons-halflings-regular.svg"  '(jenkinscat.server/return-file "/fonts/glyphicons-halflings-regular.svg"  "image/svg+xml")
-     "/fonts/glyphicons-halflings-regular.ttf"  '(jenkinscat.server/return-file "/fonts/glyphicons-halflings-regular.ttf"  "application/x-font-ttf")
-     "/fonts/glyphicons-halflings-regular.woff" '(jenkinscat.server/return-file "/fonts/glyphicons-halflings-regular.woff" "application/font-woff")
-})
-
 (def action-handlers
     "Map of action handlers, ie. pages generated dynamically by this tool."
     {"/data.json"                json-data-handler 
@@ -980,6 +940,7 @@
      "/reload-book-list"         reload-books-list-handler
      "/add-book-step-1"          add-book-step-1-handler
      "/add-book-step-2"          add-book-step-2-handler
+     "/add-book-step-3"          add-book-step-3-handler
      "/build-configuration-help" build-configuration-help-handler
      })
 



More information about the docs-commits mailing list