stubbed in blank controllers/helpers/functional tests
This commit is contained in:
2
app/controllers/admin/users_controller.rb
Normal file
2
app/controllers/admin/users_controller.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class Admin::UsersController < ApplicationController
|
||||
end
|
||||
22
app/controllers/advertisements_controller.rb
Normal file
22
app/controllers/advertisements_controller.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class AdvertisementsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
@@ -1,3 +1,69 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
before_filter :set_current_user
|
||||
before_filter :initialize_cookies
|
||||
|
||||
protected
|
||||
def access_denied
|
||||
previous_url = params[:url] || request.request_uri
|
||||
|
||||
respond_to do |fmt|
|
||||
fmt.html do
|
||||
if request.get? && Rails.environment != "test"
|
||||
redirect_to new_sessions_path(:url => previous_url), :notice => "Access denied"
|
||||
else
|
||||
redirect_to new_sessions_path, :notice => "Access denied"
|
||||
end
|
||||
end
|
||||
fmt.xml do
|
||||
render :xml => {:success => false, :reason => "access denied"}.to_xml(:root => "response"), :status => 403
|
||||
end
|
||||
fmt.json do
|
||||
render :json => {:success => false, :reason => "access denied"}.to_json, :status => 403
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def set_current_user
|
||||
if @current_user == nil && session[:user_id]
|
||||
@current_user = User.find_by_id(session[:user_id])
|
||||
end
|
||||
|
||||
if @current_user == nil && params[:user]
|
||||
@current_user = User.authenticate(params[:user][:name], params[:user][:password])
|
||||
end
|
||||
|
||||
if @current_user == nil && params[:api]
|
||||
@current_user = User.authenticate(params[:api][:key], params[:api][:hash])
|
||||
end
|
||||
|
||||
if @current_user
|
||||
if @current_user.is_banned? && @current_user.ban && @current_user.ban.expires_at < Time.now
|
||||
@current_user.update_attribute(:is_banned, false)
|
||||
Ban.destroy_all("user_id = #{@current_user.id}")
|
||||
end
|
||||
|
||||
session[:user_id] = @current_user.id
|
||||
else
|
||||
@current_user = AnonymousUser.new
|
||||
end
|
||||
end
|
||||
|
||||
%w(banned privileged contributor janitor moderator admin).each do |level|
|
||||
define_method("#{level}_only") do
|
||||
if @current_user.__send__("is_#{level}?")
|
||||
true
|
||||
else
|
||||
access_denied()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def initialize_cookies
|
||||
if @current_user.is_anonymous?
|
||||
cookies["blacklisted_tags"] = ""
|
||||
else
|
||||
cookies["blacklisted_tags"] = @current_user.blacklisted_tags
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
7
app/controllers/artist_versions_controller.rb
Normal file
7
app/controllers/artist_versions_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class ArtistVersionsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
end
|
||||
25
app/controllers/artists_controller.rb
Normal file
25
app/controllers/artists_controller.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
class ArtistsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
def revert
|
||||
end
|
||||
end
|
||||
19
app/controllers/bans_controller.rb
Normal file
19
app/controllers/bans_controller.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class BansController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
end
|
||||
7
app/controllers/comment_votes_controller.rb
Normal file
7
app/controllers/comment_votes_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class CommentVotesController < ApplicationController
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
7
app/controllers/comments_controller.rb
Normal file
7
app/controllers/comments_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class CommentsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
end
|
||||
13
app/controllers/dmails_controller.rb
Normal file
13
app/controllers/dmails_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class DmailsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
end
|
||||
7
app/controllers/favorites_controller.rb
Normal file
7
app/controllers/favorites_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class FavoritesController < ApplicationController
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
19
app/controllers/forum_posts_controller.rb
Normal file
19
app/controllers/forum_posts_controller.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class ForumPostsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
22
app/controllers/forum_topics_controller.rb
Normal file
22
app/controllers/forum_topics_controller.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class ForumTopicsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
19
app/controllers/janitor_trials_controller.rb
Normal file
19
app/controllers/janitor_trials_controller.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class JanitorTrialsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
end
|
||||
16
app/controllers/jobs_controller.rb
Normal file
16
app/controllers/jobs_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class JobsController < ApplicationController
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
end
|
||||
16
app/controllers/notes_controller.rb
Normal file
16
app/controllers/notes_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class NotesController < ApplicationController
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
4
app/controllers/pool_versions_controller.rb
Normal file
4
app/controllers/pool_versions_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class PoolVersionsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
end
|
||||
25
app/controllers/pools_controller.rb
Normal file
25
app/controllers/pools_controller.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
class PoolsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
def revert
|
||||
end
|
||||
end
|
||||
13
app/controllers/post_moderation_details_controller.rb
Normal file
13
app/controllers/post_moderation_details_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class PostModerationDetailsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
4
app/controllers/post_versions_controller.rb
Normal file
4
app/controllers/post_versions_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class PostVersionsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
end
|
||||
7
app/controllers/post_votes_controller.rb
Normal file
7
app/controllers/post_votes_controller.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class PostVotesController < ApplicationController
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
16
app/controllers/posts_controller.rb
Normal file
16
app/controllers/posts_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
class PostsController < ApplicationController
|
||||
before_filter :member_only, :except => [:show, :index]
|
||||
after_filter :save_recent_tags, :only => [:create, :update]
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def revert
|
||||
end
|
||||
end
|
||||
10
app/controllers/sessions_controller.rb
Normal file
10
app/controllers/sessions_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class SessionsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
19
app/controllers/tag_aliases_controller.rb
Normal file
19
app/controllers/tag_aliases_controller.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class TagAliasesController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
19
app/controllers/tag_implications_controller.rb
Normal file
19
app/controllers/tag_implications_controller.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class TagImplicationsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
22
app/controllers/tag_subscriptions_controller.rb
Normal file
22
app/controllers/tag_subscriptions_controller.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class TagSubscriptionsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
13
app/controllers/tags_controller.rb
Normal file
13
app/controllers/tags_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class TagsController < ApplicationController
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
end
|
||||
13
app/controllers/unapprovals_controller.rb
Normal file
13
app/controllers/unapprovals_controller.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class UnapprovalsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
10
app/controllers/uploads_controller.rb
Normal file
10
app/controllers/uploads_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class UploadsController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
end
|
||||
19
app/controllers/user_feedback_controller.rb
Normal file
19
app/controllers/user_feedback_controller.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class UserFeedbackController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
22
app/controllers/users_controller.rb
Normal file
22
app/controllers/users_controller.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
class UsersController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
end
|
||||
4
app/controllers/wiki_page_versions_controller.rb
Normal file
4
app/controllers/wiki_page_versions_controller.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class WikiPageVersionsController < ApplicationController
|
||||
def index
|
||||
end
|
||||
end
|
||||
25
app/controllers/wiki_pages_controller.rb
Normal file
25
app/controllers/wiki_pages_controller.rb
Normal file
@@ -0,0 +1,25 @@
|
||||
class WikiPagesController < ApplicationController
|
||||
def new
|
||||
end
|
||||
|
||||
def edit
|
||||
end
|
||||
|
||||
def index
|
||||
end
|
||||
|
||||
def show
|
||||
end
|
||||
|
||||
def create
|
||||
end
|
||||
|
||||
def update
|
||||
end
|
||||
|
||||
def destroy
|
||||
end
|
||||
|
||||
def revert
|
||||
end
|
||||
end
|
||||
2
app/helpers/admin/users_helper.rb
Normal file
2
app/helpers/admin/users_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module Admin::UsersHelper
|
||||
end
|
||||
2
app/helpers/advertisements_helper.rb
Normal file
2
app/helpers/advertisements_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module AdvertisementsHelper
|
||||
end
|
||||
@@ -1,2 +1,62 @@
|
||||
module ApplicationHelper
|
||||
def nav_link_to(text, options, html_options = nil)
|
||||
if options[:controller] == params[:controller] || (%w(tag_alias tag_implication).include?(params[:controller]) && options[:controller] == "tag")
|
||||
klass = "current-page"
|
||||
else
|
||||
klass = nil
|
||||
end
|
||||
|
||||
%{<li class="#{klass}">} + fast_link_to(text, options, html_options) + "</li>"
|
||||
end
|
||||
|
||||
def format_text(text, options = {})
|
||||
DText.parse(text)
|
||||
end
|
||||
|
||||
def id_to_color(id)
|
||||
r = id % 255
|
||||
g = (id >> 8) % 255
|
||||
b = (id >> 16) % 255
|
||||
"rgb(#{r}, #{g}, #{b})"
|
||||
end
|
||||
|
||||
def tag_header(tags)
|
||||
unless tags.blank?
|
||||
'/' + Tag.scan_query(tags).map {|t| link_to(h(t.tr("_", " ")), posts_path(:tags => t)}.join("+")
|
||||
end
|
||||
end
|
||||
|
||||
def compact_time(time)
|
||||
if time > Time.now.beginning_of_day
|
||||
time.strftime("%H:%M")
|
||||
elsif time > Time.now.beginning_of_year
|
||||
time.strftime("%b %e")
|
||||
else
|
||||
time.strftime("%b %e, %Y")
|
||||
end
|
||||
end
|
||||
|
||||
def print_preview(post, options = {})
|
||||
unless Danbooru.config.can_see_post?(post, @current_user)
|
||||
return ""
|
||||
end
|
||||
|
||||
options = {:blacklist => true}.merge(options)
|
||||
|
||||
blacklist = options[:blacklist] ? "blacklisted" : ""
|
||||
width, height = post.preview_dimensions
|
||||
image_id = options[:image_id]
|
||||
image_id = %{id="#{h(image_id)}"} if image_id
|
||||
title = "#{h(post.cached_tags)} rating:#{post.rating} score:#{post.score} uploader:#{h(post.uploader_name)}"
|
||||
|
||||
content_for(:blacklist) {"Post.register(#{post.to_json});\n"} if options[:blacklist]
|
||||
|
||||
%{
|
||||
<span class="thumb #{blacklist}" id="p#{post.id}">
|
||||
<a href="/posts/#{post.id}">
|
||||
<img #{image_id} class="preview #{'flagged' if post.is_flagged?} #{'pending' if post.is_pending?}" src="#{post.preview_url}" title="#{title}" alt="#{title}" width="#{width}" height="#{height}">
|
||||
</a>
|
||||
</span>
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
2
app/helpers/artist_versions_helper.rb
Normal file
2
app/helpers/artist_versions_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module ArtistVersionsHelper
|
||||
end
|
||||
2
app/helpers/artists_helper.rb
Normal file
2
app/helpers/artists_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module ArtistsHelper
|
||||
end
|
||||
2
app/helpers/bans_helper.rb
Normal file
2
app/helpers/bans_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module BansHelper
|
||||
end
|
||||
2
app/helpers/comment_votes_helper.rb
Normal file
2
app/helpers/comment_votes_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module CommentVotesHelper
|
||||
end
|
||||
2
app/helpers/comments_helper.rb
Normal file
2
app/helpers/comments_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module CommentsHelper
|
||||
end
|
||||
2
app/helpers/dmails_helper.rb
Normal file
2
app/helpers/dmails_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module DmailsHelper
|
||||
end
|
||||
2
app/helpers/favorites_helper.rb
Normal file
2
app/helpers/favorites_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module FavoritesHelper
|
||||
end
|
||||
2
app/helpers/forum_posts_helper.rb
Normal file
2
app/helpers/forum_posts_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module ForumPostsHelper
|
||||
end
|
||||
2
app/helpers/forum_topics_helper.rb
Normal file
2
app/helpers/forum_topics_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module ForumTopicsHelper
|
||||
end
|
||||
2
app/helpers/janitor_trials_helper.rb
Normal file
2
app/helpers/janitor_trials_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module JanitorTrialsHelper
|
||||
end
|
||||
2
app/helpers/jobs_helper.rb
Normal file
2
app/helpers/jobs_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module JobsHelper
|
||||
end
|
||||
2
app/helpers/notes_helper.rb
Normal file
2
app/helpers/notes_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module NotesHelper
|
||||
end
|
||||
2
app/helpers/pool_versions_helper.rb
Normal file
2
app/helpers/pool_versions_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module PoolVersionsHelper
|
||||
end
|
||||
2
app/helpers/pools_helper.rb
Normal file
2
app/helpers/pools_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module PoolsHelper
|
||||
end
|
||||
2
app/helpers/post_helper.rb
Normal file
2
app/helpers/post_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module PostHelper
|
||||
end
|
||||
2
app/helpers/post_moderation_details_helper.rb
Normal file
2
app/helpers/post_moderation_details_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module PostModerationDetailsHelper
|
||||
end
|
||||
2
app/helpers/post_versions_helper.rb
Normal file
2
app/helpers/post_versions_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module PostVersionsHelper
|
||||
end
|
||||
2
app/helpers/post_votes_helper.rb
Normal file
2
app/helpers/post_votes_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module PostVotesHelper
|
||||
end
|
||||
2
app/helpers/sessions_helper.rb
Normal file
2
app/helpers/sessions_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module SessionsHelper
|
||||
end
|
||||
2
app/helpers/tag_aliases_helper.rb
Normal file
2
app/helpers/tag_aliases_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module TagAliasesHelper
|
||||
end
|
||||
2
app/helpers/tag_implications_helper.rb
Normal file
2
app/helpers/tag_implications_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module TagImplicationsHelper
|
||||
end
|
||||
2
app/helpers/tag_subscriptions_helper.rb
Normal file
2
app/helpers/tag_subscriptions_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module TagSubscriptionsHelper
|
||||
end
|
||||
2
app/helpers/tags_helper.rb
Normal file
2
app/helpers/tags_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module TagsHelper
|
||||
end
|
||||
2
app/helpers/unapprovals_helper.rb
Normal file
2
app/helpers/unapprovals_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module UnapprovalsHelper
|
||||
end
|
||||
2
app/helpers/uploads_helper.rb
Normal file
2
app/helpers/uploads_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module UploadsHelper
|
||||
end
|
||||
2
app/helpers/user_feedback_helper.rb
Normal file
2
app/helpers/user_feedback_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module UserFeedbackHelper
|
||||
end
|
||||
2
app/helpers/users_helper.rb
Normal file
2
app/helpers/users_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module UsersHelper
|
||||
end
|
||||
2
app/helpers/wiki_page_versions_helper.rb
Normal file
2
app/helpers/wiki_page_versions_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module WikiPageVersionsHelper
|
||||
end
|
||||
2
app/helpers/wiki_pages_helper.rb
Normal file
2
app/helpers/wiki_pages_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module WikiPagesHelper
|
||||
end
|
||||
@@ -117,6 +117,10 @@ class User < ActiveRecord::Base
|
||||
self.is_privileged = true
|
||||
end
|
||||
end
|
||||
|
||||
def is_anonymous?
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
module EmailVerificationMethods
|
||||
@@ -137,12 +141,19 @@ class User < ActiveRecord::Base
|
||||
end
|
||||
end
|
||||
|
||||
module BlacklistMethods
|
||||
def blacklisted_tag_array
|
||||
Tag.scan_query(blacklisted_tags)
|
||||
end
|
||||
end
|
||||
|
||||
include NameMethods
|
||||
include PasswordMethods
|
||||
extend AuthenticationMethods
|
||||
include FavoriteMethods
|
||||
include LevelMethods
|
||||
include EmailVerificationMethods
|
||||
include BlacklistMethods
|
||||
|
||||
def can_update?(object, foreign_key = :user_id)
|
||||
is_moderator? || is_admin? || object.__send__(foreign_key) == id
|
||||
|
||||
2
app/presenters/paginator_presenter.rb
Normal file
2
app/presenters/paginator_presenter.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
class PaginatorPresenter
|
||||
end
|
||||
76
app/views/layouts/default.html.erb
Normal file
76
app/views/layouts/default.html.erb
Normal file
@@ -0,0 +1,76 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title><%= yield :page_title %></title>
|
||||
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
|
||||
<link rel="top" title="<%= Danbooru.config.app_name %>" href="/">
|
||||
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
|
||||
<%= stylesheet_link_tag "default" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
<%= Danbooru.config.custom_html_header_content %>
|
||||
<%= yield :html_header_content %>
|
||||
</head>
|
||||
<body>
|
||||
<div id="header">
|
||||
<h2 id="site-title"><%= link_to(Danbooru.config.app_name, "/") %><%= tag_header(params[:tags]) %></h2>
|
||||
<ul class="flat-list" id="nav">
|
||||
<% if @current_user.is_member_or_higher? %>
|
||||
<%= nav_link_to("My Account", user_path(@current_user)) %>
|
||||
<% else %>
|
||||
<%= nav_link_to("Login/Signup", new_session_path) %>
|
||||
<% end %>
|
||||
<%= nav_link_to("Posts", posts_path) %>
|
||||
<%= nav_link_to("Comments", comments_path) %>
|
||||
<%= nav_link_to("Notes", notes_path) %>
|
||||
<%= nav_link_to("Artists", artists_path(:order => "date")) %>
|
||||
<%= nav_link_to("Tags", tags_path(:order => "date")) %>
|
||||
<%= nav_link_to("Pools", pools_path) %>
|
||||
<%= nav_link_to("Wiki", wiki_page_path(:title => "help:home")) %>
|
||||
<%= nav_link_to("Forum", forum_topics_path, :class => (@current_user.has_forum_been_updated? ? "forum-updated" : nil)) %>
|
||||
<%= nav_link_to("»", site_map_help_path) %>
|
||||
</ul>
|
||||
<%= yield :secondary_nav_links %>
|
||||
</div>
|
||||
|
||||
<% if flash[:notice] %>
|
||||
<div id="notice"><%= h flash[:notice] %></div>
|
||||
<% else %>
|
||||
<div id="notice" style="display: none;"></div>
|
||||
<% end %>
|
||||
|
||||
<% if @current_user.has_mail? %>
|
||||
<div class="has-mail" id="has-mail-notice">
|
||||
<%= link_to "You have mail", dmails_path %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if !@current_user.is_privileged? %>
|
||||
<div id="upgrade-account" style="display: none;">
|
||||
<%= link_to "Upgrade your account for only $20", users_help_path %>
|
||||
<%= link_to_function "No thanks", "$('upgrade-account').hide(); Cookie.put('hide-upgrade-account', '1', 7)", :id => "hide-upgrade-account-link" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<% if @current_user.is_banned? %>
|
||||
<div id="ban-reason">
|
||||
You have been banned.
|
||||
<% if @current_user.ban %>
|
||||
Reason: <%= h @current_user.ban.reason %>.
|
||||
Expires: <%= @current_user.ban.expires_at.strftime('%Y-%m-%d') %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div id="content">
|
||||
<%= yield :layout %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
<%= yield :blacklist %>
|
||||
Post.init_blacklisted();
|
||||
Cookie.setup()
|
||||
</script>
|
||||
|
||||
<%= yield :page_footer_content %>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user