Add a fairly nice login page
parent
254cd4788d
commit
2c8d99fd2c
@ -1,28 +1,21 @@
|
||||
(ns verse.web.home
|
||||
(:require [compojure.core :refer :all]
|
||||
(:require [verse.coll :as coll]
|
||||
[verse.util :as util]
|
||||
[hiccup.core :as h]
|
||||
[verse.web :as web]
|
||||
[verse.coll :as coll]
|
||||
[verse.models.model :as model]
|
||||
[verse.util :as util]))
|
||||
|
||||
(defn about-snippet [session]
|
||||
(h/html [:div#about
|
||||
[:p "Dongiverse is a 3D model warehouse where artists can connect with people looking for unique art unattainable at other modelling sites. At Dongiverse, your fantasy can become reality, whether you design and print it yourself or allow someone else to help craft your vision in to reality."]
|
||||
[:p "We bring together some of the most talented 3D modellers with a team of skilled 3D printer operators and plastics engineers to craft high quality toys; whether you want to display them as art, or enjoy them in other ways, the Dongiverse will help bring those dreams to fruition."]]))
|
||||
[verse.models.model :as model]))
|
||||
|
||||
(defn home-snippet [session quip]
|
||||
(let [objects (take coll/page-size (model/get-all))]
|
||||
(concat
|
||||
(h/html [:div.brand-row [:div.row.space-top
|
||||
[:div.small-12.columns
|
||||
(about-snippet session)]]])
|
||||
(web/about-snippet session)
|
||||
(h/html [:div.row
|
||||
[:ul.small-block-grid-4
|
||||
(for [item objects]
|
||||
(util/model-grid-for item))]]))))
|
||||
|
||||
(defn render [session request]
|
||||
(let [quip (verse.util/quip)]
|
||||
(defn render [request]
|
||||
(let [quip (verse.util/quip)
|
||||
session (:session request)]
|
||||
(web/main-template session "Dongiverse" quip
|
||||
(home-snippet session quip))))
|
||||
|
@ -0,0 +1,80 @@
|
||||
(ns verse.web.profile
|
||||
(:require [compojure.core :refer :all]
|
||||
[hiccup.core :as h]
|
||||
[verse.web :as web]
|
||||
[verse.coll :as coll]
|
||||
[verse.models.user :as user]
|
||||
[verse.util :as util]
|
||||
[ring.middleware.anti-forgery :as af]))
|
||||
|
||||
(defn signup-form "Render an HTML form for logging in" [session]
|
||||
[:form {:style "margin-top: 1em;" :action "/profile/new" :method "post" :data-abide "true"}
|
||||
[:input {:type "hidden" :name "__anti-forgery-token" :value af/*anti-forgery-token*}]
|
||||
[:div.row
|
||||
[:div.small-10.columns
|
||||
[:label "My handle"
|
||||
[:input {:type "text" :name "username" :required "true" :pattern "[a-zA-Z]+"}]]
|
||||
[:small.error "Handle is required and contain just alphabet characters."]]
|
||||
[:div.small-2.columns
|
||||
[:span.has-tip {:data-tooltip "true" :aria-haspopup "true" :title "This is a name that you can share with others to find you on the Dongiverse. You'll get your very own super cool dongiverse.com/profile/my-handle URL that you can share with whomever your heart desires."}
|
||||
"What's this?"]]]
|
||||
[:div.row
|
||||
[:div.small-10.columns
|
||||
[:label "My name or nickname"
|
||||
[:input {:type "text" :name "name"}]]]
|
||||
[:div.small-2.columns
|
||||
[:span.has-tip {:data-tooltip "true" :aria-haspopup "true" :title "This is how your name will look on the site. Use a real name, or a stylized version of your handle, if you want. If you leave it blank, we'll use your handle"}
|
||||
"What's this?"]]]
|
||||
[:div.row
|
||||
[:div.small-12.medium-6.columns
|
||||
[:label "My password"
|
||||
[:input {:type "password" :name "pass" :id "pass" :required "true"}]]
|
||||
[:small.error "You need to type in a password."]]
|
||||
[:div.small-12.medium-6.columns
|
||||
[:label "My password again"
|
||||
[:input {:type "password" :name "passconf" :required "true" :data-equalto "pass"}]]
|
||||
[:small.error "Your password confirmation needs to match your password."]]]
|
||||
[:div.row
|
||||
[:div.small-12.columns
|
||||
[:label "My email address"
|
||||
[:input {:type "email" :name "email" :required "true"}]]
|
||||
[:small.error "Email address is required."]]
|
||||
[:div.small-12.columns
|
||||
[:p.info "We know that spam on the internet is really terrible, we're never going to share your email address with anyone unless we ask you first, and we're going to be super duper easy on the emails we send you directly. Promise 😻"]]]
|
||||
[:div.row
|
||||
[:div.small-6.columns
|
||||
[:label "Do you agree to the terms and conditions of this site?"]
|
||||
[:input {:name "toc-agree" :type "checkbox" :required "true"}]
|
||||
[:label {:for "toc-agree"} "Yes I do."]]
|
||||
[:div.small-6.columns
|
||||
[:label "Are you at least 18 years of age?"]
|
||||
[:input {:name "age-agree" :type "checkbox" :required "true"}]
|
||||
[:label {:for "age-agree"} "Yes I am."]]]
|
||||
[:div.row
|
||||
[:div.small-12.medium-6.columns.medium-centered
|
||||
[:button.expand {:type "submit"} "Join the Dongiverse"]]]])
|
||||
|
||||
(defn signup-page "Return a hiccup map of the signup page" [session quip]
|
||||
(h/html [:div.brand-row
|
||||
[:div.row
|
||||
[:div.small-12.columns
|
||||
[:h3 "Join the Dongiverse"]]]]
|
||||
(web/about-snippet session)
|
||||
[:div.brand-row
|
||||
[:div.row
|
||||
[:div.small-12.columns
|
||||
[:div#about
|
||||
[:p "Just because you aren't an artist or maker, doesn't mean that a Dongiverse membership is not for you. You gain access to a forum filled with like-minded connoisseurs of 3D printed paraphenalia, the ability to crate collections and, some day soon, the ability to purchase Dongiverse creations and have them discreetly mailed to you."]]]]]
|
||||
[:div.row
|
||||
[:div.small-12.medium-10.columns.medium-centered
|
||||
(signup-form session)]]))
|
||||
|
||||
(defn new "Render the signup page" [request]
|
||||
(let [quip (verse.util/quip)
|
||||
session (:session request)]
|
||||
(web/main-template session "Dongiverse" quip
|
||||
(signup-page session quip))))
|
||||
|
||||
(defn post-new "Create a new user object from a POST body" [request]
|
||||
(let [session (:session request)]
|
||||
(h/html "hi")))
|
Loading…
Reference in New Issue