diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-21 00:25:50 -0400 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-10-21 00:25:50 -0400 |
commit | 96813a5e508a54257ef03be613a704f1f71af53d (patch) | |
tree | a50f5c8dc27304a3ca27366b6268a72804727e16 /app/views | |
parent | 2a7a19c93ee0e0d77e4e388d43f36a721c7ab715 (diff) | |
download | thoughts-96813a5e508a54257ef03be613a704f1f71af53d.tar.gz thoughts-96813a5e508a54257ef03be613a704f1f71af53d.tar.bz2 thoughts-96813a5e508a54257ef03be613a704f1f71af53d.zip |
Added quotes database
Diffstat (limited to 'app/views')
-rw-r--r-- | app/views/layouts/quotes.html.haml | 31 | ||||
-rw-r--r-- | app/views/quotes/_quote.html.haml | 16 | ||||
-rw-r--r-- | app/views/quotes/index.atom.builder | 11 | ||||
-rw-r--r-- | app/views/quotes/index.html.haml | 8 | ||||
-rw-r--r-- | app/views/quotes/list.html.haml | 4 | ||||
-rw-r--r-- | app/views/quotes/new.html.erb | 2 | ||||
-rw-r--r-- | app/views/quotes/show.html.haml | 1 | ||||
-rw-r--r-- | app/views/quotes/tags.html.haml | 4 | ||||
-rw-r--r-- | app/views/quotes/voted.js.erb | 12 |
9 files changed, 89 insertions, 0 deletions
diff --git a/app/views/layouts/quotes.html.haml b/app/views/layouts/quotes.html.haml new file mode 100644 index 0000000..6d89d91 --- /dev/null +++ b/app/views/layouts/quotes.html.haml | |||
@@ -0,0 +1,31 @@ | |||
1 | !!! 5 | ||
2 | %html | ||
3 | %head | ||
4 | %title The Four Island Quotes DB | ||
5 | %meta{ :charset => "utf-8" } | ||
6 | = stylesheet_link_tag "quotes" | ||
7 | = javascript_include_tag "application" | ||
8 | = csrf_meta_tag | ||
9 | = auto_discovery_link_tag :atom, latest_quotes_url(:atom) | ||
10 | %body | ||
11 | #wrap | ||
12 | %header#banner | ||
13 | %h1#banner-title= link_to "The Four Island Quotes DB", root_path | ||
14 | #banner-abbr FIQDB | ||
15 | .cleardiv | ||
16 | %nav#top-bar | ||
17 | %ul | ||
18 | %li= link_to_unless_current "Home", quotes_url | ||
19 | %li= link_to_unless_current "Latest", latest_quotes_url | ||
20 | %li= link_to_unless_current "Top", top_quotes_url | ||
21 | %li= link_to_unless_current "Tags", tags_quotes_url | ||
22 | %li= link_to_unless_current "Feed", latest_quotes_url(:atom) | ||
23 | .cleardiv | ||
24 | #page-body | ||
25 | - if flash[:notice] | ||
26 | #flash= flash[:notice] | ||
27 | = yield | ||
28 | %footer | ||
29 | #footer-left= raw "The Four Island Quotes DB is a #{link_to "Four Island", root_url} project and is © hatkirby 2008-#{Time.now.year}" | ||
30 | #footer-right #{Quote.published.count} approved quotes; #{Quote.pending.count} pending quotes | ||
31 | .cleardiv | ||
diff --git a/app/views/quotes/_quote.html.haml b/app/views/quotes/_quote.html.haml new file mode 100644 index 0000000..2a9fb37 --- /dev/null +++ b/app/views/quotes/_quote.html.haml | |||
@@ -0,0 +1,16 @@ | |||
1 | %article.quote{ :id => "quote-#{quote.id}" } | ||
2 | %header.quote-header{ :id => "quote-header-#{quote.id}" } | ||
3 | = link_to_unless (quote.new_record? or current_page?(quote)), "\##{quote.id}", quote, :class => "quote-link" | ||
4 | %span.vote-link{ :id => "quote-upvote-link-#{quote.id}" }= link_to_unless (quote.new_record? or quote.already_upvoted?(request.remote_ip)), "Up", upvote_quote_path(quote.id), :remote => true, :rel => "nofollow", :class => "quote-upvote-link", method: :post | ||
5 | %span.quote-rating{ :id => "quote-rating-#{quote.id}" }= "+#{quote.upvotes}/-#{quote.downvotes}" | ||
6 | %span.vote-link{ :id => "quote-downvote-link-#{quote.id}" }= link_to_unless (quote.new_record? or quote.already_downvoted?(request.remote_ip)), "Down", downvote_quote_path(quote.id), :remote => true, :rel => "nofollow", :class => "quote-downvote-link", method: :post | ||
7 | %datetime= quote.published_date | ||
8 | %blockquote.quote-body= raw quote_format(h(quote.content)) | ||
9 | - if !quote.new_record? and quote.has_extra? | ||
10 | .quote-footer | ||
11 | - if quote.has_notes? | ||
12 | .quote-notes= auto_link(quote.notes, :link => :urls) | ||
13 | - if quote.has_tags? | ||
14 | %ul.quote-tags | ||
15 | - quote.tags.each do |tag| | ||
16 | %li= link_to tag.name, tag_quotes_path(tag.name) | ||
diff --git a/app/views/quotes/index.atom.builder b/app/views/quotes/index.atom.builder new file mode 100644 index 0000000..66849cc --- /dev/null +++ b/app/views/quotes/index.atom.builder | |||
@@ -0,0 +1,11 @@ | |||
1 | atom_feed do |feed| | ||
2 | feed.title("The Four Island Quotes DB") | ||
3 | feed.updated(@quotes.first.created_at) | ||
4 | |||
5 | @quotes.each do |quote| | ||
6 | feed.entry(quote) do |entry| | ||
7 | entry.title("##{quote.id}") | ||
8 | entry.content(quote.content, :type => 'text') | ||
9 | end | ||
10 | end | ||
11 | end | ||
diff --git a/app/views/quotes/index.html.haml b/app/views/quotes/index.html.haml new file mode 100644 index 0000000..d2f667e --- /dev/null +++ b/app/views/quotes/index.html.haml | |||
@@ -0,0 +1,8 @@ | |||
1 | #about-left | ||
2 | #quotes= render @quote | ||
3 | %p.normal Welcome to the Four Island Quotes Database! Here you can find many strange and hopefully humorous Four Island quotes. There are currently #{@qnumber} quotes in the database, and there are #{@mnumber} quotes awaiting moderation. | ||
4 | #about-right | ||
5 | %h3 About | ||
6 | %p.normal The Four Island Quotes DB is a repository for humorous and memorable quotes from #{link_to "FourNet", "http://irc.fourisland.com/"} channels, instant messaging sessions, real life situations, and more. | ||
7 | %p.normal The quotes database, in its first incarnation, was created on #{link_to "April 25th 2008", "http://www.fourisland.com/2008/04/quote-time/"} by hatkirby, who was inspired by #{link_to "bash.org", "http://bash.org/"} and his obsession with record-keeping to create a quotes database for Four Island. It ran on the now-defunct PHP quote management system, #{link_to "rash", "http://rqms.sourceforge.net/"}, on the subdomain "<code>quotes.fourisland.com</code>". It was rewritten by hand and integrated into Four Island (at the URL "<code>fourisland.com/quotes</code>") by hatkirby on #{link_to "June 13th 2008", "http://www.fourisland.com/2008/06/the-new-four-island/"} with the release of Four Island 2, dubbed The New Four Island. With the release of Four Island 3 on #{link_to "September 22nd, 2011", "http://www.fourisland.com/2011/09/four-island-3/"}, it was rewritten in Ruby on Rails, disassociated from Four Island and returned to its original URL. | ||
8 | .cleardiv | ||
diff --git a/app/views/quotes/list.html.haml b/app/views/quotes/list.html.haml new file mode 100644 index 0000000..12c95c0 --- /dev/null +++ b/app/views/quotes/list.html.haml | |||
@@ -0,0 +1,4 @@ | |||
1 | %section#quotes | ||
2 | .pagination= will_paginate @quotes | ||
3 | = render @quotes | ||
4 | .pagination= will_paginate @quotes | ||
diff --git a/app/views/quotes/new.html.erb b/app/views/quotes/new.html.erb new file mode 100644 index 0000000..a4c6a0a --- /dev/null +++ b/app/views/quotes/new.html.erb | |||
@@ -0,0 +1,2 @@ | |||
1 | <h1>Quotes#new</h1> | ||
2 | <p>Find me in app/views/quotes/new.html.erb</p> | ||
diff --git a/app/views/quotes/show.html.haml b/app/views/quotes/show.html.haml new file mode 100644 index 0000000..b28c879 --- /dev/null +++ b/app/views/quotes/show.html.haml | |||
@@ -0,0 +1 @@ | |||
%section#quotes= render @quote | |||
diff --git a/app/views/quotes/tags.html.haml b/app/views/quotes/tags.html.haml new file mode 100644 index 0000000..e15b386 --- /dev/null +++ b/app/views/quotes/tags.html.haml | |||
@@ -0,0 +1,4 @@ | |||
1 | %h2 Tag Cloud | ||
2 | %ul#tags-container | ||
3 | - tag_cloud(@tags, %w(css1 css1_5 css2 css2_5 css3 css3_5 css4 css4_5 css5 css5_5 css6)) do |tag, css_class| | ||
4 | %li= link_to tag.name, tag_quotes_path(tag.name), :class => css_class | ||
diff --git a/app/views/quotes/voted.js.erb b/app/views/quotes/voted.js.erb new file mode 100644 index 0000000..c697c7d --- /dev/null +++ b/app/views/quotes/voted.js.erb | |||
@@ -0,0 +1,12 @@ | |||
1 | $("#quote-rating-<%= @quote.id %>").html('<%= escape_javascript("+#{@quote.upvotes}/-#{@quote.downvotes}") %>'); | ||
2 | |||
3 | <% if @quote.already_upvoted? request.remote_ip %> | ||
4 | $("#quote-upvote-link-<%= @quote.id %>").html("Up"); | ||
5 | <% elsif @quote.already_downvoted? request.remote_ip %> | ||
6 | $("#quote-downvote-link-<%= @quote.id %>").html("Down"); | ||
7 | <% else %> | ||
8 | $("#quote-upvote-link-<%= @quote.id %>").html('<%= escape_javascript(link_to("Up", upvote_quote_path(@quote.id), :remote => true, :rel => "nofollow", :class => "quote-upvote-link", method: :post)) %>'); | ||
9 | $("#quote-downvote-link-<%= @quote.id %>").html('<%= escape_javascript(link_to("Down", downvote_quote_path(@quote.id), :remote => true, :rel => "nofollow", :class => "quote-downvote-link", method: :post)) %>'); | ||
10 | <% end %> | ||
11 | |||
12 | $("#quote-header-<%= @quote.id %>").effect('highlight', {}, 2000); | ||