Temp. layout for testing
This commit is contained in:
parent
6ea04faf4f
commit
54b051a7e7
|
@ -91,4 +91,8 @@ class UserController < ApplicationController
|
||||||
|
|
||||||
def data
|
def data
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def theme
|
||||||
|
render 'user/theme', formats: [:css], handlers: [:scss, :erb]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,22 +19,24 @@
|
||||||
- if user_signed_in?
|
- if user_signed_in?
|
||||||
- if current_user.mod?
|
- if current_user.mod?
|
||||||
= javascript_include_tag 'moderation', 'data-turbolinks-track' => true
|
= javascript_include_tag 'moderation', 'data-turbolinks-track' => true
|
||||||
|
%link{rel: 'stylesheet', href: '/yuki/theme.css', media: :all, 'data-turbolinks-track' => true}
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
%body
|
%body#version1
|
||||||
= render 'layouts/header'
|
= render 'layouts/header'
|
||||||
= yield
|
= yield
|
||||||
= render 'shared/locales'
|
= render 'shared/locales'
|
||||||
- if Rails.env.development?
|
- if Rails.env.development?
|
||||||
%hr
|
#debug
|
||||||
.container
|
%hr
|
||||||
%p
|
.container
|
||||||
Current branch:
|
%p
|
||||||
%code= `git rev-parse --abbrev-ref HEAD`
|
Current branch:
|
||||||
(commit
|
%code= `git rev-parse --abbrev-ref HEAD`
|
||||||
= succeed ')' do
|
(commit
|
||||||
= `git rev-parse --short HEAD`.strip
|
= succeed ')' do
|
||||||
%p.text-danger Debug params:
|
= `git rev-parse --short HEAD`.strip
|
||||||
= debug params
|
%p.text-danger Debug params:
|
||||||
|
= debug params
|
||||||
- if Rails.env.production?
|
- if Rails.env.production?
|
||||||
%noscript
|
%noscript
|
||||||
%p
|
%p
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
- header_class = if user.profile_header.exists? then "userbox--header-container" else "userbox--no-header" end
|
||||||
.panel.panel-default
|
.panel.panel-default
|
||||||
%img.userbox--header{src: user.profile_header.url(:mobile)}
|
%div{class: header_class}
|
||||||
|
%img.userbox--header{src: user.profile_header.url(:mobile)}
|
||||||
.panel-body
|
.panel-body
|
||||||
%img.userbox--avatar{src: user.profile_picture.url(:small)}
|
%img.userbox--avatar{src: user.profile_picture.url(:small)}
|
||||||
%p.userbox--username
|
%p.userbox--username
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
|
- header_class = if current_user.profile_header.exists? then "userbox--header-container" else "userbox--no-header" end
|
||||||
.panel.panel-default.hidden-xs
|
.panel.panel-default.hidden-xs
|
||||||
%img.userbox--header{src: current_user.profile_header.url(:mobile)}
|
%div{class: header_class}
|
||||||
|
%img.userbox--header{src: current_user.profile_header.url(:mobile)}
|
||||||
.panel-body
|
.panel-body
|
||||||
%img.userbox--avatar{src: current_user.profile_picture.url(:small)}
|
%img.userbox--avatar{src: current_user.profile_picture.url(:small)}
|
||||||
%p.userbox--username
|
%p.userbox--username
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
- type ||= @type || :nil
|
- type ||= @type || :nil
|
||||||
|
- header_class = if user.profile_header.exists? then "userbox--header-container" else "userbox--no-header" end
|
||||||
.panel.panel-default
|
.panel.panel-default
|
||||||
%img.userbox--header{src: user.profile_header.url(:mobile)}
|
%div{class: header_class}
|
||||||
|
%img.userbox--header{src: user.profile_header.url(:mobile)}
|
||||||
.panel-body
|
.panel-body
|
||||||
%img.userbox--avatar{src: user.profile_picture.url(:small)}
|
%img.userbox--avatar{src: user.profile_picture.url(:small)}
|
||||||
%p.userbox--username
|
%p.userbox--username
|
||||||
|
|
|
@ -0,0 +1,95 @@
|
||||||
|
<% @primary_color ||= "#222" %>
|
||||||
|
<% @primary_border ||= "#151515" %>
|
||||||
|
<% @primary_text ||= "#eee" %>
|
||||||
|
<% @primary_link ||= "#666" %>
|
||||||
|
<% @primary_hover ||= "#222" %>
|
||||||
|
<% @secondary_color ||= "#333" %>
|
||||||
|
<% @secondary_border ||= "#111" %>
|
||||||
|
<% @secondary_text ||= "#eee" %>
|
||||||
|
<% @secondary_link ||= "#fff" %>
|
||||||
|
<% @background_color ||= "#555" %>
|
||||||
|
body#version1 {
|
||||||
|
background-color: <%= @background_color %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 nav.navbar, body#version1 nav.navbar .dropdown-menu {
|
||||||
|
background-color: <%= @primary_color %>;
|
||||||
|
border-color: <%= @primary_border %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 nav.navbar * {
|
||||||
|
color: <%= @primary_text %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .nav > li:not(.profile--image-dropdown):before {
|
||||||
|
background-color: <%= @primary_text %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 a, body#version1 .dropdown-menu a {
|
||||||
|
color: <%= @primary_link %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .dropdown-menu .list-group-item-warning {
|
||||||
|
background-color: <%= @primary_border %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .dropdown-menu > li > a:hover,
|
||||||
|
body#version1 .dropdown-menu > li > a:focus,
|
||||||
|
body#version1 .list-group > a:hover,
|
||||||
|
body#version1 .list-group > a:focus,
|
||||||
|
body#version1 .list-group > a.active {
|
||||||
|
background-color: <%= @primary_border %>;
|
||||||
|
border-color: <%= @primary_border %>;
|
||||||
|
color: <%= @primary_text %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .btn {
|
||||||
|
color: <%= @primary_text %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .panel {
|
||||||
|
border-color: <%= @primary_border %>;
|
||||||
|
background-color: <%= @secondary_color %>;
|
||||||
|
color: <%= @primary_text %>;
|
||||||
|
box-shadow: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .list-group > a {
|
||||||
|
background-color: <%= @secondary_color %>;
|
||||||
|
border-color: <%= @secondary_border %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .locales, body .locales a {
|
||||||
|
color: <%= @primary_text %> !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .text-muted {
|
||||||
|
color: <%= @secondary_text %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .text-muted a {
|
||||||
|
color: <%= @secondary_link %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 #profile--header.profile--no-header::before, body#version1 .userbox--no-header::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
background: <%= @primary_border %>;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 .userbox--no-header, body#version1 .panel-body {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 #profile--header.profile--no-header img, body#version1 .userbox--no-header img {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#version1 #debug {
|
||||||
|
background: white;
|
||||||
|
color: black;
|
||||||
|
}
|
|
@ -113,6 +113,7 @@ Rails.application.routes.draw do
|
||||||
match '/:username(/p/:page)', to: 'user#show', via: 'get', as: :show_user_profile, defaults: {page: 1}
|
match '/:username(/p/:page)', to: 'user#show', via: 'get', as: :show_user_profile, defaults: {page: 1}
|
||||||
match '/:username/a/:id', to: 'answer#show', via: 'get', as: :show_user_answer
|
match '/:username/a/:id', to: 'answer#show', via: 'get', as: :show_user_answer
|
||||||
match '/:username/q/:id', to: 'question#show', via: 'get', as: :show_user_question
|
match '/:username/q/:id', to: 'question#show', via: 'get', as: :show_user_question
|
||||||
|
match '/:username/theme.css', to: 'user#theme', via: 'get', as: :show_user_theme
|
||||||
match '/:username/followers(/p/:page)', to: 'user#followers', via: 'get', as: :show_user_followers, defaults: {page: 1}
|
match '/:username/followers(/p/:page)', to: 'user#followers', via: 'get', as: :show_user_followers, defaults: {page: 1}
|
||||||
match '/:username/friends(/p/:page)', to: 'user#friends', via: 'get', as: :show_user_friends, defaults: {page: 1}
|
match '/:username/friends(/p/:page)', to: 'user#friends', via: 'get', as: :show_user_friends, defaults: {page: 1}
|
||||||
match '/:username/groups(/p/:page)', to: 'user#groups', via: 'get', as: :show_user_groups, defaults: {page: 1}
|
match '/:username/groups(/p/:page)', to: 'user#groups', via: 'get', as: :show_user_groups, defaults: {page: 1}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
class CreateThemesTable < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
create_table :themes do |t|
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
101
db/schema.rb
101
db/schema.rb
|
@ -19,12 +19,11 @@ ActiveRecord::Schema.define(version: 20150721154255) do
|
||||||
create_table "answers", force: :cascade do |t|
|
create_table "answers", force: :cascade do |t|
|
||||||
t.text "content"
|
t.text "content"
|
||||||
t.integer "question_id"
|
t.integer "question_id"
|
||||||
t.integer "comment_count", default: 0, null: false
|
t.integer "comment_count", default: 0, null: false
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "smile_count", default: 0, null: false
|
t.integer "smile_count", default: 0, null: false
|
||||||
t.boolean "nsfw", default: false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "answers", ["user_id", "created_at"], name: "index_answers_on_user_id_and_created_at", using: :btree
|
add_index "answers", ["user_id", "created_at"], name: "index_answers_on_user_id_and_created_at", using: :btree
|
||||||
|
@ -114,60 +113,6 @@ ActiveRecord::Schema.define(version: 20150721154255) do
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "oauth_access_grants", force: :cascade do |t|
|
|
||||||
t.integer "resource_owner_id", null: false
|
|
||||||
t.integer "application_id", null: false
|
|
||||||
t.string "token", null: false
|
|
||||||
t.integer "expires_in", null: false
|
|
||||||
t.text "redirect_uri", null: false
|
|
||||||
t.datetime "created_at", null: false
|
|
||||||
t.datetime "revoked_at"
|
|
||||||
t.string "scopes"
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index "oauth_access_grants", ["token"], name: "index_oauth_access_grants_on_token", unique: true, using: :btree
|
|
||||||
|
|
||||||
create_table "oauth_access_tokens", force: :cascade do |t|
|
|
||||||
t.integer "resource_owner_id"
|
|
||||||
t.integer "application_id"
|
|
||||||
t.string "token", null: false
|
|
||||||
t.string "refresh_token"
|
|
||||||
t.integer "expires_in"
|
|
||||||
t.datetime "revoked_at"
|
|
||||||
t.datetime "created_at", null: false
|
|
||||||
t.string "scopes"
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index "oauth_access_tokens", ["refresh_token"], name: "index_oauth_access_tokens_on_refresh_token", unique: true, using: :btree
|
|
||||||
add_index "oauth_access_tokens", ["resource_owner_id"], name: "index_oauth_access_tokens_on_resource_owner_id", using: :btree
|
|
||||||
add_index "oauth_access_tokens", ["token"], name: "index_oauth_access_tokens_on_token", unique: true, using: :btree
|
|
||||||
|
|
||||||
create_table "oauth_applications", force: :cascade do |t|
|
|
||||||
t.string "name", null: false
|
|
||||||
t.string "uid", null: false
|
|
||||||
t.string "secret", null: false
|
|
||||||
t.text "redirect_uri", null: false
|
|
||||||
t.string "scopes", default: "", null: false
|
|
||||||
t.datetime "created_at"
|
|
||||||
t.datetime "updated_at"
|
|
||||||
t.integer "owner_id"
|
|
||||||
t.string "owner_type"
|
|
||||||
t.string "description"
|
|
||||||
t.string "icon_file_name"
|
|
||||||
t.string "icon_content_type"
|
|
||||||
t.integer "icon_file_size"
|
|
||||||
t.datetime "icon_updated_at"
|
|
||||||
t.integer "crop_x"
|
|
||||||
t.integer "crop_y"
|
|
||||||
t.integer "crop_w"
|
|
||||||
t.integer "crop_h"
|
|
||||||
t.boolean "icon_processing"
|
|
||||||
end
|
|
||||||
|
|
||||||
add_index "oauth_applications", ["name"], name: "index_oauth_applications_on_name", unique: true, using: :btree
|
|
||||||
add_index "oauth_applications", ["owner_id", "owner_type"], name: "index_oauth_applications_on_owner_id_and_owner_type", using: :btree
|
|
||||||
add_index "oauth_applications", ["uid"], name: "index_oauth_applications_on_uid", unique: true, using: :btree
|
|
||||||
|
|
||||||
create_table "questions", force: :cascade do |t|
|
create_table "questions", force: :cascade do |t|
|
||||||
t.string "content"
|
t.string "content"
|
||||||
t.boolean "author_is_anonymous"
|
t.boolean "author_is_anonymous"
|
||||||
|
@ -176,8 +121,7 @@ ActiveRecord::Schema.define(version: 20150721154255) do
|
||||||
t.integer "user_id"
|
t.integer "user_id"
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.integer "answer_count", default: 0, null: false
|
t.integer "answer_count", default: 0, null: false
|
||||||
t.boolean "nsfw", default: false
|
|
||||||
end
|
end
|
||||||
|
|
||||||
add_index "questions", ["user_id", "created_at"], name: "index_questions_on_user_id_and_created_at", using: :btree
|
add_index "questions", ["user_id", "created_at"], name: "index_questions_on_user_id_and_created_at", using: :btree
|
||||||
|
@ -234,12 +178,12 @@ ActiveRecord::Schema.define(version: 20150721154255) do
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "users", force: :cascade do |t|
|
create_table "users", force: :cascade do |t|
|
||||||
t.string "email", default: "", null: false
|
t.string "email", default: "", null: false
|
||||||
t.string "encrypted_password", default: "", null: false
|
t.string "encrypted_password", default: "", null: false
|
||||||
t.string "reset_password_token"
|
t.string "reset_password_token"
|
||||||
t.datetime "reset_password_sent_at"
|
t.datetime "reset_password_sent_at"
|
||||||
t.datetime "remember_created_at"
|
t.datetime "remember_created_at"
|
||||||
t.integer "sign_in_count", default: 0, null: false
|
t.integer "sign_in_count", default: 0, null: false
|
||||||
t.datetime "current_sign_in_at"
|
t.datetime "current_sign_in_at"
|
||||||
t.datetime "last_sign_in_at"
|
t.datetime "last_sign_in_at"
|
||||||
t.string "current_sign_in_ip"
|
t.string "current_sign_in_ip"
|
||||||
|
@ -247,19 +191,19 @@ ActiveRecord::Schema.define(version: 20150721154255) do
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.string "screen_name"
|
t.string "screen_name"
|
||||||
t.integer "friend_count", default: 0, null: false
|
t.integer "friend_count", default: 0, null: false
|
||||||
t.integer "follower_count", default: 0, null: false
|
t.integer "follower_count", default: 0, null: false
|
||||||
t.integer "asked_count", default: 0, null: false
|
t.integer "asked_count", default: 0, null: false
|
||||||
t.integer "answered_count", default: 0, null: false
|
t.integer "answered_count", default: 0, null: false
|
||||||
t.integer "commented_count", default: 0, null: false
|
t.integer "commented_count", default: 0, null: false
|
||||||
t.string "display_name"
|
t.string "display_name"
|
||||||
t.integer "smiled_count", default: 0, null: false
|
t.integer "smiled_count", default: 0, null: false
|
||||||
t.boolean "admin", default: false, null: false
|
t.boolean "admin", default: false, null: false
|
||||||
t.string "motivation_header", default: "", null: false
|
t.string "motivation_header", default: "", null: false
|
||||||
t.string "website", default: "", null: false
|
t.string "website", default: "", null: false
|
||||||
t.string "location", default: "", null: false
|
t.string "location", default: "", null: false
|
||||||
t.text "bio", default: "", null: false
|
t.text "bio", default: "", null: false
|
||||||
t.boolean "moderator", default: false, null: false
|
t.boolean "moderator", default: false, null: false
|
||||||
t.string "profile_picture_file_name"
|
t.string "profile_picture_file_name"
|
||||||
t.string "profile_picture_content_type"
|
t.string "profile_picture_content_type"
|
||||||
t.integer "profile_picture_file_size"
|
t.integer "profile_picture_file_size"
|
||||||
|
@ -276,13 +220,10 @@ ActiveRecord::Schema.define(version: 20150721154255) do
|
||||||
t.boolean "privacy_show_in_search", default: true
|
t.boolean "privacy_show_in_search", default: true
|
||||||
t.boolean "permanently_banned", default: false
|
t.boolean "permanently_banned", default: false
|
||||||
t.boolean "blogger", default: false
|
t.boolean "blogger", default: false
|
||||||
t.boolean "nsfw", default: false
|
|
||||||
t.boolean "show_nsfw", default: false
|
|
||||||
t.boolean "privacy_allow_nsfw_questions", default: true
|
|
||||||
t.boolean "contributor", default: false
|
t.boolean "contributor", default: false
|
||||||
t.string "ban_reason"
|
t.string "ban_reason"
|
||||||
t.datetime "banned_until"
|
t.datetime "banned_until"
|
||||||
t.integer "comment_smiled_count", default: 0, null: false
|
t.integer "comment_smiled_count", default: 0, null: false
|
||||||
t.string "profile_header_file_name"
|
t.string "profile_header_file_name"
|
||||||
t.string "profile_header_content_type"
|
t.string "profile_header_content_type"
|
||||||
t.integer "profile_header_file_size"
|
t.integer "profile_header_file_size"
|
||||||
|
@ -292,10 +233,8 @@ ActiveRecord::Schema.define(version: 20150721154255) do
|
||||||
t.integer "crop_h_y"
|
t.integer "crop_h_y"
|
||||||
t.integer "crop_h_w"
|
t.integer "crop_h_w"
|
||||||
t.integer "crop_h_h"
|
t.integer "crop_h_h"
|
||||||
t.string "socket_key", default: ""
|
|
||||||
t.datetime "socket_key_expiry", default: '0001-01-01 00:00:00'
|
|
||||||
t.string "locale", default: "en"
|
t.string "locale", default: "en"
|
||||||
t.boolean "translator"
|
t.boolean "translator", default: false
|
||||||
t.string "confirmation_token"
|
t.string "confirmation_token"
|
||||||
t.datetime "confirmed_at"
|
t.datetime "confirmed_at"
|
||||||
t.datetime "confirmation_sent_at"
|
t.datetime "confirmation_sent_at"
|
||||||
|
|
Loading…
Reference in New Issue