Browse code
various changes
fiddlerwoaroof authored on 23/01/2016 05:13:48
Showing 3 changed files
Showing 3 changed files
... | ... |
@@ -46,7 +46,7 @@ |
46 | 46 |
|
47 | 47 |
(defun make-submission (headline url &key (approved "")) |
48 | 48 |
(make-instance 'submission :headline headline :url url :approved approved |
49 |
- :date )) |
|
49 |
+ :date (current-date-string))) |
|
50 | 50 |
|
51 | 51 |
(defun submission-alist (submission) |
52 | 52 |
`(("headline". ,(s-headline submission)) |
... | ... |
@@ -89,18 +89,18 @@ |
89 | 89 |
(setf (ningle:route *app* "/") |
90 | 90 |
(i-lambda (params) |
91 | 91 |
(ningle.context:with-context-variables (session) |
92 |
- (handler-case |
|
93 |
- (cl-oid-connect.utils:ensure-logged-in |
|
94 |
- (cl-oid-connect.utils:redirect-if-necessary session |
|
95 |
- (render-mustache #p"static/index.mustache.html" |
|
96 |
- `((:links . ,(mapcar #'submission-alist *submissions*)) |
|
97 |
- (:user . ,(user-alist (gethash :app-user session))))))) |
|
98 |
- (cl-oid-connect.utils:user-not-logged-in (c) (render-mustache #p"static/index.mustache.html" |
|
99 |
- nil)))))) |
|
92 |
+ (handler-case |
|
93 |
+ (cl-oid-connect.utils:ensure-logged-in |
|
94 |
+ (cl-oid-connect.utils:redirect-if-necessary session |
|
95 |
+ (render-mustache #p"static/index.mustache.html" |
|
96 |
+ `((:links . ,(mapcar #'submission-alist *submissions*)) |
|
97 |
+ (:user . ,(user-alist (gethash :app-user session))))))) |
|
98 |
+ (cl-oid-connect.utils:user-not-logged-in (c) (render-mustache #p"static/index.mustache.html" |
|
99 |
+ nil)))))) |
|
100 | 100 |
|
101 | 101 |
(defun submit (params) |
102 | 102 |
(awhen (alist-submission params :nil-if-exists t) |
103 |
- (format t "~s <<<" it) |
|
103 |
+ ;(format t "~s <<<" it) |
|
104 | 104 |
(push it *submissions*))) |
105 | 105 |
|
106 | 106 |
(defun get-by-key (headline url) |
... | ... |
@@ -126,14 +126,14 @@ |
126 | 126 |
(i-lambda (params) |
127 | 127 |
`(200 () |
128 | 128 |
(,(cl-who:with-html-output-to-string (s) |
129 |
- (:html |
|
130 |
- (:head |
|
131 |
- (:title "Login") |
|
132 |
- (:link :rel "stylesheet" :href "/static/css/login.css")) |
|
133 |
- (:body |
|
134 |
- (:h1 "In Angulis") |
|
135 |
- (:div :class "login-buttons" |
|
136 |
- (:a :class "facebook" :href "/login/facebook" "Login With Facebook"))))))))) |
|
129 |
+ (:html |
|
130 |
+ (:head |
|
131 |
+ (:title "Login") |
|
132 |
+ (:link :rel "stylesheet" :href "/static/css/login.css")) |
|
133 |
+ (:body |
|
134 |
+ (:h1 "In Angulis") |
|
135 |
+ (:div :class "login-buttons" |
|
136 |
+ (:a :class "facebook" :href "/login/facebook" "Login With Facebook"))))))))) |
|
137 | 137 |
|
138 | 138 |
(cl-oid-connect:def-route ("/logout" (params) :app *app*) |
139 | 139 |
(declare (ignore params)) |
... | ... |
@@ -18,6 +18,7 @@ body { |
18 | 18 |
font-size: 14px; |
19 | 19 |
font-family: 'Alegreya Sans', sans-serif; |
20 | 20 |
padding-bottom: 6em; |
21 |
+ margin-top: -1.5em; |
|
21 | 22 |
} |
22 | 23 |
|
23 | 24 |
h1 { |
... | ... |
@@ -167,9 +168,11 @@ ul#submissions li { |
167 | 168 |
ul#submissions li.in-progress { |
168 | 169 |
position: relative; |
169 | 170 |
margin-top: 1.5em; |
170 |
- font-size: 0.9em; |
|
171 |
+ font-size: 1.1em; |
|
171 | 172 |
background: #eee; |
172 | 173 |
padding: 1em; |
174 |
+ text-shadow: 0em 0em 0.2em white; |
|
175 |
+ letter-spacing: 1px; |
|
173 | 176 |
} |
174 | 177 |
|
175 | 178 |
ul#submissions li.submission:first-child { |
... | ... |
@@ -218,17 +221,18 @@ a:active, a:hover { text-decoration: underline; } |
218 | 221 |
border-radius: 0.2em; |
219 | 222 |
border: 3px double #888; |
220 | 223 |
position: absolute; |
221 |
- font-size: 0.9em; |
|
222 |
- right: 1em; |
|
223 |
- top: 1em; |
|
224 |
+ right: 0em; |
|
225 |
+ top: 0em; |
|
224 | 226 |
text-align: center; |
227 |
+ text-shadow: 0em 0em 0.2em white; |
|
228 |
+ border-bottom-left-radius: 3.5em; |
|
225 | 229 |
} |
226 | 230 |
|
227 | 231 |
.userinfo .user { |
228 | 232 |
font-size: 1.5em; |
229 | 233 |
} |
230 | 234 |
.userinfo .email { |
231 |
- color: #888; |
|
235 |
+ color: #666; |
|
232 | 236 |
} |
233 | 237 |
body > div.userinfo > a#logout { |
234 | 238 |
width: 100%; |
... | ... |
@@ -17,15 +17,24 @@ |
17 | 17 |
</div> |
18 | 18 |
{{/user}} |
19 | 19 |
<main id="app"> |
20 |
- <form action="/murmuro" id="submission" name="submission" method="POST" v-on:submit="submit"> |
|
20 |
+ <form action="/murmuro" id="submission" name="submission" method="POST"> |
|
21 | 21 |
<input type="text" name="headline" placeholder="Headline" v-model="newLink.headline"> |
22 | 22 |
<input type="text" name="url" placeholder="URL" v-model="newLink.url"> |
23 | 23 |
<input type="submit" value="Go" title='Murmuro'> |
24 | 24 |
</form> |
25 | 25 |
|
26 | 26 |
<ul id="submissions"> |
27 |
+ <li class="in-progress hidden" v-if="newLink.headline !== undefined || newLink.url !== undefined"> |
|
28 |
+ <a href="#"> |
|
29 |
+ {{=<% %>=}} |
|
30 |
+ <h2>{{ newLink.headline }}</h2> |
|
31 |
+ <p>{{ newLink.url }}</p> |
|
32 |
+ <%={{ }}=%> |
|
33 |
+ </a> |
|
34 |
+ </li> |
|
35 |
+ |
|
27 | 36 |
{{#links}} |
28 |
- <li class="submission" v-for="link in links"> |
|
37 |
+ <li class="submission"> |
|
29 | 38 |
{{#user}} |
30 | 39 |
{{#moderator}} |
31 | 40 |
<div class="moderation"> |
... | ... |
@@ -49,29 +58,27 @@ |
49 | 58 |
|
50 | 59 |
<script src="/static/js/jquery.js"></script> |
51 | 60 |
<script src="/static/js/jquery.formalize.js"></script> |
52 |
-<!-- |
|
53 |
- - <script src="/static/js/vue.js"></script> |
|
54 |
- - <script type="text/javascript"> |
|
55 |
- -new Vue({ |
|
56 |
- - el: '#app', |
|
57 |
- - |
|
58 |
- - methods: { |
|
59 |
- - submit: function(e) { |
|
60 |
- - e.preventDefault(); |
|
61 |
- - this.links.unshift(0,Object.create(this.newLink)); |
|
62 |
- - this.newLink = {}; |
|
63 |
- - return false; |
|
64 |
- - } |
|
65 |
- - }, |
|
66 |
- - |
|
67 |
- - data: { |
|
68 |
- - newLink: { |
|
69 |
- - }, |
|
70 |
- - links: [ {{ jsondata }} ] |
|
71 |
- - } |
|
72 |
- -}); |
|
73 |
- - </script> |
|
74 |
- --> |
|
61 |
+ <script src="/static/js/vue.js"></script> |
|
62 |
+ <script type="text/javascript"> |
|
63 |
+ new Vue({ |
|
64 |
+ el: '#app', |
|
65 |
+ |
|
66 |
+ methods: { |
|
67 |
+ submit: function(e) { |
|
68 |
+ e.preventDefault(); |
|
69 |
+ this.links.unshift(0,Object.create(this.newLink)); |
|
70 |
+ this.newLink = {}; |
|
71 |
+ return false; |
|
72 |
+ } |
|
73 |
+ }, |
|
74 |
+ |
|
75 |
+ data: { |
|
76 |
+ newLink: { |
|
77 |
+ }, |
|
78 |
+ } |
|
79 |
+ }); |
|
80 |
+ jQuery('.hidden.in-progress').removeClass('hidden'); |
|
81 |
+ </script> |
|
75 | 82 |
</body> |
76 | 83 |
</html> |
77 | 84 |
|