Replace references to Danbooru with Danbooru.config.app_name.

* Also replace references to github with a configurable repo.
* Plus link commit ref in footer to the commit in the repo.
This commit is contained in:
evazion
2016-10-24 18:06:39 -05:00
parent 58ef469a76
commit fd4eb8fa08
4 changed files with 22 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
<footer id="page-footer">
Running Danbooru <%= link_to "v#{Danbooru.config.version}", "https://github.com/r888888888/danbooru/releases" %>
Running <%= Danbooru.config.app_name %> <%= link_to "v#{Danbooru.config.version}", Danbooru.config.releases_url %>
<% if Rails.application.config.x.git_hash %>
(<%= Rails.application.config.x.git_hash %>)
(<%= link_to Rails.application.config.x.git_hash, Danbooru.config.commit_url(Rails.application.config.x.git_hash) %>)
<% end %>
&ndash; <%= link_to "Rules", terms_of_service_path %>
&ndash; <%= link_to "Contact", contact_path %>

View File

@@ -2,13 +2,13 @@
<div id="a-boomkarklet">
<h1>Bookmarklet</h1>
<p><%= link_to "Post to Danbooru", "javascript:location.href='http://#{Danbooru.config.hostname}/uploads/new?url='+encodeURIComponent(location.href)+'&ref='+encodeURIComponent(document.referrer)" %></p>
<p><%= link_to "Post to #{Danbooru.config.app_name}", "javascript:location.href='http://#{Danbooru.config.hostname}/uploads/new?url='+encodeURIComponent(location.href)+'&ref='+encodeURIComponent(document.referrer)" %></p>
<p>Bookmark this link. Next time you are directly viewing an image (that is, the JPG/PNG/GIF file is in the URL bar) you can open this bookmarklet and you will be taken to the upload page. Depending on the site you are uploading from you may also see some options for fetching metadata.</p>
<p>The bookmarklet can also intelligently fetch artist/tag data from specific sites like Pixiv, Nico Seiga, Twitter, DeviantArt, and others. If you wish to preserve an HTML link for the source, you can use the bookmarklet on the HTML page containing the image. The bookmarklet will find the image URL and automatically download the largest version.</p>
<p><%= link_to "Batch to Danbooru", "javascript:location.href='http://#{Danbooru.config.hostname}/uploads/batch?url='+encodeURIComponent(location.href)" %></p>
<p><%= link_to "Batch to #{Danbooru.config.app_name}", "javascript:location.href='http://#{Danbooru.config.hostname}/uploads/batch?url='+encodeURIComponent(location.href)" %></p>
<p>Use this bookmarklet for Twitter and Pixiv galleries. Use it on the HTML page.</p>
</div>

View File

@@ -20,8 +20,8 @@
</ul>
<ul>
<li><h1>Tools</h1></li>
<li><%= link_to("Source Code", "https://github.com/r888888888/danbooru") %></li>
<li><%= link_to("Bug Reports", "https://github.com/r888888888/danbooru/issues") %></li>
<li><%= link_to("Source Code", Danbooru.config.source_code_url) %></li>
<li><%= link_to("Bug Reports", Danbooru.config.issues_url) %></li>
<li><%= link_to("Keyboard Shortcuts", keyboard_shortcuts_path) %></li>
<li><%= link_to("Bookmarklet", bookmarklet_path) %></li>
<li><%= link_to("API Documentation", wiki_pages_path(:title => "help:api")) %></li>

View File

@@ -34,6 +34,22 @@ module Danbooru
contact_email
end
def source_code_url
"https://github.com/r888888888/danbooru"
end
def commit_url(hash)
"#{source_code_url}/commit/#{hash}"
end
def releases_url
"#{source_code_url}/releases"
end
def issues_url
"#{source_code_url}/issues"
end
# Stripped of any special characters.
def safe_app_name
app_name.gsub(/[^a-zA-Z0-9_-]/, "_")