diff --git a/app/models/playlist.rb b/app/models/playlist.rb index 56b58c7a25..07600fa74d 100644 --- a/app/models/playlist.rb +++ b/app/models/playlist.rb @@ -24,7 +24,6 @@ class Playlist < ActiveRecord::Base validates :user, presence: true validates :title, presence: true - validates :comment, length: { maximum: 255 } validates :visibility, presence: true validates :visibility, inclusion: { in: proc { [PUBLIC, PRIVATE, PRIVATE_WITH_TOKEN] } } diff --git a/app/views/playlists/_comments_and_tags.html.erb b/app/views/playlists/_description_and_tags.html.erb similarity index 89% rename from app/views/playlists/_comments_and_tags.html.erb rename to app/views/playlists/_description_and_tags.html.erb index 278582f3bd..80254767d5 100644 --- a/app/views/playlists/_comments_and_tags.html.erb +++ b/app/views/playlists/_description_and_tags.html.erb @@ -14,8 +14,8 @@ Unless required by applicable law or agreed to in writing, software distributed --- END LICENSE_HEADER BLOCK --- %> <% if @playlist.comment.present? %> -

Comments

-<%= @playlist.comment %> +

<%= t("activerecord.attributes.playlist.comment") %>

+<%= simple_format @playlist.comment %> <% end %> <% if @playlist.tags.present? %> diff --git a/app/views/playlists/_show_playlist_details.html.erb b/app/views/playlists/_show_playlist_details.html.erb index 210cb6bae1..751a099ebe 100644 --- a/app/views/playlists/_show_playlist_details.html.erb +++ b/app/views/playlists/_show_playlist_details.html.erb @@ -36,7 +36,7 @@ Unless required by applicable law or agreed to in writing, software distributed <% if @playlist.comment.blank? %> No description <% else %> - <%= @playlist.comment %> + <%= simple_format @playlist.comment %> <% end %>
<%= t("playlist.visibility") %>:
diff --git a/app/views/playlists/show.html.erb b/app/views/playlists/show.html.erb index 5b72257141..80dbac5fec 100644 --- a/app/views/playlists/show.html.erb +++ b/app/views/playlists/show.html.erb @@ -35,7 +35,7 @@ Unless required by applicable law or agreed to in writing, software distributed playlist_item_ids: @playlist.item_ids, token: @playlist_token, share: { canShare: (will_partial_list_render? :share), content: render('share') }, - comment_tag: { content: render('comments_and_tags') } + comment_tag: { content: render('description_and_tags') } } ) %> diff --git a/db/schema.rb b/db/schema.rb index 19b78c1c20..96885f150b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2024_04_24_200346) do +ActiveRecord::Schema[7.0].define(version: 2024_05_31_201828) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -196,7 +196,7 @@ create_table "playlists", force: :cascade do |t| t.string "title" t.bigint "user_id", null: false - t.string "comment" + t.text "comment" t.string "visibility" t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false