From 24bf21540a04f601b26ed7f7116b3eaa40b3e03d Mon Sep 17 00:00:00 2001 From: albert Date: Tue, 16 Aug 2011 18:47:01 -0400 Subject: [PATCH] refactoring views --- app/assets/javascripts/cookie.js | 12 +--- app/assets/javascripts/news.js | 21 ++++++ app/helpers/advertisements_helper.rb | 2 +- app/presenters/post_presenter.rb | 4 +- app/presenters/post_set_presenter.rb | 2 +- app/presenters/post_set_presenters/base.rb | 2 +- app/views/bans/edit.html.erb | 2 +- app/views/bans/new.html.erb | 2 +- app/views/comments/create.js.erb | 1 + app/views/comments/create.js.rjs | 1 - app/views/comments/index_by_comment.html.erb | 2 +- app/views/comments/index_by_post.html.erb | 4 +- .../comments/partials/index/_list.html.erb | 4 +- app/views/dmails/index.html.erb | 33 +++++----- app/views/dmails/new.html.erb | 9 ++- app/views/dmails/show.html.erb | 5 +- app/views/favorites/index.html.erb | 6 +- app/views/forum_posts/_listing.html.erb | 2 +- app/views/forum_posts/show.html.erb | 2 +- app/views/forum_topics/index.html.erb | 46 +++++++------ app/views/forum_topics/show.html.erb | 4 +- app/views/ip_bans/index.html.erb | 47 +++++++------ app/views/ip_bans/new.html.erb | 16 +++-- app/views/janitor_trials/index.html.erb | 48 +++++++------- app/views/janitor_trials/new.html.erb | 14 ++-- .../moderator/post/dashboards/show.html.erb | 2 +- app/views/news/_listing.html.erb | 2 +- app/views/note_versions/index.html.erb | 2 +- app/views/pool_orders/edit.html.erb | 2 +- app/views/pool_versions/index.html.erb | 2 +- app/views/post_appeals/new.html.erb | 30 +++++---- app/views/post_flags/new.html.erb | 44 +++++++------ app/views/post_versions/index.html.erb | 2 +- app/views/posts/index.html.erb | 12 ++-- app/views/posts/show.html.erb | 16 ++--- app/views/report/common.html.erb | 66 ------------------- app/views/report/tag_history.html.erb | 40 ----------- app/views/sessions/new.html.erb | 4 +- app/views/tag_subscriptions/posts.html.erb | 8 +-- app/views/uploads/index.html.erb | 2 +- app/views/uploads/new.html.erb | 2 +- app/views/uploads/show.html.erb | 2 +- app/views/users/show.html.erb | 2 +- app/views/wiki_page_versions/index.html.erb | 4 +- app/views/wiki_pages/index.html.erb | 2 +- script/delayed_job | 5 ++ 46 files changed, 244 insertions(+), 298 deletions(-) create mode 100644 app/assets/javascripts/news.js create mode 100644 app/views/comments/create.js.erb delete mode 100644 app/views/comments/create.js.rjs delete mode 100644 app/views/report/common.html.erb delete mode 100644 app/views/report/tag_history.html.erb create mode 100755 script/delayed_job diff --git a/app/assets/javascripts/cookie.js b/app/assets/javascripts/cookie.js index 8613c1f85..952bf8647 100644 --- a/app/assets/javascripts/cookie.js +++ b/app/assets/javascripts/cookie.js @@ -50,17 +50,7 @@ location.href = domain + "/static/terms_of_service?url=" + location.href; return; } - - if (this.get("hide-news-ticker") == "1") { - $("#news-ticker").hide(); - } else { - $("#close-news-ticker-link").click(function(e) { - $("#news-ticker").hide(); - Danbooru.Cookie.put("hide-news-ticker", "1", 1); - return false; - }); - } - + if (this.get("hide-upgrade-account") != "1") { $("#upgrade-account").show(); } diff --git a/app/assets/javascripts/news.js b/app/assets/javascripts/news.js new file mode 100644 index 000000000..048928056 --- /dev/null +++ b/app/assets/javascripts/news.js @@ -0,0 +1,21 @@ +(function() { + Danbooru.News = {}; + + Danbooru.News.initialize = function() { + var key = $("#news-ticker").data("updated-at"); + + if (Danbooru.Cookie.get("news-ticker") === key) { + $("#news-ticker").hide(); + } else { + $("#close-news-ticker-link").click(function(e) { + $("#news-ticker").hide(); + Danbooru.Cookie.put("news-ticker", key); + return false; + }); + } + } + + $(function() { + Danbooru.News.initialize(); + }); +})(); diff --git a/app/helpers/advertisements_helper.rb b/app/helpers/advertisements_helper.rb index 08b0218fa..211044b03 100644 --- a/app/helpers/advertisements_helper.rb +++ b/app/helpers/advertisements_helper.rb @@ -22,7 +22,7 @@ module AdvertisementsHelper def render_rss_advertisement if Danbooru.config.can_user_see_ads?(CurrentUser.user) - render :partial => "static/jlist_rss_ads" + render "static/jlist_rss_ads" end end end diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 97d93284c..ec587d9bb 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -26,9 +26,9 @@ class PostPresenter < Presenter return template.content_tag("p", "You need a privileged account to see this image.") if !Danbooru.config.can_user_see_post?(CurrentUser.user, @post) if @post.is_flash? - template.render(:partial => "posts/partials/show/flash", :locals => {:post => @post}) + template.render("posts/partials/show/flash", :post => @post) elsif @post.is_image? - template.render(:partial => "posts/partials/show/image", :locals => {:post => @post}) + template.render("posts/partials/show/image", :post => @post) end end diff --git a/app/presenters/post_set_presenter.rb b/app/presenters/post_set_presenter.rb index 4e4db8f10..754be1c34 100644 --- a/app/presenters/post_set_presenter.rb +++ b/app/presenters/post_set_presenter.rb @@ -18,7 +18,7 @@ class PostSetPresenter < Presenter html = "
" if posts.empty? - return template.render(:partial => "post_sets/blank") + return template.render("post_sets/blank") end posts.each do |post| diff --git a/app/presenters/post_set_presenters/base.rb b/app/presenters/post_set_presenters/base.rb index b2b93dcf6..fb974cb11 100644 --- a/app/presenters/post_set_presenters/base.rb +++ b/app/presenters/post_set_presenters/base.rb @@ -8,7 +8,7 @@ module PostSetPresenters html = "" if posts.empty? - return template.render(:partial => "post_sets/blank") + return template.render("post_sets/blank") end posts.each do |post| diff --git a/app/views/bans/edit.html.erb b/app/views/bans/edit.html.erb index 0e92665d9..3ec7b0115 100644 --- a/app/views/bans/edit.html.erb +++ b/app/views/bans/edit.html.erb @@ -1,7 +1,7 @@

Edit Ban

- <%= render :partial => "form", :locals => {:ban => @ban} %> + <%= render "form", :ban => @ban %>
diff --git a/app/views/bans/new.html.erb b/app/views/bans/new.html.erb index 8c5eaa8e9..32fa507e3 100644 --- a/app/views/bans/new.html.erb +++ b/app/views/bans/new.html.erb @@ -1,7 +1,7 @@

New Ban

- <%= render :partial => "form", :locals => {:ban => @ban} %> + <%= render "form", :ban => @ban %>
diff --git a/app/views/comments/create.js.erb b/app/views/comments/create.js.erb new file mode 100644 index 000000000..57cd03d21 --- /dev/null +++ b/app/views/comments/create.js.erb @@ -0,0 +1 @@ +$("div.comments-for-post[data-post-id=<%= @comment.post_id %>] div.list-of-comments").append("<%= escape_javascript(render('comments/partials/show/comment', :comment => @comment)) %>"); \ No newline at end of file diff --git a/app/views/comments/create.js.rjs b/app/views/comments/create.js.rjs deleted file mode 100644 index ca608485d..000000000 --- a/app/views/comments/create.js.rjs +++ /dev/null @@ -1 +0,0 @@ -page.insert_html(:bottom, "div.comments-for-post[data-post-id=#{@comment.post_id}] div.list-of-comments", :partial => "comments/partials/show/comment", :locals => {:comment => @comment}) diff --git a/app/views/comments/index_by_comment.html.erb b/app/views/comments/index_by_comment.html.erb index b91a566ac..e578873aa 100644 --- a/app/views/comments/index_by_comment.html.erb +++ b/app/views/comments/index_by_comment.html.erb @@ -5,7 +5,7 @@
<% @comments.each do |comment| %> - <%= render :partial => "comments/partials/show/comment", :locals => {:post => comment.post, :comment => comment, :show_header => false} %> + <%= render "comments/partials/show/comment", :post => comment.post, :comment => comment, :show_header => false %> <% end %>
diff --git a/app/views/comments/index_by_post.html.erb b/app/views/comments/index_by_post.html.erb index 1d0f24057..31017ce93 100644 --- a/app/views/comments/index_by_post.html.erb +++ b/app/views/comments/index_by_post.html.erb @@ -11,7 +11,7 @@
<%= link_to(image_tag(post.preview_file_url), post_path(post)) %>
- <%= render :partial => "comments/partials/index/list", :locals => {:post => post, :comments => post.comments.recent.reverse, :show_header => true} %> + <%= render "comments/partials/index/list", :post => post, :comments => post.comments.recent.reverse, :show_header => true %>
<% end %> @@ -20,4 +20,4 @@ -<%= render "comments/secondary_links" %> \ No newline at end of file +<%= render "comments/secondary_links" %> diff --git a/app/views/comments/partials/index/_list.html.erb b/app/views/comments/partials/index/_list.html.erb index f80b48599..6cf5d0a19 100644 --- a/app/views/comments/partials/index/_list.html.erb +++ b/app/views/comments/partials/index/_list.html.erb @@ -1,6 +1,6 @@
<% if show_header %> - <%= render :partial => "comments/partials/index/header", :locals => {:post => post} %> + <%= render "comments/partials/index/header", :post => post %> <% end %>
@@ -15,6 +15,6 @@

<%= link_to "Post comment", new_comment_path, :class => "expand-comment-response" %>

- <%= render :partial => "comments/partials/new/form", :locals => {:post => post} %> + <%= render "comments/partials/new/form", :post => post %>
diff --git a/app/views/dmails/index.html.erb b/app/views/dmails/index.html.erb index 9c52b92ee..084a8e3a6 100644 --- a/app/views/dmails/index.html.erb +++ b/app/views/dmails/index.html.erb @@ -1,18 +1,19 @@
- +
+

Messages

+ + <%= render "search" %> + + + + <% @dmails.each do |dmail| %> + <% if params[:folder] == "sent" %> + <%= render "sent", :dmail => dmail %> + <% else %> + <%= render "received", :dmail => dmail %> + <% end %> + <% end %> + +
+
-

Messages

- -<%= render "search" %> - - - - <% @dmails.each do |dmail| %> - <% if params[:folder] == "sent" %> - <%= render :partial => "sent", :locals => {:dmail => dmail} %> - <% else %> - <%= render :partial => "received", :locals => {:dmail => dmail} %> - <% end %> - <% end %> - -
diff --git a/app/views/dmails/new.html.erb b/app/views/dmails/new.html.erb index afb9d2004..2105c426e 100644 --- a/app/views/dmails/new.html.erb +++ b/app/views/dmails/new.html.erb @@ -1,2 +1,7 @@ -

New Message

-<%= render :partial => "form", :locals => {:dmail => @dmail} %> +
+
+

New Message

+ <%= render "form", :dmail => @dmail %> +
+
+ diff --git a/app/views/dmails/show.html.erb b/app/views/dmails/show.html.erb index d4b5f2e80..7fcf4306b 100644 --- a/app/views/dmails/show.html.erb +++ b/app/views/dmails/show.html.erb @@ -1,8 +1,9 @@ -
-
+
+

<%= @dmail.title %>

<%= format_text(@dmail.body) %> +

<%= link_to "Respond", new_dmail_path(:respond_to_id => @dmail) %> | <%= link_to "Forward", new_dmail_path(:respond_to_id => @dmail, :forward => true) %> diff --git a/app/views/favorites/index.html.erb b/app/views/favorites/index.html.erb index 26c97dbcf..007c0b56c 100644 --- a/app/views/favorites/index.html.erb +++ b/app/views/favorites/index.html.erb @@ -1,11 +1,11 @@

diff --git a/app/views/forum_posts/_listing.html.erb b/app/views/forum_posts/_listing.html.erb index f297c0f7f..9ccfcf307 100644 --- a/app/views/forum_posts/_listing.html.erb +++ b/app/views/forum_posts/_listing.html.erb @@ -1,6 +1,6 @@
<% forum_posts.each do |forum_post| %> - <%= render :partial => "forum_posts/forum_post", :locals => {:forum_post => forum_post} %> + <%= render "forum_posts/forum_post", :forum_post => forum_post %> <% end %>
diff --git a/app/views/forum_posts/show.html.erb b/app/views/forum_posts/show.html.erb index 7240c2d1b..a64619f91 100644 --- a/app/views/forum_posts/show.html.erb +++ b/app/views/forum_posts/show.html.erb @@ -1,6 +1,6 @@
- <%= render :partial => "forum_post", :locals => {:forum_post => @forum_post} %> + <%= render "forum_post", :forum_post => @forum_post %>
diff --git a/app/views/forum_topics/index.html.erb b/app/views/forum_topics/index.html.erb index c03170149..f1ed11ebc 100644 --- a/app/views/forum_topics/index.html.erb +++ b/app/views/forum_topics/index.html.erb @@ -1,24 +1,28 @@ -

Forum

+
+
+

Forum

- - - - - - - - - - - <% @forum_topics.each do |topic| %> - - - - - - - <% end %> - -
TitleCreatorUpdated byUpdated at
<% if topic.is_sticky? %>Sticky: <% end %><%= link_to topic.title, forum_topic_path(topic) %><%= topic.creator.name %><%= topic.updater.name %><%= compact_time topic.updated_at %>
+ + + + + + + + + + + <% @forum_topics.each do |topic| %> + + + + + + + <% end %> + +
TitleCreatorUpdated byUpdated at
<% if topic.is_sticky? %>Sticky: <% end %><%= link_to topic.title, forum_topic_path(topic) %><%= topic.creator.name %><%= topic.updater.name %><%= compact_time topic.updated_at %>
+
+
<%= render "secondary_links" %> \ No newline at end of file diff --git a/app/views/forum_topics/show.html.erb b/app/views/forum_topics/show.html.erb index 457f897fe..41a8d4a96 100644 --- a/app/views/forum_topics/show.html.erb +++ b/app/views/forum_topics/show.html.erb @@ -6,7 +6,7 @@
<% end %> - <%= render :partial => "forum_posts/listing", :locals => {:forum_posts => @forum_posts} %> + <%= render "forum_posts/listing", :forum_posts => @forum_posts %> <%= render "paginator" %>
@@ -14,5 +14,5 @@ <%= render "secondary_links" %> <%= content_for(:page_title) do %> -forum/<%= @forum_topic.title %> + forum/<%= @forum_topic.title %> <% end %> \ No newline at end of file diff --git a/app/views/ip_bans/index.html.erb b/app/views/ip_bans/index.html.erb index 693cf2c79..1dde3dd6a 100644 --- a/app/views/ip_bans/index.html.erb +++ b/app/views/ip_bans/index.html.erb @@ -1,22 +1,27 @@ -

IP Bans

+
+
+

IP Bans

+ + + + + + + + + + + + <% @ip_bans.each do |ip_ban| %> + + + + + + + <% end %> + +
IP AddressBannerReason
<%= ip_ban.ip_addr %><%= ip_ban.creator.name %><%= ip_ban.reason %><%= link_to "Unban", ip_ban_path(ip_ban), :remote => true, :method => :delete, :confirm => "Do your really want to unban #{ip_ban.creator.name}?" %>
+
+
- - - - - - - - - - - <% @ip_bans.each do |ip_ban| %> - - - - - - - <% end %> - -
IP AddressBannerReason
<%= ip_ban.ip_addr %><%= ip_ban.creator.name %><%= ip_ban.reason %><%= link_to "Unban", ip_ban_path(ip_ban), :remote => true, :method => :delete, :confirm => "Do your really want to unban #{ip_ban.creator.name}?" %>
diff --git a/app/views/ip_bans/new.html.erb b/app/views/ip_bans/new.html.erb index e1a05b1a8..24831b118 100644 --- a/app/views/ip_bans/new.html.erb +++ b/app/views/ip_bans/new.html.erb @@ -1,7 +1,11 @@ -

New IP Ban

+
+
+

New IP Ban

-<%= simple_form_for(@ip_ban) do |f| %> - <%= f.input :ip_addr %> - <%= f.input :reason %> - <%= f.button :submit %> -<% end %> + <%= simple_form_for(@ip_ban) do |f| %> + <%= f.input :ip_addr %> + <%= f.input :reason %> + <%= f.button :submit %> + <% end %> +
+
diff --git a/app/views/janitor_trials/index.html.erb b/app/views/janitor_trials/index.html.erb index e33cd33ae..cc5949421 100644 --- a/app/views/janitor_trials/index.html.erb +++ b/app/views/janitor_trials/index.html.erb @@ -1,23 +1,27 @@ -

Janitor Trials

+
+
+

Janitor Trials

- - - - - - - - - - <% @janitor_trials.each do |janitor_trial| %> - - - - - - <% end %> - -
UserDuration
<%= janitor_trial.user.name %><%= janitor_trial.created_at %> - <%= link_to "Promote", promote_janitor_trial_path(janitor_trial), :remote => true, :method => :put %> - | <%= link_to "Demote", demote_janitor_trial_path(janitor_trial), :remote => true, :method => :put %> -
+ + + + + + + + + + <% @janitor_trials.each do |janitor_trial| %> + + + + + + <% end %> + +
UserDuration
<%= janitor_trial.user.name %><%= janitor_trial.created_at %> + <%= link_to "Promote", promote_janitor_trial_path(janitor_trial), :remote => true, :method => :put %> + | <%= link_to "Demote", demote_janitor_trial_path(janitor_trial), :remote => true, :method => :put %> +
+
+
diff --git a/app/views/janitor_trials/new.html.erb b/app/views/janitor_trials/new.html.erb index e4e4edf3e..c23737be5 100644 --- a/app/views/janitor_trials/new.html.erb +++ b/app/views/janitor_trials/new.html.erb @@ -1,6 +1,10 @@ -

New Janitor Trial

+
+
+

New Janitor Trial

-<%= simple_form_for(@janitor_trial) do |f| %> - <%= f.input :user_id %> - <%= f.button :submit %> -<% end %> + <%= simple_form_for(@janitor_trial) do |f| %> + <%= f.input :user_id %> + <%= f.button :submit %> + <% end %> +
+
diff --git a/app/views/moderator/post/dashboards/show.html.erb b/app/views/moderator/post/dashboards/show.html.erb index e42286898..0e660fb6b 100644 --- a/app/views/moderator/post/dashboards/show.html.erb +++ b/app/views/moderator/post/dashboards/show.html.erb @@ -38,4 +38,4 @@
-<%= render :partial => "posts/partials/common/secondary_links" %> \ No newline at end of file +<%= render "posts/partials/common/secondary_links" %> \ No newline at end of file diff --git a/app/views/news/_listing.html.erb b/app/views/news/_listing.html.erb index 82572c6db..6ffdf89f9 100644 --- a/app/views/news/_listing.html.erb +++ b/app/views/news/_listing.html.erb @@ -1,4 +1,4 @@ -
+
diff --git a/app/views/note_versions/index.html.erb b/app/views/note_versions/index.html.erb index a8cac5001..8b10fdfa6 100644 --- a/app/views/note_versions/index.html.erb +++ b/app/views/note_versions/index.html.erb @@ -35,7 +35,7 @@ <%= sequential_paginator(@note_versions) %> - <%= render :partial => "notes/secondary_links" %> + <%= render "notes/secondary_links" %>
diff --git a/app/views/pool_orders/edit.html.erb b/app/views/pool_orders/edit.html.erb index 0d2bb7a5b..978e3c2bc 100644 --- a/app/views/pool_orders/edit.html.erb +++ b/app/views/pool_orders/edit.html.erb @@ -17,4 +17,4 @@
-<%= render :partial => "pools/secondary_links" %> +<%= render "pools/secondary_links" %> diff --git a/app/views/pool_versions/index.html.erb b/app/views/pool_versions/index.html.erb index 67e6ffe38..b6c4c0e09 100644 --- a/app/views/pool_versions/index.html.erb +++ b/app/views/pool_versions/index.html.erb @@ -37,4 +37,4 @@ -<%= render :partial => "pools/secondary_links" %> +<%= render "pools/secondary_links" %> diff --git a/app/views/post_appeals/new.html.erb b/app/views/post_appeals/new.html.erb index 178aa543c..9f19935e1 100644 --- a/app/views/post_appeals/new.html.erb +++ b/app/views/post_appeals/new.html.erb @@ -1,17 +1,21 @@ -

If this post was automatically deleted, then it means at least ten janitors all thought it didn't belong on the site. If you still believe this image was wrongfully deleted, then you can appeal its deletion.

+
+
+

If this post was automatically deleted, then it means at least ten janitors all thought it didn't belong on the site. If you still believe this image was wrongfully deleted, then you can appeal its deletion.

-

Some valid reasons for appealing include:

+

Some valid reasons for appealing include:

-
    -
  • Funny
  • -
  • Weird
  • -
  • Translated
  • -
  • Part of a pool
  • -
+
    +
  • Funny
  • +
  • Weird
  • +
  • Translated
  • +
  • Part of a pool
  • +
-

All users are limited to 5 appeals a day. For more details, please read the <%= link_to "wiki", wiki_pages_path(:title => "help:deletion_appeals") %>.

+

All users are limited to 5 appeals a day. For more details, please read the <%= link_to "wiki", wiki_pages_path(:title => "help:deletion_appeals") %>.

-<%= simple_form_for(@post_appeal, :remote => true, :format => :js) do |f| %> - <%= hidden_field_tag "post_appeal[post_id]", @post_appeal.post_id %> - <%= f.text_field :reason, :size => "40x5" %> -<% end %> + <%= simple_form_for(@post_appeal, :remote => true, :format => :js) do |f| %> + <%= hidden_field_tag "post_appeal[post_id]", @post_appeal.post_id %> + <%= f.text_field :reason, :size => "40x5" %> + <% end %> +
+
diff --git a/app/views/post_flags/new.html.erb b/app/views/post_flags/new.html.erb index 6a588637b..726bcb351 100644 --- a/app/views/post_flags/new.html.erb +++ b/app/views/post_flags/new.html.erb @@ -1,25 +1,29 @@ -

If you believe a post does not belong on this site, you can flag for its deletion. As a reminder, the following are some common reasons for flagging a post:

+
+
+

If you believe a post does not belong on this site, you can flag for its deletion. As a reminder, the following are some common reasons for flagging a post:

-
    -
  • Not anime-related
  • -
  • Furry: a character has body fur or an animal face
  • -
  • Watermark: text or logo inserted by someone besides the original artist
  • -
  • Poor compression: JPEG artifacts
  • -
  • Guro: mutilation, extreme bodily distension
  • -
  • Bad proportions: extremely large breasts or penises
  • -
  • Manga: Multiple pages of a manga, doujinshi, or comic that don't stand up to individual scrutiny
  • -
  • Fake translations: Made up translations are banned
  • -
+
    +
  • Not anime-related
  • +
  • Furry: a character has body fur or an animal face
  • +
  • Watermark: text or logo inserted by someone besides the original artist
  • +
  • Poor compression: JPEG artifacts
  • +
  • Guro: mutilation, extreme bodily distension
  • +
  • Bad proportions: extremely large breasts or penises
  • +
  • Manga: Multiple pages of a manga, doujinshi, or comic that don't stand up to individual scrutiny
  • +
  • Fake translations: Made up translations are banned
  • +
-

The following are NOT valid reasons for flagging a post:

+

The following are NOT valid reasons for flagging a post:

-
    -
  • Duplicate: just parent to the original
  • -
+
    +
  • Duplicate: just parent to the original
  • +
-

Enter a reason:

+

Enter a reason:

-<%= simple_form_for(@post_flag, :remote => true, :format => :js) do |f| %> - <%= f.input :post_id, :as => :hidden %> - <%= f.text_field :reason %> -<% end %> + <%= simple_form_for(@post_flag, :remote => true, :format => :js) do |f| %> + <%= f.input :post_id, :as => :hidden %> + <%= f.text_field :reason %> + <% end %> +
+
diff --git a/app/views/post_versions/index.html.erb b/app/views/post_versions/index.html.erb index a3f4e69f0..54f0a56fa 100644 --- a/app/views/post_versions/index.html.erb +++ b/app/views/post_versions/index.html.erb @@ -11,7 +11,7 @@ <% if @post_versions.empty? %> <%= render "post_sets/blank" %> <% else %> - <%= render :partial => "listing", :locals => {:post_versions => @post_versions} %> + <%= render"listing", :post_versions => @post_versions %> <% end %> diff --git a/app/views/posts/index.html.erb b/app/views/posts/index.html.erb index dcfb18e8a..1fd067734 100644 --- a/app/views/posts/index.html.erb +++ b/app/views/posts/index.html.erb @@ -1,28 +1,28 @@
- <%= render :partial => "wiki_pages/excerpt", :locals => {:post_set => @post_set} %> - <%= render :partial => "posts/partials/index/posts", :locals => {:post_set => @post_set} %> + <%= render "wiki_pages/excerpt", :post_set => @post_set %> + <%= render "posts/partials/index/posts", :post_set => @post_set %>
<% content_for(:page_title) do %> /<%= @post_set.tag_string %> <% end %> - <%= render :partial => "posts/partials/common/secondary_links" %> + <%= render "posts/partials/common/secondary_links" %>
diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 487bb8009..708c0f54f 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -1,12 +1,12 @@
- <%= render :partial => "posts/partials/show/notices", :locals => {:post => @post} %> + <%= render "posts/partials/show/notices", :post => @post %>
@@ -50,7 +50,7 @@
- <%= render :partial => "comments/partials/index/list", :locals => {:comments => @post.comments, :post => @post, :show_header => false} %> + <%= render "comments/partials/index/list", :comments => @post.comments, :post => @post, :show_header => false %>
@@ -62,7 +62,7 @@
- <%= render :partial => "posts/partials/show/edit", :locals => {:post => @post} %> + <%= render "posts/partials/show/edit", :post => @post %>
@@ -93,4 +93,4 @@ <% end %> -<%= render :partial => "posts/partials/common/secondary_links" %> +<%= render "posts/partials/common/secondary_links" %> diff --git a/app/views/report/common.html.erb b/app/views/report/common.html.erb deleted file mode 100644 index fe7889d59..000000000 --- a/app/views/report/common.html.erb +++ /dev/null @@ -1,66 +0,0 @@ -

Report: <%= @report_title %>

- -
-
- <% form_tag({:action => params[:action]}, :method => :get) do %> - - - - - - - - - - - - - - - - - - - - - - - - -
<%= submit_tag "Search" %>
<%= text_field_tag "start_date", @start_date, :size => 10 %>
<%= text_field_tag "end_date", @end_date, :size => 10 %>
<%= text_field_tag "limit", @limit, :size => 5 %>
<%= user_level_select_tag "level", :include_blank => true %>
- <% end %> -
- -
- - - - - - - - - - - - - - - <% @users.each do |user| %> - - - - - - <% end %> - -
UserChangesPercentage
Total<%= @users[0]["sum"].to_i %>
<%= link_to_unless user["id"].nil?, h(user["name"]), :controller => "user", :action => "show", :id => user["id"] %><%= link_to_unless user["id"].nil?, user["change_count"], @change_params.call(user["id"]) %><%= number_to_percentage 100 * user["change_count"] / user["sum"], :precision => 1 %>
-
-
- -<% content_for("subnavbar") do %> -
  • <%= link_to "Tags", :action => "tag_updates", :start_date => @start_date, :end_date => @end_date %>
  • -
  • <%= link_to "Notes", :action => "note_updates", :start_date => @start_date, :end_date => @end_date %>
  • -
  • <%= link_to "Wiki", :action => "wiki_updates", :start_date => @start_date, :end_date => @end_date %>
  • -
  • <%= link_to "Uploads", :action => "post_uploads", :start_date => @start_date, :end_date => @end_date %>
  • -<% end %> diff --git a/app/views/report/tag_history.html.erb b/app/views/report/tag_history.html.erb deleted file mode 100644 index 6fe89e644..000000000 --- a/app/views/report/tag_history.html.erb +++ /dev/null @@ -1,40 +0,0 @@ - - -<% form_tag({:action => "tag_history"}, :method => :get) do %> - - - - - - - - - - - - - - - - - - -
    Tags<%= text_field_tag "tag", params[:tag], :size => 50 %>
    Start Date<%= text_field_tag "start_date", @start_date %>
    End Date<%= text_field_tag "end_date", @end_date %>
    <%= submit_tag "Search" %>
    -<% end %> - -
    - -<% if @counts %> - -<% end %> \ No newline at end of file diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 078a0a7e4..01dac73fe 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -1,5 +1,5 @@ -
    -
    +
    +

    Login

    <%= form_tag(session_path, :class => "simple_form") do %> diff --git a/app/views/tag_subscriptions/posts.html.erb b/app/views/tag_subscriptions/posts.html.erb index f9bb2133b..83d2cc802 100644 --- a/app/views/tag_subscriptions/posts.html.erb +++ b/app/views/tag_subscriptions/posts.html.erb @@ -1,11 +1,11 @@
    @@ -20,7 +20,7 @@ /fav:<%= CurrentUser.name %> <% end %> - <%= render :partial => "posts/partials/common/secondary_links" %> + <%= render "posts/partials/common/secondary_links" %>
    diff --git a/app/views/uploads/index.html.erb b/app/views/uploads/index.html.erb index 4e69ab83e..6d5f4b727 100644 --- a/app/views/uploads/index.html.erb +++ b/app/views/uploads/index.html.erb @@ -27,4 +27,4 @@
    -<%= render :partial => "posts/partials/common/secondary_links" %> \ No newline at end of file +<%= render "posts/partials/common/secondary_links" %> \ No newline at end of file diff --git a/app/views/uploads/new.html.erb b/app/views/uploads/new.html.erb index a0d898bac..a32419019 100644 --- a/app/views/uploads/new.html.erb +++ b/app/views/uploads/new.html.erb @@ -59,4 +59,4 @@ / Upload <% end %> -<%= render :partial => "posts/partials/common/secondary_links" %> +<%= render "posts/partials/common/secondary_links" %> diff --git a/app/views/uploads/show.html.erb b/app/views/uploads/show.html.erb index 97a0ee0ea..589fad3f1 100644 --- a/app/views/uploads/show.html.erb +++ b/app/views/uploads/show.html.erb @@ -21,4 +21,4 @@ <% end %>

    -<%= render :partial => "posts/partials/common/secondary_links" %> +<%= render "posts/partials/common/secondary_links" %> diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb index b043d0852..08902ef97 100644 --- a/app/views/users/show.html.erb +++ b/app/views/users/show.html.erb @@ -51,4 +51,4 @@
    -<%= render :partial => "secondary_links" %> \ No newline at end of file +<%= render "secondary_links" %> \ No newline at end of file diff --git a/app/views/wiki_page_versions/index.html.erb b/app/views/wiki_page_versions/index.html.erb index 13706c24d..633788e5f 100644 --- a/app/views/wiki_page_versions/index.html.erb +++ b/app/views/wiki_page_versions/index.html.erb @@ -1,6 +1,6 @@
    - <%= render :partial => "wiki_pages/sidebar" %> + <%= render "wiki_pages/sidebar" %>

    Wiki Pages

    @@ -37,4 +37,4 @@
    -<%= render :partial => "wiki_pages/secondary_links" %> +<%= render "wiki_pages/secondary_links" %> diff --git a/app/views/wiki_pages/index.html.erb b/app/views/wiki_pages/index.html.erb index 5444615bc..6b003f441 100644 --- a/app/views/wiki_pages/index.html.erb +++ b/app/views/wiki_pages/index.html.erb @@ -1,6 +1,6 @@
    - <%= render :partial => "sidebar" %> + <%= render "sidebar" %>

    Wiki Pages

    diff --git a/script/delayed_job b/script/delayed_job new file mode 100755 index 000000000..edf195985 --- /dev/null +++ b/script/delayed_job @@ -0,0 +1,5 @@ +#!/usr/bin/env ruby + +require File.expand_path(File.join(File.dirname(__FILE__), '..', 'config', 'environment')) +require 'delayed/command' +Delayed::Command.new(ARGV).daemonize