Skip to content

Commit

Permalink
[#172] Add Story URL field to feedback form
Browse files Browse the repository at this point in the history
  • Loading branch information
noahko96 committed May 19, 2022
1 parent 0dfaf1b commit 8fce077
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gem 'rails', '~> 5.2.1'
gem 'uglifier'
gem 'webpacker', '~> 4.0.7'
gem 'sentry-raven'
gem 'pointless_feedback', '~> 4.1.4'
gem 'pointless_feedback', '~> 4.1.5'
gem 'stat_board', '~> 1.1.0'
gem 'administrate', '~> 0.13.0'
gem "dragonfly"
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ GEM
mini_portile2 (~> 2.4.0)
orm_adapter (0.5.0)
pg (1.1.3)
pointless_feedback (4.1.4)
pointless_feedback (4.1.5)
airrecord (~> 1.0)
jquery-rails (>= 4.0)
rails (>= 4.0)
Expand Down Expand Up @@ -372,7 +372,7 @@ DEPENDENCIES
listen (>= 3.0.5, < 3.2)
mimemagic!
pg (>= 0.18, < 2.0)
pointless_feedback (~> 4.1.4)
pointless_feedback (~> 4.1.5)
pry-rails
puma (~> 3.12)
rails (~> 5.2.1)
Expand Down
5 changes: 5 additions & 0 deletions app/views/pointless_feedback/messages/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@
<%= f.select :topic, PointlessFeedback.message_topics, { :prompt => true } %>
</div>

<div class="Field">
<%= f.label :url, "Story URL (optional)" %>
<%= f.text_field :url %>
</div>

<div class="Field">
<%= f.label :description %>
<%= f.text_area :description %>
Expand Down
5 changes: 5 additions & 0 deletions config/initializers/pointless_feedback.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@
# Configure the words that will prevent an email from being sent if they are
# contained in the description
config.invalid_words = ['nymphomania']

# ==> URL Field
# Configure URL field in form and email
config.show_url_field = true
config.url_label = "Story URL"
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This migration comes from pointless_feedback (originally 20220518205500)
class AddUrlToPointlessFeedbackMessages < ActiveRecord::Migration[5.2]
def change
add_column :pointless_feedback_messages, :url, :string
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2021_11_24_135224) do
ActiveRecord::Schema.define(version: 2022_05_19_134603) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -57,6 +57,7 @@
t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "url"
end

create_table "thumbnails", force: :cascade do |t|
Expand Down

0 comments on commit 8fce077

Please sign in to comment.