added limit methods to user, more work on post views

This commit is contained in:
albert
2010-03-12 15:18:30 -05:00
parent 9f29ffc8c3
commit 9eb578927c
18 changed files with 282 additions and 108 deletions

View File

@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<title><%= yield(:page_title) || Danbooru.config.app_name %></title>
<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="/">
<%= csrf_meta_tag %>
@@ -17,7 +17,7 @@
</head>
<body>
<nav>
<h1><%= link_to(Danbooru.config.app_name, "/") %><%= yield :page_header %></h1>
<h1><%= link_to(Danbooru.config.app_name, "/") %><%= yield :page_title %></h1>
<menu>
<% if @current_user.is_anonymous? %>
<%= nav_link_to("Login", new_session_path) %>

View File

@@ -0,0 +1,13 @@
<% content_for(:secondary_nav_links) do %>
<menu>
<li>Listing</li>
<li><%= link_to "Upload", new_upload_path %></li>
<li>Popular</li>
<li>Favorites</li>
<li>Subscriptions</li>
<li>Changes</li>
<li>Approvals</li>
<li>Moderate</li>
<li>Help</li>
</menu>
<% end %>

View File

@@ -18,10 +18,10 @@
<h1>Mode</h1>
<form action="/">
<select name="mode">
<option value="view">View posts</option>
<option value="edit">Edit posts</option>
<option value="add-fav">Add to favorites</option>
<option value="remove-fav">Remove from favorites</option>
<option value="view">View</option>
<option value="edit">Edit</option>
<option value="add-fav">Favorite</option>
<option value="remove-fav">Unfavorite</option>
<option value="rating-s">Rate safe</option>
<option value="rating-q">Rate questionable</option>
<option value="rating-e">Rate explicit</option>
@@ -32,9 +32,9 @@
<option value="edit-tag-script">Edit tag script</option>
<option value="apply-tag-script">Apply tag script</option>
<% if @current_user.is_janitor? %>
<option value="approve">Approve post</option>
<option value="approve">Approve</option>
<% end %>
<option value="flag">Flag post</option>
<option value="unapprove">Unapprove</option>
</select>
</form>
</section>
@@ -82,16 +82,4 @@
/ <%= @post_set.tags %>
<% end %>
<% content_for(:secondary_nav_links) do %>
<menu>
<li>Listing</li>
<li>Upload</li>
<li>Popular</li>
<li>Favorites</li>
<li>Subscriptions</li>
<li>Changes</li>
<li>Approvals</li>
<li>Moderate</li>
<li>Help</li>
</menu>
<% end %>
<%= render :partial => "posts/common_secondary_nav_links" %>

View File

@@ -0,0 +1,54 @@
<div id="upload-guide-notice">
<p>Before uploading, please read the <%= link_to "how to upload guide", wiki_page_path("howto:upload") %>. It explains how to tag and what ratings are.</p>
</div>
<% form_for @upload do |f| %>
<% if params[:url] %>
<div id="image-preview">
<%= image_tag(params[:url], :title => "Preview") %>
<p id="scale"></p>
</div>
<% if @post %>
<p>This post was probably already uploaded (<%= link_to "post ##{@post.id}", posts_path(@post), :target => "_blank" %>).</p>
<% end %>
<% end %>
<fieldset>
<legend>Upload</legend>
<p>
<%= f.label :file %>
<%= f.file_field :file, :size => 50 %>
</p>
<p>
<%= f.label :source, nil, :title => "You can enter a URL to have #{Danbooru.config.app_name} automatically download and process it" %>
<%= f.text_field :source, :size => 50, :value => params[:url] %>
</p>
<p>
<%= f.label :tag_string, "Tags" %>
<%= f.text_area :tag_string, :size => "60x4" %>
</p>
<p>
<%= f.label :rating_e, "Explicit", :title => "Hardcore porn, visible genitals, gore" %>
<%= f.radio_button :rating, :e %>
<%= f.label :rating_q, "Questionable", :title => "Nudity, anything erotic" %>
<%= f.radio_button :rating, :q %>
<%= f.label :rating_s, "Safe", :title => "Everything else" %>
<%= f.radio_button :rating, :s %>
</p>
<p>
<%= submit_tag "Submit" %>
</p>
</fieldset>
<% end %>
<% content_for(:page_title) do %>
/ Upload
<% end %>

View File

@@ -1,39 +1,45 @@
<% form_for @user do |f| %>
<p>Hover over the labels to see a brief explanation of the setting. Required fields are marked in red.</p>
<fieldset>
<legend>Basic</legend>
<p>
<%= f.label :email %>
<%= f.text_field :email %>
<% if Danbooru.config.enable_email_verification? %>
<%= f.text_field :email %>
<% else %>
<%= f.text_field :email, :class => "required" %>
<% end %>
</p>
<p>
<%= f.label :receive_email_notifications, "Email notifications" %>
<%= f.label :receive_email_notifications, "Email notifications", :title => "Enable to receive email notification when you receive a DMail" %>
<%= f.check_box :receive_email_notifications %>
</p>
<p>
<%= f.label :comment_threshold %>
<%= f.label :comment_threshold, nil, :title => "Comments below this score will be hidden by default" %>
<%= f.text_field :comment_threshold, :size => 2 %>
</p>
<p>
<%= f.label :always_resize_images %>
<%= f.label :always_resize_images, nil, :title => "Enable to automatically resize images to fit your browser window" %>
<%= f.check_box :always_resize_images %>
</p>
<p>
<%= f.label :default_image_size %>
<%= f.label :default_image_size, nil, :title => "Medium shows images resized to #{Danbooru.config.medium_image_width} pixels wide, large is #{Danbooru.config.large_image_width} pixels wide, and original is whatever the original image is" %>
<%= f.select :default_image_size, %w(Medium Large Original) %>
</p>
<p>
<%= f.label :favorite_tags %>
<%= f.label :favorite_tags, nil, :title => "A list of whitespace delimited tags that show up in your profile" %>
<%= f.text_area :favorite_tags, :rows => 5 %>
</p>
<p>
<%= f.label :blacklisted_tags %>
<%= f.label :blacklisted_tags, nil, :title => "A list of newline delimited tags that you never want to see" %>
<%= f.text_area :blacklisted_tags, :rows => 5 %>
</p>
</fieldset>
@@ -43,17 +49,17 @@
<p>For security purposes, changing the following settings requires you to re-enter your password. You can leave the new password field blank to keep your current one.</p>
<p>
<%= f.label :name %>
<%= f.label :name, nil, :title => "Your login name" %>
<%= f.text_field :name %>
</p>
<p>
<%= f.label :password, "New password" %>
<%= f.label :password, "New password", :title => "What you want your new password to be (leave blank if you don't want to change your password)" %>
<%= f.text_field :password %>
</p>
<p>
<%= f.label :old_password %>
<%= f.label :old_password, nil, :title => "Your old password (you must enter your password if updating your name or password)" %>
<%= f.text_field :old_password %>
</p>
</fieldset>
@@ -62,9 +68,5 @@
<% end %>
<% content_for(:page_title) do %>
/<%= @user.name %>/Settings
<% end %>
<% content_for(:page_header) do %>
/ <%= @user.name %> / Settings
/ Users / <%= @user.name %> / Settings
<% end %>

View File

@@ -6,9 +6,5 @@
</nav>
<% content_for(:page_title) do %>
users/<%= @user.name %>
<% end %>
<% content_for(:page_header) do %>
/ <%= @user.name %>
/ Users / <%= @user.name %>
<% end %>