Skip to content

Commit 6e7971f

Browse files
committed
remove required description for communities in favour of html description
1 parent 4b41a2a commit 6e7971f

File tree

4 files changed

+6
-10
lines changed

4 files changed

+6
-10
lines changed

app/models/better_together/community.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ class Community < ApplicationRecord
6161

6262
validates :name,
6363
presence: true
64-
validates :description,
65-
presence: true
6664

6765
# Resize the cover image to specific dimensions
6866
def cover_image_variant(width, height)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<tr id="<%= dom_id community %>" class="<%= dom_class community %>">
22
<td><%= community.identifier %></td>
33
<td><%= community.name %></td>
4-
<td><%= community.description %></td>
4+
<td><%= community.description_html.to_plain_text.truncate(100) %></td>
55
<td><%= community.slug %></td>
66
<td><%= community.class.model_name.human %></td> <!-- Fetching and translating the type -->
77
<td><%= community.privacy %></td>

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
<%= render partial: 'better_together/shared/translated_string_field', locals: { model: community, form: form, attribute: 'name' } %>
4141
</div>
4242

43-
<div class="mb-3">
44-
<%= render partial: 'better_together/shared/translated_text_field', locals: { model: community, form: form, attribute: 'description' } %>
45-
</div>
46-
4743
<div class="mb-3">
4844
<%= render partial: 'better_together/shared/translated_rich_text_field', locals: { model: community, form: form, attribute: 'description_html' } %>
4945
</div>

app/views/better_together/person_community_memberships/_person_community_membership_joinable.html.erb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
<div class="card-body row">
1515
<div class="col-md-8">
1616
<p class="card-text text-muted"><%= membership.role %></p>
17-
<p class="membership-joinable-description">
18-
<%= membership.joinable.description %>
19-
</p>
2017
</div>
2118
<div class="col-md-4 d-flex justify-content-end">
2219
<%= profile_image_tag(membership.joinable, size: 150, class: 'card-image') %>
2320
</div>
21+
<div class="col-md-12">
22+
<p class="membership-joinable-description">
23+
<%= membership.joinable.description_html.to_plain_text.truncate(100) %>
24+
</p>
25+
</div>
2426
</div>
2527
</div>
2628
</div>

0 commit comments

Comments
 (0)