diff --git a/app/assets/javascripts/common.js b/app/assets/javascripts/common.js index f0db0fd21..8ad8851f3 100644 --- a/app/assets/javascripts/common.js +++ b/app/assets/javascripts/common.js @@ -1,15 +1,10 @@ -$(document).ready(function() { - // $("#hide-upgrade-account-link").click(function() { - // $("#upgrade-account").hide(); - // Cookie.put('hide-upgrade-account', '1', 7); - // }); - +$(function() { // Table striping - $("table.striped tbody tr:even").addClass("even"); - $("table.striped tbody tr:odd").addClass("odd"); + $(".striped tbody tr:even").addClass("even"); + $(".striped tbody tr:odd").addClass("odd"); + // More link if ($("#site-map-link").length > 0) { - // More link $("#site-map-link").click(function(e) { $("#more-links").toggle(); e.preventDefault(); @@ -27,6 +22,19 @@ $(document).ready(function() { }); } + // Account notices + $("#hide-sign-up-notice").click(function(e) { + $("#sign-up-notice").hide(); + Danbooru.Cookie.put("hide_sign_up_notice", "1", 7); + e.preventDefault(); + }); + + $("#hide-upgrade-account-notice").click(function(e) { + $("#upgrade-account-notice").hide(); + Danbooru.Cookie.put('hide_upgrade_account_notice', '1', 7); + e.preventDefault(); + }); + // Ajax links $("a[data-remote=true]").click(function(e) { Danbooru.ajax_start(e.target); @@ -38,7 +46,6 @@ $(document).ready(function() { // TOS link if (!location.href.match(/terms_of_service/) && Danbooru.Cookie.get("tos") !== "1") { - // Setting location.pathname in Safari doesn't work, so manually extract the domain. var domain = location.href.match(/^(http:\/\/[^\/]+)/)[0]; location.href = domain + "/static/terms_of_service?url=" + location.href; } diff --git a/app/assets/stylesheets/common/main_layout.css.scss b/app/assets/stylesheets/common/main_layout.css.scss index f64c44d55..2f6de2dc5 100644 --- a/app/assets/stylesheets/common/main_layout.css.scss +++ b/app/assets/stylesheets/common/main_layout.css.scss @@ -8,6 +8,22 @@ div#page { overflow: visible; margin: 0 30px; + div#upgrade-account-notice, div#sign-up-notice { + margin: 1em 0; + padding: 1em; + text-align: center; + position: relative; + + h1 { + font-size: $h2_size; + font-weight: bold; + } + + p { + margin: 0; + } + } + aside#sidebar { width: 20%; float: left; diff --git a/app/assets/stylesheets/specific/users.css.scss b/app/assets/stylesheets/specific/users.css.scss index 4a60f4763..6daeedca2 100644 --- a/app/assets/stylesheets/specific/users.css.scss +++ b/app/assets/stylesheets/specific/users.css.scss @@ -20,34 +20,17 @@ div#c-users { max-width: 50em; p { + font-size: 1.2em; margin-bottom: 1em; + line-height: 1.4em; } - li { - margin-left: 1em; - list-style-type: disc; + input[type=submit] { + padding: 5px 20px; + font-size: 20pt; + font-weight: bold; } - - div#account-comparison { - padding: 0 1em; - margin: 1em 0; - - h1 { - font-size: $h3_size; - } - - li { - font-size: 0.8em; - line-height: 1.5em; - } - - section { - width: 15em; - float: left; - padding-right: 1em; - } - } - + footer.nav-links { font-size: 1.4545em; font-weight: bold; @@ -59,4 +42,55 @@ div#c-users { margin-bottom: 2em; } } + + div#a-upgrade-information { + max-width: 55em; + font-size: 1.2em; + + form { + input { + font-size: 20pt; + } + + input[type=submit] { + padding: 5px 20px; + font-weight: bold; + } + } + + div#feature-comparison { + overflow: hidden; + margin-bottom: 1em; + + div.column { + width: 15em; + float: left; + border: 1px solid #666; + @include border-radius(4px); + padding: 0.25em 0.5em; + margin: 0.5em; + + h1 { + font-size: $h3_size; + } + + li { + margin-left: 1.5em; + list-style-type: disc; + } + + basic-account { + background: rgb(240, 255, 240); + } + + privileged-account { + background: rgb(255, 255, 240); + } + + contributor-account { + background: rgb(240, 240, 240); + } + } + } + } } \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c0cf98459..ce56d8519 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -5,6 +5,7 @@ class ApplicationController < ActionController::Base after_filter :reset_current_user before_filter :initialize_cookies before_filter :set_title + before_filter :set_started_at_session layout "default" rescue_from User::PrivilegeError, :with => :access_denied @@ -40,6 +41,12 @@ protected CurrentUser.ip_addr = nil end + def set_started_at_session + if session[:started_at].blank? + session[:started_at] = Time.now + end + end + %w(member banned privileged contributor janitor moderator admin).each do |level| define_method("#{level}_only") do if CurrentUser.user.__send__("is_#{level}?") diff --git a/app/views/layouts/default.html.erb b/app/views/layouts/default.html.erb index 37af29878..bc69f0274 100644 --- a/app/views/layouts/default.html.erb +++ b/app/views/layouts/default.html.erb @@ -17,7 +17,6 @@ <%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %> <%= stylesheet_link_tag "application", :media => "screen" %> - <%#= stylesheet_link_tag "mobile", :media => "only screen and (max-device-width:480px)" %> <%= javascript_include_tag "application" %> <%= Danbooru.config.custom_html_header_content %> <%= yield :html_header %> @@ -36,6 +35,14 @@