Bring the project up to date and rearrange the files

master
Aaron Mueller 8 years ago
parent cd8d113e79
commit 7cce88f523
  1. 9
      project.clj
  2. 0
      resources/css/font-awesome.min.css
  3. 0
      resources/css/layout.css
  4. 0
      resources/css/screen.css
  5. 0
      resources/js/content-browser.js
  6. 0
      resources/js/imagesloaded-3.1.4.pkgd.min.js
  7. 0
      resources/js/jquery-2.0.3.min.js
  8. 0
      resources/js/jquery-2.0.3.min.map
  9. 0
      resources/js/main.js
  10. 0
      resources/js/masonry.pkgd.min.js
  11. 0
      resources/views/layout.html
  12. 3
      src/ldview/core.clj
  13. 2
      src/ldview/db.clj
  14. 7
      src/ldview/handler.clj
  15. 2
      src/ldview/models/competition.clj
  16. 2
      src/ldview/models/entry.clj
  17. 2
      src/ldview/models/source.clj
  18. 2
      src/ldview/models/user.clj
  19. 13
      src/ldview/routes.clj
  20. 13
      src/ldview/routes/home.clj
  21. 6
      src/ldview/templates.clj
  22. 1
      src/ldview/util.clj
  23. 19
      src/ldview/views/layout.clj
  24. 16
      src/ldview/views/templates/entries.html
  25. 21
      src/ldview/views/templates/layout.html

@ -1,19 +1,18 @@
(defproject ldview "2"
:dependencies [[org.clojure/clojure "1.5.1"]
[lib-noir "0.7.9"]
[lib-noir "0.8.2"]
[compojure "1.1.6"]
[ring-server "0.3.1"]
[selmer "0.5.9"]
[com.taoensso/timbre "3.0.0-RC4"]
[com.taoensso/timbre "3.1.6"]
[com.postspectacular/rotor "0.1.0"]
[com.taoensso/tower "2.0.1"]
[com.taoensso/tower "2.1.0-RC1"]
[log4j "1.2.17" :exclusions [javax.mail/mail
javax.jms/jms
com.sun.jdmk/jmxtools
com.sun.jmx/jmxri]]
[sqlitejdbc "0.5.6"]
[korma "0.3.0-RC6"]
[clj-http "0.7.8"]
[clj-http "0.9.1"]
[image-resizer "0.1.6"]
[enlive "1.1.5"]
[me.raynes/fs "1.4.5"]]

@ -2,6 +2,5 @@
(:require [ldview.tasks.runner :as runner])
(:gen-class))
;; TODO: Grab the title from the page
(defn -main [competition-id]
(runner/load-competition competition-id "some title"))
(runner/load-competition competition-id))

@ -1,4 +1,4 @@
(ns ldview.models.db
(ns ldview.db
(:use korma.core
[korma.db :only (defdb)])
(:require [ldview.models.schema :as schema]))

@ -1,12 +1,11 @@
(ns ldview.handler
(:require [compojure.core :refer [defroutes]]
[ldview.routes.home :refer [home-routes]]
[ldview.routes :refer [all-routes]]
[noir.util.middleware :as middleware]
[compojure.route :as route]
[taoensso.timbre :as timbre]
[com.postspectacular.rotor :as rotor]
[ldview.models.schema :as schema])
(:use ldview.util))
[ldview.models.schema :as schema]))
(defroutes app-routes
(route/resources "/")
@ -33,7 +32,7 @@
(def app (middleware/app-handler
;; add your application routes here
[home-routes app-routes]
[all-routes app-routes]
;; add custom middleware here
:middleware []
;; add access rules here

@ -1,6 +1,6 @@
(ns ldview.models.competition
(:use korma.core
[ldview.models.db]))
[ldview.db]))
(defn latest []
(first (select competitions

@ -1,6 +1,6 @@
(ns ldview.models.entry
(:use korma.core
[ldview.models.db])
[ldview.db])
(:require [ldview.models.user :as user]
[ldview.models.competition :as competition]
[ldview.models.source :as source]))

@ -1,6 +1,6 @@
(ns ldview.models.source
(:use korma.core
[ldview.models.db]))
[ldview.db]))
(defn create! [entry_id uri title]
; (if (empty? (select sources (where {:entry_id entry_id :type title})))

@ -1,6 +1,6 @@
(ns ldview.models.user
(:use korma.core
[ldview.models.db]))
[ldview.db]))
(defn user-id [username]
(first (select users

@ -0,0 +1,13 @@
(ns ldview.routes
(:use compojure.core)
(:require [ldview.models.entry :as entry]
[ldview.templates :as templates]))
; TODO: Replace with enlive template stuff
(defn entries-page []
"bla")
; (layout/render "entries.html" {:entries (entry/all) :competition-id 28}))
(defroutes all-routes
(GET "/" [] (entries-page)))

@ -1,13 +0,0 @@
(ns ldview.routes.home
(:use compojure.core)
(:require [ldview.views.layout :as layout]
[ldview.util :as util]
[ldview.models.entry :as entry]))
; TODO: Make dropdown or something to choose the competition-id
(defn entries-page []
(layout/render "entries.html" {:entries (entry/all)
:competition-id 28}))
(defroutes home-routes
(GET "/" [] (entries-page)))

@ -0,0 +1,6 @@
(ns ldview.templates
(:require [net.cgrand.enlive-html :as html]))
(html/deftemplate home-template "../resources/views/layout.html"
[]
[:body] (html/content "test"))

@ -1 +0,0 @@
(ns ldview.util)

@ -1,19 +0,0 @@
(ns ldview.views.layout
(:require [selmer.parser :as parser]
[ring.util.response :refer [content-type response]])
(:import compojure.response.Renderable))
(def template-path "ldview/views/templates/")
(deftype RenderableTemplate [template params]
Renderable
(render [this request]
(content-type
(->> (assoc params :servlet-context (:context request))
(parser/render-file (str template-path template))
response)
"text/html; charset=utf-8")))
(defn render [template & [params]]
(RenderableTemplate. template params))

@ -1,16 +0,0 @@
{% extends "ldview/views/templates/layout.html" %}
{% block content %}
<div id="entries">
{% for entry in entries %}
<div class="entry">
<div class="shadow">
<p>{{entry.title}}</p>
<em>{{entry.author.name}}</em>
</div>
<div class="details"></div>
<a href="http://www.ludumdare.com/compo/ludum-dare-27/?action=preview&uid={{entry.ld_uid}}"><img src="{{servlet-context}}/img/ld{{competition-id}}/thumbs/{{entry.ld_uid}}_0.png" alt="{{entry.title}}" /></a>
</div>
{% endfor %}
</div>
<br style="clear: both" />
{% endblock %}

@ -1,21 +0,0 @@
<!DOCTYPE html PUBLIC "">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ldview -- an alternative Ludum Dare entry viewer</title>
<link href="{{servlet-context}}/css/screen.css" rel="stylesheet" type="text/css">
<script type="text/javascript">var context = "{{servlet-context}}";</script>
<script src="//code.jquery.com/jquery-1.10.1.min.js" type="text/javascript"></script>
<script src="{{servlet-context}}/js/content-browser.js" type="text/javascript"></script>
</head>
<body>
<h1>Ludum Dare submissions viewer</h1>
<div id="container">
{% block content %}
{% endblock %}
</div>
</body>
</html>
Loading…
Cancel
Save