Adding CSS for form errors, adding missing indices

This commit is contained in:
Eugen Rochko 2016-03-16 11:46:25 +01:00
parent a9db42a956
commit 8767a98fbb
4 changed files with 44 additions and 3 deletions

View file

@ -2,7 +2,7 @@ FROM ruby:2.2.4
ENV RAILS_ENV=production ENV RAILS_ENV=production
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev RUN apt-get update -qq && apt-get install -y build-essential libpq-dev && rm -rf /var/lib/apt/lists/*
RUN mkdir /mastodon RUN mkdir /mastodon
WORKDIR /mastodon WORKDIR /mastodon

View file

@ -214,6 +214,12 @@
text-align: center; text-align: center;
} }
.error_notification {
color: #df405a;
font-weight: 500;
margin-bottom: 15px;
}
.input { .input {
margin-bottom: 15px; margin-bottom: 15px;
@ -238,7 +244,7 @@
font-size: 14px; font-size: 14px;
font-family: 'Roboto', sans-serif; font-family: 'Roboto', sans-serif;
&:focus { &:focus, &:active {
border-bottom: 2px solid #2b90d9; border-bottom: 2px solid #2b90d9;
padding-bottom: 5px; padding-bottom: 5px;
} }
@ -253,6 +259,24 @@
margin-top: 5px; margin-top: 5px;
color: lighten(#282c37, 25%); color: lighten(#282c37, 25%);
} }
&.field_with_errors {
input[type=text], input[type=email], input[type=password], textarea {
border-bottom: 2px solid #df405a;
padding-bottom: 5px;
&:focus, &:active {
border-bottom: 2px solid #2b90d9;
padding-bottom: 5px;
}
}
.error {
display: block;
margin-top: 5px;
color: #df405a;
}
}
} }
} }

View file

@ -0,0 +1,10 @@
class AddMissingIndices < ActiveRecord::Migration
def change
add_index :users, :account_id
add_index :statuses, :account_id
add_index :statuses, :in_reply_to_id
add_index :statuses, :reblog_of_id
add_index :stream_entries, :account_id
add_index :stream_entries, [:activity_id, :activity_type]
end
end

View file

@ -11,7 +11,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20160314164231) do ActiveRecord::Schema.define(version: 20160316103650) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -125,6 +125,9 @@ ActiveRecord::Schema.define(version: 20160314164231) do
t.string "url" t.string "url"
end end
add_index "statuses", ["account_id"], name: "index_statuses_on_account_id", using: :btree
add_index "statuses", ["in_reply_to_id"], name: "index_statuses_on_in_reply_to_id", using: :btree
add_index "statuses", ["reblog_of_id"], name: "index_statuses_on_reblog_of_id", using: :btree
add_index "statuses", ["uri"], name: "index_statuses_on_uri", unique: true, using: :btree add_index "statuses", ["uri"], name: "index_statuses_on_uri", unique: true, using: :btree
create_table "stream_entries", force: :cascade do |t| create_table "stream_entries", force: :cascade do |t|
@ -135,6 +138,9 @@ ActiveRecord::Schema.define(version: 20160314164231) do
t.datetime "updated_at", null: false t.datetime "updated_at", null: false
end end
add_index "stream_entries", ["account_id"], name: "index_stream_entries_on_account_id", using: :btree
add_index "stream_entries", ["activity_id", "activity_type"], name: "index_stream_entries_on_activity_id_and_activity_type", using: :btree
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.integer "account_id", null: false t.integer "account_id", null: false
@ -151,6 +157,7 @@ ActiveRecord::Schema.define(version: 20160314164231) do
t.inet "last_sign_in_ip" t.inet "last_sign_in_ip"
end end
add_index "users", ["account_id"], name: "index_users_on_account_id", using: :btree
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree