fixesg
This commit is contained in:
@@ -1,5 +1,28 @@
|
||||
class StaticController < ApplicationController
|
||||
def jquery_test
|
||||
def benchmark
|
||||
n = 1_000
|
||||
|
||||
Benchmark.bm do |x|
|
||||
x.report("default") do
|
||||
n.times do
|
||||
view_context.link_to("test", :controller => "posts", :action => "index", :tags => "abc")
|
||||
end
|
||||
end
|
||||
|
||||
x.report("posts_path") do
|
||||
n.times do
|
||||
view_context.link_to("test", posts_path(:tags => "abc"))
|
||||
end
|
||||
end
|
||||
|
||||
x.report("fast link to") do
|
||||
n.times do
|
||||
view_context.fast_link_to("test", :controller => "posts", :action => "index", :tags => "abc")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
render :nothing => true
|
||||
end
|
||||
|
||||
def terms_of_service
|
||||
|
||||
@@ -9,6 +9,38 @@ module ApplicationHelper
|
||||
content_tag("li", link_to(text, url, options), :class => klass)
|
||||
end
|
||||
|
||||
def fast_link_to(text, link_params, options = {})
|
||||
if options
|
||||
attributes = options.map do |k, v|
|
||||
%{#{k}="#{h(v)}"}
|
||||
end.join(" ")
|
||||
else
|
||||
attributes = ""
|
||||
end
|
||||
|
||||
if link_params.is_a?(Hash)
|
||||
action = link_params.delete(:action)
|
||||
controller = link_params.delete(:controller) || controller_name
|
||||
id = link_params.delete(:id)
|
||||
|
||||
link_params = link_params.map {|k, v| "#{k}=#{u(v)}"}.join("&")
|
||||
|
||||
if link_params.present?
|
||||
link_params = "?#{link_params}"
|
||||
end
|
||||
|
||||
if id
|
||||
url = "/#{controller}/#{action}/#{id}#{link_params}"
|
||||
else
|
||||
url = "/#{controller}/#{action}#{link_params}"
|
||||
end
|
||||
else
|
||||
url = link_params
|
||||
end
|
||||
|
||||
raw %{<a href="#{h(url)}" #{attributes}>#{text}</a>}
|
||||
end
|
||||
|
||||
def format_text(text, options = {})
|
||||
DText.parse(text)
|
||||
end
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<% if post.hidden_comment_count(@current_user) > 0 %>
|
||||
<span class="info" id="threshold-comments-notice-for-<%= post.id %>"><%= link_to_remote "#{pluralize post.hidden_comment_count(@current_user), 'comment'} below threshold", :url => {:controller => "comment", :action => "index_all", :post_id => post.id} %>.</span>
|
||||
<span class="info" id="threshold-comments-notice-for-<%= post.id %>"><%= link_to_remote "#{pluralize post.hidden_comment_count(@current_user), 'comment'} below threshold", :url => index_all_comments_path(:post_id => post.id) %>.</span>
|
||||
<% end %>
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
<%= content_tag(:article, raw(DText.sanitize(note.body)), "data-width" => note.width, "data-height" => note.height, "data-x" => note.x, "data-y" => note.y, "data-id" => note.id) %>
|
||||
<article data-width="<%= note.width %>" data-height="<%= note.height %>" data-x="<%= note.x %>" note-y="<%= note.y %>" data-id="<%= note.id %>">
|
||||
<%= raw DText.sanitize(note.body) %>
|
||||
</article>
|
||||
@@ -45,7 +45,7 @@
|
||||
</div>
|
||||
|
||||
<%= content_for(:html_header) do %>
|
||||
<%= auto_discovery_link_tag :atom, :controller => "posts", :action => "index", :format => "atom", :tags => params[:tags] %>
|
||||
<link href="<%= posts_path(:format => 'atom', :tags => params[:tags]) %>" rel="alternate" title="ATOM" type="application/atom+xml" />
|
||||
<% if @post_set.wiki_page %>
|
||||
<meta name="description" content="<%= @post_set.wiki_page.presenter.blurb %>"></meta>
|
||||
<% end %>
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
<section>
|
||||
<h1>History</h1>
|
||||
<ul>
|
||||
<li><%= link_to "Tags", post_versions_path(:search => {:post_id => @post.id}) %></li>
|
||||
<li><%= link_to "Notes", note_versions_path(:search => {:post_id => @post.id}) %></li>
|
||||
<li><%= fast_link_to "Tags", post_versions_path(:search => {:post_id => @post.id}) %></li>
|
||||
<li><%= fast_link_to "Notes", note_versions_path(:search => {:post_id => @post.id}) %></li>
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<li>The Site is presented to you AS IS, without any warranty, express or implied. You will not hold the Site or its staff members liable for damages caused by the use of the site.</li>
|
||||
<li>The Site reserves the right to delete or modify your account, or any content you have posted to the site.</li>
|
||||
<li>You will make a best faith effort to upload only high quality anime-related images.</li>
|
||||
<li>You have read the <%= link_to "tagging guidelines", :controller => "help", :action => "tags" %>.</li>
|
||||
<li>You have read the <%= link_to "tagging guidelines", wiki_pages_path(:title => "help:tags") %>.</li>
|
||||
</ul>
|
||||
|
||||
<div class="section">
|
||||
|
||||
Reference in New Issue
Block a user