Skip to content

Commit 1506e7c

Browse files
committed
Add descrtiption_html translated rich text attribute to community
1 parent eb7e5fe commit 1506e7c

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

app/assets/stylesheets/better_together/profiles.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
// }
5656

5757
.profile-name {
58-
font-size: 2rem;
58+
text-transform: none;
5959
}
6060

6161
.profile-description {

app/models/better_together/community.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Community < ApplicationRecord
2222

2323
translates :name
2424
translates :description, type: :text
25+
translates :description_html, backend: :action_text
2526

2627
has_one_attached :profile_image
2728
has_one_attached :cover_image

app/views/better_together/communities/_community_fields.html.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@
4444
<%= render partial: 'better_together/shared/translated_text_field', locals: { model: community, form: form, attribute: 'description' } %>
4545
</div>
4646

47+
<div class="mb-3">
48+
<%= render partial: 'better_together/shared/translated_rich_text_field', locals: { model: community, form: form, attribute: 'description_html' } %>
49+
</div>
50+
4751
<div class="mb-3">
4852
<%= render partial: 'better_together/shared/translated_string_field', locals: { model: community, form: form, attribute: 'slug' } %>
4953
</div>

app/views/better_together/communities/show.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@
6565
<section id="about" class="row collapse show" aria-labelledby="about-tab" aria-expanded="true" data-bs-parent="#platformTabs">
6666
<div class="col-md-12">
6767
<!-- Name Section -->
68-
<h2 class="card-title text-center mb-3">
68+
<h2 class="card-title profile-name text-center mb-3">
6969
<%= @resource.name %>
7070
</h2>
71-
71+
7272
<!-- Divider Line -->
7373
<hr class="my-4">
7474

7575
<!-- Description Section -->
7676
<p class="card-text text-muted">
77-
<%= @resource.description.presence || 'No description available.' %>
77+
<%= @resource.description_html.presence || @resource.description.presence || 'No description available.' %>
7878
</p>
7979

8080
<%= render partial: 'better_together/contact_details/about_section', locals: { contactable: @resource } %>

0 commit comments

Comments
 (0)