- <%= f.text_area :message, style:"width:100%;resize:none;font-size:18px;height:100px;border-radius:3px;", placeholder:"Please provide any additional information, such as an URL, that will help us understand and handle the situation.", value: @previous_message %> + <%= f.label :message %>: + <%= f.text_area :message, class: "messagefield", placeholder:"Please provide any additional information or context that will help us understand and handle the situation.", value: @previous_message %>
Note that the link above is public, but secret.
++ <% if @feedback_message.message.blank? %> + + <% else %> + <%= @feedback_message.message %> + <% end %> +
++ Questions? Send an email to yo@dev.to +
++ <% if feedback_message.message.blank? %> + + <% else %> + <%= feedback_message.message %> + <% end %> +
+Thank you for reporting any abuse that violates our code of conduct or terms and conditions. We continue to try to make this environment a great one for everybody.
- <%= render 'feedback_messages/form' %> + <%= render 'feedback_messages/form', feedback_message: @feedback_message %> diff --git a/config/routes.rb b/config/routes.rb index eb49c4a00..55cbba4fe 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,6 +32,8 @@ Rails.application.routes.draw do end resources :members, only: [:index] resources :events + resources :feedback_messages, only: [:update] + resources :reports, only: [:index, :update], controller: "feedback_messages" mount Flipflop::Engine => "/features" end @@ -72,10 +74,11 @@ Rails.application.routes.draw do resources :messages, only: [:create] resources :chat_channels, only: [:index, :show] resources :articles, only: [:update,:create,:destroy] - resources :comments, only:[:create,:update,:destroy] - resources :users, only:[:update] - resources :reactions, only: [:index,:create] + resources :comments, only: [:create,:update,:destroy] + resources :users, only: [:update] + resources :reactions, only: [:index, :create] resources :feedback_messages, only: [:create] + get "/reports/:slug", to: "feedback_messages#show" resources :organizations, only: [:update, :create] resources :followed_articles, only: [:index] resources :follows, only: [:index,:show,:create] @@ -158,7 +161,7 @@ Rails.application.routes.draw do get "/rlyweb" => "pages#rlyweb" get "/rly" => "pages#rlyweb" get "/code-of-conduct" => "pages#code_of_conduct" - get "/report-abuse" => "pages#report-abuse" + get "/report-abuse" => "pages#report_abuse" get "/infiniteloop" => "pages#infinite_loop" get "/faq" => "pages#faq" get "/live" => "pages#live" diff --git a/db/migrate/20180603160906_add_columns_to_feedback_messages.rb b/db/migrate/20180603160906_add_columns_to_feedback_messages.rb new file mode 100644 index 000000000..68f0eb5c7 --- /dev/null +++ b/db/migrate/20180603160906_add_columns_to_feedback_messages.rb @@ -0,0 +1,18 @@ +class AddColumnsToFeedbackMessages < ActiveRecord::Migration[5.1] + def change + add_column :feedback_messages, :created_at, :datetime + add_column :feedback_messages, :updated_at, :datetime + add_column :feedback_messages, :last_reviewed_at, :datetime + add_column :feedback_messages, :status, :string, default: "Open" + add_column :feedback_messages, :victim_email_sent?, :boolean, default: false + add_column :feedback_messages, :reporter_email_sent?, :boolean, default: false + add_column :feedback_messages, :offender_email_sent?, :boolean, default: false + add_column :feedback_messages, :slug, :string + add_column :feedback_messages, :reported_url, :string + rename_column :feedback_messages, :user_id, :reporter_id + rename_column :feedback_messages, :category_selection, :category + add_column :feedback_messages, :reviewer_id, :integer + add_column :feedback_messages, :offender_id, :integer + add_column :feedback_messages, :victim_id, :integer + end +end diff --git a/db/migrate/20180608195204_change_notes_to_polymorphic.rb b/db/migrate/20180608195204_change_notes_to_polymorphic.rb new file mode 100644 index 000000000..0fc9f28ae --- /dev/null +++ b/db/migrate/20180608195204_change_notes_to_polymorphic.rb @@ -0,0 +1,6 @@ +class ChangeNotesToPolymorphic < ActiveRecord::Migration[5.1] + def change + rename_column :notes, :user_id, :noteable_id + add_column :notes, :noteable_type, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 2250e83cc..bb64b43a6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -272,10 +272,22 @@ ActiveRecord::Schema.define(version: 20180612214259) do end create_table "feedback_messages", force: :cascade do |t| - t.string "category_selection" + t.string "category" + t.datetime "created_at" t.string "feedback_type" + t.datetime "last_reviewed_at" t.text "message" - t.integer "user_id" + t.boolean "offender_email_sent?", default: false + t.integer "offender_id" + t.string "reported_url" + t.boolean "reporter_email_sent?", default: false + t.integer "reporter_id" + t.integer "reviewer_id" + t.string "slug" + t.string "status", default: "Open" + t.datetime "updated_at" + t.boolean "victim_email_sent?", default: false + t.integer "victim_id" end create_table "flipflop_features", force: :cascade do |t| @@ -373,9 +385,10 @@ ActiveRecord::Schema.define(version: 20180612214259) do create_table "notes", id: :serial, force: :cascade do |t| t.text "content" t.datetime "created_at", null: false + t.integer "noteable_id" + t.string "noteable_type" t.string "reason" t.datetime "updated_at", null: false - t.integer "user_id" end create_table "notifications", id: :serial, force: :cascade do |t| diff --git a/public/500.html b/public/500.html index 74f61dd96..b8fdfd518 100644 --- a/public/500.html +++ b/public/500.html @@ -55,7 +55,7 @@ - +