about summary refs log tree commit diff stats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/main/comments.coffee1
-rw-r--r--app/assets/stylesheets/main/entries.scss71
-rw-r--r--app/assets/stylesheets/main/layout.scss51
-rw-r--r--app/controllers/blogs_controller.rb7
-rw-r--r--app/controllers/comments_controller.rb9
-rw-r--r--app/controllers/quotes_controller.rb14
-rw-r--r--app/controllers/streams_controller.rb19
-rw-r--r--app/helpers/application_helper.rb19
-rw-r--r--app/models/blog.rb2
-rw-r--r--app/models/quote.rb9
-rw-r--r--app/models/stream.rb11
-rw-r--r--app/models/update.rb8
-rw-r--r--app/views/admin/blogs/_form.html.haml10
-rw-r--r--app/views/admin/streams/edit.html.haml2
-rw-r--r--app/views/admin/streams/index.html.haml4
-rw-r--r--app/views/admin/updates/edit.html.haml2
-rw-r--r--app/views/comments/_form.html.haml3
-rw-r--r--app/views/layouts/application.html.haml15
-rw-r--r--app/views/layouts/quotes.html.haml1
-rw-r--r--app/views/quotes/search_form.html.haml6
-rw-r--r--app/views/streams/_stream.html.haml8
-rw-r--r--app/views/streams/index.html.haml19
-rw-r--r--app/views/streams/show.html.haml2
-rw-r--r--app/views/updates/_update.html.haml7
24 files changed, 255 insertions, 45 deletions
diff --git a/app/assets/javascripts/main/comments.coffee b/app/assets/javascripts/main/comments.coffee index d33e200..08aa794 100644 --- a/app/assets/javascripts/main/comments.coffee +++ b/app/assets/javascripts/main/comments.coffee
@@ -10,5 +10,4 @@ comments_ready = ->
10 $("#comment-reply-msg").hide() 10 $("#comment-reply-msg").hide()
11 return false 11 return false
12 12
13$(document).ready(comments_ready)
14$(document).on('turbolinks:load', comments_ready) 13$(document).on('turbolinks:load', comments_ready)
diff --git a/app/assets/stylesheets/main/entries.scss b/app/assets/stylesheets/main/entries.scss index 37b0a49..d67ae67 100644 --- a/app/assets/stylesheets/main/entries.scss +++ b/app/assets/stylesheets/main/entries.scss
@@ -3,9 +3,9 @@
3// You can use Sass (SCSS) here: http://sass-lang.com/ 3// You can use Sass (SCSS) here: http://sass-lang.com/
4 4
5.blog-post { 5.blog-post {
6 font-size: 16px; 6 line-height: 1.5em;
7 line-height: 24px;
8 margin: 0 1em 1em; 7 margin: 0 1em 1em;
8 clear: both;
9 9
10 .blog-title { 10 .blog-title {
11 flex-grow: 1; 11 flex-grow: 1;
@@ -41,6 +41,7 @@
41 .post-calendar { 41 .post-calendar {
42 width: 45px; 42 width: 45px;
43 height: 49px; 43 height: 49px;
44 flex-shrink: 0;
44 45
45 &.post-date-1 { 46 &.post-date-1 {
46 background: image-url("date-bg-1.gif") no-repeat; 47 background: image-url("date-bg-1.gif") no-repeat;
@@ -152,7 +153,6 @@
152 153
153 .update-posted { 154 .update-posted {
154 display: block; 155 display: block;
155 font-style: italic;
156 background-color: #EAADEA; 156 background-color: #EAADEA;
157 font-size: 16px; 157 font-size: 16px;
158 margin: .5em -20px; 158 margin: .5em -20px;
@@ -160,6 +160,16 @@
160 border-width: 1px 0 1px 0; 160 border-width: 1px 0 1px 0;
161 border-style: solid; 161 border-style: solid;
162 border-color: #DB70DB; 162 border-color: #DB70DB;
163
164 time {
165 font-style: italic;
166 }
167
168 .update-edit-link {
169 float: right;
170 color: blue;
171 font-weight: normal;
172 }
163 } 173 }
164 } 174 }
165} 175}
@@ -194,6 +204,14 @@
194 box-sizing: border-box; 204 box-sizing: border-box;
195 } 205 }
196 206
207 video {
208 max-width: 100%;
209 }
210
211 iframe {
212 max-width: 100%;
213 }
214
197 figure { 215 figure {
198 background-color: #eee; 216 background-color: #eee;
199 border: 1px solid #bbb; 217 border: 1px solid #bbb;
@@ -201,6 +219,10 @@
201 font-size: 0.75em; 219 font-size: 0.75em;
202 line-height: 24px; 220 line-height: 24px;
203 221
222 @media only screen and (max-width: 767px) {
223 margin: 0;
224 }
225
204 img { 226 img {
205 display: block; 227 display: block;
206 border: 1px solid #bbb; 228 border: 1px solid #bbb;
@@ -450,3 +472,46 @@
450.next-post { 472.next-post {
451 float: right; 473 float: right;
452} 474}
475
476#streams-index {
477 width: 100%;
478 border-collapse: collapse;
479
480 #streams-index-header-row {
481 th {
482 background-color: #bdbdbd;
483 padding-left: 0.5em;
484 border-top: 1px solid #848484;
485 border-bottom: 1px solid #848484;
486 }
487 }
488
489 th {
490 padding-bottom: 0.5em;
491 padding-top: 0.5em;
492 text-align: left;
493 }
494
495 td {
496 padding-top: 1em;
497 padding-left: 0.5em;
498
499 time {
500 font-size: .75em;
501 }
502
503 .stream-link {
504 font-weight: bold;
505 text-decoration: none;
506
507 &, &:visited {
508 color: #ee2c2c;
509 }
510
511 &:hover {
512 text-decoration: underline;
513 color: #9ea1ad;
514 }
515 }
516 }
517}
diff --git a/app/assets/stylesheets/main/layout.scss b/app/assets/stylesheets/main/layout.scss index 5f5d0e6..ef31ada 100644 --- a/app/assets/stylesheets/main/layout.scss +++ b/app/assets/stylesheets/main/layout.scss
@@ -1,42 +1,47 @@
1body#main-body { 1body#main-body {
2 height: 100%; 2 height: 100%;
3 font-family: sans-serif; 3 font-family: sans-serif;
4 font-size: 16px;
4} 5}
5 6
6#container { 7#container {
7 height: 100%; 8 height: 100%;
8 margin: 10px auto;
9 width: 75%; /* 66% */
10 box-sizing: border-box; 9 box-sizing: border-box;
11 min-width: 910px; 10
11 @media only screen and (min-width: 768px) {
12 margin: 10px auto;
13 width: 75%; /* 66% */
14 min-width: 910px;
15 }
12} 16}
13 17
14#banner { 18#banner {
15 background-image: image-url("fourisland_header.png");
16 width: 900px;
17 height: 200px;
18 margin: 0 auto; 19 margin: 0 auto;
19 20
20 h1 { 21 h1 {
21 margin: 0; 22 display: none;
23 }
22 24
23 a { 25 img {
24 display: block; 26 width: 100%;
25 width: 900px; 27 max-width: 900px;
26 height: 200px; 28 display: block;
27 text-indent: -5000px; 29 margin: 0 auto;
28 text-decoration: none;
29 margin: 0;
30 }
31 } 30 }
32} 31}
33 32
34#page-body { 33#page-body {
35 display: flex; 34 display: flex;
35
36 @media only screen and (max-width: 767px) {
37 flex-direction: column-reverse;
38 }
36} 39}
37 40
38#main { 41#main {
39 width: 70%; 42 @media only screen and (min-width: 768px) {
43 width: 70%;
44 }
40} 45}
41 46
42#content { 47#content {
@@ -48,7 +53,8 @@ body#main-body {
48 width: 100%; 53 width: 100%;
49 text-align: center; 54 text-align: center;
50 padding: .25em; 55 padding: .25em;
51 font-weight: bold 56 font-weight: bold;
57 box-sizing: border-box;
52} 58}
53 59
54.flash-notice { 60.flash-notice {
@@ -61,15 +67,22 @@ body#main-body {
61 67
62#sidebar { 68#sidebar {
63 box-sizing: border-box; 69 box-sizing: border-box;
64 width: 30%;
65 font-size: .75em; 70 font-size: .75em;
66 color: black; 71 color: black;
67 margin-top: 1em; 72 margin-top: 1em;
68 margin-bottom: 2em; 73 margin-bottom: 2em;
69 font-family: sans-serif; 74 font-family: sans-serif;
75
76 @media only screen and (max-width: 767px) {
77 width: 100%;
78 }
79
80 @media only screen and (min-width: 768px) {
81 width: 30%;
82 }
70} 83}
71 84
72#sidebar h2 { 85#sidebar h2, #mobile-header h2 {
73 font-size: 1em; 86 font-size: 1em;
74} 87}
75 88
diff --git a/app/controllers/blogs_controller.rb b/app/controllers/blogs_controller.rb index 033d6bb..6e80754 100644 --- a/app/controllers/blogs_controller.rb +++ b/app/controllers/blogs_controller.rb
@@ -1,6 +1,7 @@
1require 'redcarpet/render_strip' 1
2 2
3class BlogsController < ApplicationController 3class BlogsController < ApplicationController
4 include ApplicationHelper
4 5
5 def summary 6 def summary
6 @blogs = Blog.where(published: true).order(published_at: :desc).paginate(page: params[:page], per_page: 10) 7 @blogs = Blog.where(published: true).order(published_at: :desc).paginate(page: params[:page], per_page: 10)
@@ -27,12 +28,12 @@ class BlogsController < ApplicationController
27 @prev = @blog.prev 28 @prev = @blog.prev
28 @next = @blog.next 29 @next = @blog.next
29 30
30 body = Redcarpet::Markdown.new(Redcarpet::Render::StripDown).render(@blog.body) 31 body = stripped_markdown(@blog.body)
31 32
32 set_meta_tags(og: { 33 set_meta_tags(og: {
33 title: @blog.title, 34 title: @blog.title,
34 type: "article", 35 type: "article",
35 description: (body.length <= 300 ? body : body[0..299]), 36 description: body[0, 299],
36 url: blog_url(@blog, host: "www.fourisland.com"), 37 url: blog_url(@blog, host: "www.fourisland.com"),
37 article: { 38 article: {
38 published_time: @blog.published_at.iso8601, 39 published_time: @blog.published_at.iso8601,
diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index b305d0a..31fe411 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb
@@ -5,6 +5,12 @@ class CommentsController < ApplicationController
5 raise ActiveRecord::RecordNotFound unless @blog 5 raise ActiveRecord::RecordNotFound unless @blog
6 raise ActiveRecord::RecordNotFound unless @blog.published 6 raise ActiveRecord::RecordNotFound unless @blog.published
7 7
8 unless verify_recaptcha
9 flash.alert = "Error posting comment."
10 render "blogs/show"
11 return
12 end
13
8 @comment = @blog.comments.new(comment_params) 14 @comment = @blog.comments.new(comment_params)
9 @comment.request_ip = request.ip 15 @comment.request_ip = request.ip
10 @comment.user_agent = request.user_agent 16 @comment.user_agent = request.user_agent
@@ -56,7 +62,8 @@ class CommentsController < ApplicationController
56 CommentMailer.with(comment: @comment).reply_comment_email.deliver_later 62 CommentMailer.with(comment: @comment).reply_comment_email.deliver_later
57 end 63 end
58 else 64 else
59 CommentMailer.with(comment: @comment).new_pending_comment_email.deliver_later 65 # CommentMailer.with(comment: @comment).new_pending_comment_email.deliver_later
66 # I'm disabling pending comment emails, at least for now, because I am getting too many.
60 end 67 end
61 else 68 else
62 flash.alert = "Error posting comment." 69 flash.alert = "Error posting comment."
diff --git a/app/controllers/quotes_controller.rb b/app/controllers/quotes_controller.rb index d4800cb..468f6ea 100644 --- a/app/controllers/quotes_controller.rb +++ b/app/controllers/quotes_controller.rb
@@ -30,6 +30,20 @@ class QuotesController < ApplicationController
30 end 30 end
31 end 31 end
32 32
33 def search_form
34 @q = Quote.published.ransack
35 end
36
37 def search
38 @quotes = Quote.published.ransack(params[:q]).result(distinct: true).paginate(page: params[:page], per_page: 10)
39
40 respond_to do |format|
41 format.html { render :list }
42 format.json { render :json => @quotes }
43 format.xml { render :xml => @quotes }
44 end
45 end
46
33 def random 47 def random
34 picked = Quote.where(state: :published).ids.sample 48 picked = Quote.where(state: :published).ids.sample
35 redirect_to quote_url(picked) 49 redirect_to quote_url(picked)
diff --git a/app/controllers/streams_controller.rb b/app/controllers/streams_controller.rb index 664f533..ec4cee8 100644 --- a/app/controllers/streams_controller.rb +++ b/app/controllers/streams_controller.rb
@@ -1,7 +1,26 @@
1class StreamsController < ApplicationController 1class StreamsController < ApplicationController
2 include ApplicationHelper
3
4 def index
5 @streams = Stream.order(latest_post_at: :desc).paginate(page: params[:page], per_page: 10)
6 end
2 7
3 def show 8 def show
4 @stream = Stream.find_by_slug(params[:slug]) 9 @stream = Stream.find_by_slug(params[:slug])
10 @updates = @stream.updates.paginate(page: params[:page], per_page: 10)
11
12 body = stripped_markdown(@stream.body)
13
14 set_meta_tags(og: {
15 title: @stream.title,
16 type: "article",
17 description: body[0, 299],
18 url: stream_url(@stream, host: "www.fourisland.com"),
19 article: {
20 published_time: @stream.created_at.iso8601,
21 modified_time: @stream.latest_post_at.iso8601
22 }
23 })
5 end 24 end
6 25
7end 26end
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 72d7ab1..a51f1a1 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb
@@ -1,6 +1,7 @@
1require 'redcarpet' 1require 'redcarpet'
2require 'rouge' 2require 'rouge'
3require 'rouge/plugins/redcarpet' 3require 'rouge/plugins/redcarpet'
4require 'redcarpet/render_strip'
4 5
5module ApplicationHelper 6module ApplicationHelper
6 7
@@ -22,7 +23,7 @@ module ApplicationHelper
22 def markdown(text, params = {}) 23 def markdown(text, params = {})
23 options = { fenced_code_blocks: true, highlight: true, footnotes: true } 24 options = { fenced_code_blocks: true, highlight: true, footnotes: true }
24 25
25 html_options = {} 26 html_options = { with_toc_data: true }
26 if params[:restricted] 27 if params[:restricted]
27 html_options[:filter_html] = true 28 html_options[:filter_html] = true
28 end 29 end
@@ -39,4 +40,20 @@ module ApplicationHelper
39 ] 40 ]
40 end 41 end
41 42
43 def friends_sidebar
44 [
45 { title: "Entropically", url: "https://entropically.neocities.org/" },
46 ]
47 end
48
49 class StrippedSummary < Redcarpet::Render::StripDown
50 def block_html(raw_html)
51 nil
52 end
53 end
54
55 def stripped_markdown(text)
56 Redcarpet::Markdown.new(StrippedSummary).render(text)
57 end
58
42end 59end
diff --git a/app/models/blog.rb b/app/models/blog.rb index db05432..03c0619 100644 --- a/app/models/blog.rb +++ b/app/models/blog.rb
@@ -15,7 +15,7 @@ class Blog < ApplicationRecord
15 validates :body, presence: true, if: :published 15 validates :body, presence: true, if: :published
16 validates :slug, presence: true, format: /\A[-a-z0-9]+\z/, if: :published 16 validates :slug, presence: true, format: /\A[-a-z0-9]+\z/, if: :published
17 validates :user, presence: true 17 validates :user, presence: true
18 validates :images, content_type: ['image/png', 'image/jpeg'] 18 validates :images, content_type: ['image/png', 'image/jpeg', 'video/mp4', 'image/gif']
19 19
20 before_validation :set_draft_title 20 before_validation :set_draft_title
21 before_save :set_published_at 21 before_save :set_published_at
diff --git a/app/models/quote.rb b/app/models/quote.rb index 3301667..b1d25b4 100644 --- a/app/models/quote.rb +++ b/app/models/quote.rb
@@ -36,4 +36,13 @@ class Quote < ApplicationRecord
36 def has_tags? 36 def has_tags?
37 !tags.empty? 37 !tags.empty?
38 end 38 end
39
40 def self.ransackable_attributes(auth_object = nil)
41 ["content", "notes"]
42 end
43
44 def self.ransackable_associations(auth_object = nil)
45 []
46 end
47
39end 48end
diff --git a/app/models/stream.rb b/app/models/stream.rb index 0773143..6a738e2 100644 --- a/app/models/stream.rb +++ b/app/models/stream.rb
@@ -8,11 +8,22 @@ class Stream < ApplicationRecord
8 validates :title, presence: true 8 validates :title, presence: true
9 validates :slug, presence: true, format: /\A[-a-z0-9]+\z/ 9 validates :slug, presence: true, format: /\A[-a-z0-9]+\z/
10 10
11 before_create :set_post_timestamp
12
11 def path 13 def path
12 "/thinks/#{slug}" 14 "/thinks/#{slug}"
13 end 15 end
14 16
17 def to_param
18 slug
19 end
20
15 def taggable 21 def taggable
16 self 22 self
17 end 23 end
24
25 private
26 def set_post_timestamp
27 self.latest_post_at = self.created_at
28 end
18end 29end
diff --git a/app/models/update.rb b/app/models/update.rb index 01907d8..a98a5d4 100644 --- a/app/models/update.rb +++ b/app/models/update.rb
@@ -5,6 +5,8 @@ class Update < ApplicationRecord
5 5
6 validates :stream, :body, presence: true 6 validates :stream, :body, presence: true
7 7
8 after_create :set_latest_timestamp
9
8 def path 10 def path
9 "/thinks/#{stream.slug}\#update-#{id}" 11 "/thinks/#{stream.slug}\#update-#{id}"
10 end 12 end
@@ -12,4 +14,10 @@ class Update < ApplicationRecord
12 def taggable 14 def taggable
13 stream 15 stream
14 end 16 end
17
18 private
19 def set_latest_timestamp
20 self.stream.latest_post_at = self.created_at
21 self.stream.save!
22 end
15end 23end
diff --git a/app/views/admin/blogs/_form.html.haml b/app/views/admin/blogs/_form.html.haml index f64ebe5..323d499 100644 --- a/app/views/admin/blogs/_form.html.haml +++ b/app/views/admin/blogs/_form.html.haml
@@ -42,9 +42,13 @@
42 .details-module.image-uploads 42 .details-module.image-uploads
43 %h4 Images 43 %h4 Images
44 - f.object.images.each do |image| 44 - f.object.images.each do |image|
45 = image_tag image.variant(:thumb) 45 - if image.representable?
46 = f.hidden_field :images, multiple: true, value: image.signed_id 46 = image_tag image.variant(:thumb)
47 %pre= rails_blob_url(image) 47 - else
48 = image.filename.to_s
49 - unless image.new_record?
50 = f.hidden_field :images, multiple: true, value: image.signed_id
51 %pre= rails_blob_url(image)
48 %hr 52 %hr
49 = f.file_field :images, multiple: true 53 = f.file_field :images, multiple: true
50 .details-module= f.submit 54 .details-module= f.submit
diff --git a/app/views/admin/streams/edit.html.haml b/app/views/admin/streams/edit.html.haml index 8d910fe..8c250e2 100644 --- a/app/views/admin/streams/edit.html.haml +++ b/app/views/admin/streams/edit.html.haml
@@ -1,3 +1,3 @@
1- title "Editing #{@stream.title}" 1- title "Editing #{@stream.title}"
2= form_for @stream, url: admin_stream_url(@stream), html: { id: "entry-form" } do |f| 2= form_for @stream, url: admin_stream_url(@stream.id), html: { id: "entry-form" } do |f|
3 = render partial: "form", locals: { f: f } 3 = render partial: "form", locals: { f: f }
diff --git a/app/views/admin/streams/index.html.haml b/app/views/admin/streams/index.html.haml index 6903fd1..a2a25d7 100644 --- a/app/views/admin/streams/index.html.haml +++ b/app/views/admin/streams/index.html.haml
@@ -10,5 +10,5 @@
10 %td= stream.created_at.strftime("%B %d, %Y, %l:%M%P") 10 %td= stream.created_at.strftime("%B %d, %Y, %l:%M%P")
11 %td 11 %td
12 %ul.admin-actions 12 %ul.admin-actions
13 %li= link_to "Edit", edit_admin_stream_url(stream) 13 %li= link_to "Edit", edit_admin_stream_url(stream.id)
14 %li= link_to "Add Update", new_admin_stream_update_url(stream) 14 %li= link_to "Add Update", new_admin_stream_update_url(stream.id)
diff --git a/app/views/admin/updates/edit.html.haml b/app/views/admin/updates/edit.html.haml index 75a9957..3cab0b6 100644 --- a/app/views/admin/updates/edit.html.haml +++ b/app/views/admin/updates/edit.html.haml
@@ -1,3 +1,3 @@
1- title "Editing stream update" 1- title "Editing stream update"
2= form_for @update, url: admin_stream_update_url(@stream, @update), html: { id: "entry-form" } do |f| 2= form_for @update, url: admin_stream_update_url(@stream.id, @update), html: { id: "entry-form" } do |f|
3 = render partial: "form", locals: { f: f } 3 = render partial: "form", locals: { f: f }
diff --git a/app/views/comments/_form.html.haml b/app/views/comments/_form.html.haml index 13a0903..12692c2 100644 --- a/app/views/comments/_form.html.haml +++ b/app/views/comments/_form.html.haml
@@ -24,6 +24,9 @@
24 .comment-website-field.comment-field 24 .comment-website-field.comment-field
25 .comment-field-label= f.label :website, "Website (Optional)" 25 .comment-field-label= f.label :website, "Website (Optional)"
26 .comment-field-input= f.text_field :website, type: :url 26 .comment-field-input= f.text_field :website, type: :url
27 .comment-website-field.comment-field
28 .comment-field-label
29 .comment-field-input= recaptcha_tags
27 .comment-submit-button.comment-field 30 .comment-submit-button.comment-field
28 .comment-field-label 31 .comment-field-label
29 .comment-field-input= f.submit "Post" 32 .comment-field-input= f.submit "Post"
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 90ea5e2..1d0bea3 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml
@@ -9,15 +9,16 @@
9 %link{rel: "me", href: "mailto:fefferburbia+thoughts@gmail.com"} 9 %link{rel: "me", href: "mailto:fefferburbia+thoughts@gmail.com"}
10 %link{rel: "webmention", href: webmentions_url} 10 %link{rel: "webmention", href: webmentions_url}
11 %link{rel: "alternate", type: "application/atom+xml", href: blogs_url(format: :atom)} 11 %link{rel: "alternate", type: "application/atom+xml", href: blogs_url(format: :atom)}
12 %meta{name: "viewport", content: "width=device-width, initial-scale=1.0"}
12 %body#main-body 13 %body#main-body
13 - if flash[:alert] 14 - if flash[:alert]
14 %div#flash.flash-alert= flash[:alert] 15 %div#flash.flash-alert= flash[:alert]
15 - if flash[:notice] 16 - if flash[:notice]
16 %div#flash.flash-notice= flash[:notice] 17 %div#flash.flash-notice= flash[:notice]
17 #container 18 #container
18 #page-header 19 %header#banner
19 %header#banner 20 %h1 Four Island
20 %h1= link_to "Four Island", root_url 21 = link_to image_tag("fourisland_header.png"), root_url
21 #page-body 22 #page-body
22 #sidebar 23 #sidebar
23 .sidebar-module 24 .sidebar-module
@@ -53,6 +54,14 @@
53 = link_to link[:title], link[:url], link.include?(:extra) ? link[:extra] : {} 54 = link_to link[:title], link[:url], link.include?(:extra) ? link[:extra] : {}
54 .sidebar-module.fun-links 55 .sidebar-module.fun-links
55 .bubble.rounded 56 .bubble.rounded
57 %h2 Friends
58 %ul
59 - friends_sidebar().each do |link|
60 %li
61 = image_tag "tag_#{cycle("blue", "green", "orange", "pink", "purple", "red", "yellow")}.png"
62 = link_to link[:title], link[:url], link.include?(:extra) ? link[:extra] : {}
63 .sidebar-module.fun-links
64 .bubble.rounded
56 %h2 Blog links 65 %h2 Blog links
57 %ul 66 %ul
58 %li 67 %li
diff --git a/app/views/layouts/quotes.html.haml b/app/views/layouts/quotes.html.haml index 4a7681e..4b21000 100644 --- a/app/views/layouts/quotes.html.haml +++ b/app/views/layouts/quotes.html.haml
@@ -25,6 +25,7 @@
25 - if user_signed_in? 25 - if user_signed_in?
26 %li= link_to_unless_current "Submit", new_quote_url 26 %li= link_to_unless_current "Submit", new_quote_url
27 %li= link_to_unless_current "Tags", tags_quotes_url 27 %li= link_to_unless_current "Tags", tags_quotes_url
28 %li= link_to_unless_current "Search", search_form_quotes_url
28 %li= link_to_unless_current "Stats", stats_quotes_url 29 %li= link_to_unless_current "Stats", stats_quotes_url
29 %li= link_to_unless_current "Feed", latest_quotes_url(:atom) 30 %li= link_to_unless_current "Feed", latest_quotes_url(:atom)
30 - if user_signed_in? 31 - if user_signed_in?
diff --git a/app/views/quotes/search_form.html.haml b/app/views/quotes/search_form.html.haml new file mode 100644 index 0000000..74cdd20 --- /dev/null +++ b/app/views/quotes/search_form.html.haml
@@ -0,0 +1,6 @@
1%h3 Search
2= search_form_for @q, url: search_quotes_url do |f|
3 .form-field
4 = f.label :content_or_notes_cont, "Query:"
5 = f.search_field :content_or_notes_cont
6 .form-field= f.submit
diff --git a/app/views/streams/_stream.html.haml b/app/views/streams/_stream.html.haml index 84a6478..97d4813 100644 --- a/app/views/streams/_stream.html.haml +++ b/app/views/streams/_stream.html.haml
@@ -1,6 +1,8 @@
1%article#stream-post 1%article#stream-post
2 %h2#stream-title= stream.title 2 %h2#stream-title= stream.title
3 - unless stream.body.blank? 3 - unless stream.body.blank?
4 %header#stream-intro.entry-content= stream.body.html_safe 4 %header#stream-intro.entry-content= markdown(stream.body)
5 - unless stream.updates.empty? 5 = will_paginate @updates
6 = render stream.updates 6 - unless @updates.empty?
7 = render @updates
8 = will_paginate @updates
diff --git a/app/views/streams/index.html.haml b/app/views/streams/index.html.haml new file mode 100644 index 0000000..bf5073f --- /dev/null +++ b/app/views/streams/index.html.haml
@@ -0,0 +1,19 @@
1%table#streams-index
2 %tr#streams-index-header-row
3 %th Stream Topic
4 %th Updates
5 %th Last Post
6 - @streams.each do |stream|
7 %tr
8 %td
9 = link_to stream.title, stream, class: "stream-link"
10 %br
11 %time= stream.created_at.strftime("%B #{stream.created_at.day.ordinalize}, %Y at %-I:%M:%S%P")
12 %td= stream.updates.size
13 %td
14 - unless stream.updates.empty?
15 - latest_post = stream.updates.order(created_at: :desc).first
16 = link_to (stripped_markdown(latest_post.body)[0, 30] + "..."), stream
17 %br
18 %time= latest_post.created_at.strftime("%B #{latest_post.created_at.day.ordinalize}, %Y at %-I:%M:%S%P")
19= will_paginate @streams
diff --git a/app/views/streams/show.html.haml b/app/views/streams/show.html.haml index 8365556..8d58f62 100644 --- a/app/views/streams/show.html.haml +++ b/app/views/streams/show.html.haml
@@ -1,3 +1,3 @@
1- title @stream.title 1- title @stream.title
2.breadcrumb= link_to "← Back to home page", root_path 2.breadcrumb= link_to "← Back to streams", streams_path
3= render @stream 3= render @stream
diff --git a/app/views/updates/_update.html.haml b/app/views/updates/_update.html.haml index 57f4158..ceb7d8f 100644 --- a/app/views/updates/_update.html.haml +++ b/app/views/updates/_update.html.haml
@@ -1,3 +1,6 @@
1%section.stream-update.entry-content{ id: "update-#{update.id}" } 1%section.stream-update.entry-content{ id: "update-#{update.id}" }
2 %time.update-posted= update.created_at.strftime("%B #{update.created_at.day.ordinalize}, %Y at %-I:%M:%S%P") 2 %header.update-posted
3 = update.body.html_safe 3 %time= update.created_at.strftime("%B #{update.created_at.day.ordinalize}, %Y at %-I:%M:%S%P")
4 - if user_signed_in? and !update.new_record?
5 = link_to "Edit", edit_admin_stream_update_path(update.stream.id, update), :class => "update-edit-link"
6 = markdown(update.body)