Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion app/controllers/attachments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ def description
render json: {
title: @attachment.title,
description: @attachment.description,
author: @attachment.author.title,
author:
if @attachment.author
@attachment.author.title
else
''
end,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Einfacher: @attachment.author.try(:title)

html: render_to_string(partial: 'attachments/description', formats: [:html], locals: {attachment: @attachment})
}
end
Expand Down
9 changes: 8 additions & 1 deletion app/mailers/post_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,14 @@ def post_email(text, recipients, subject, sender, group, post)

I18n.with_locale(recipients.first.try(:locale) || I18n.default_locale) do
message = mail(
to: @to_field, from: sender.email, subject: subject,
to: @to_field,
from:
if sender.kind_of? User
sender.email
elsif sender.kind_of? String
sender
end,
subject: subject,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mögliches Duplikat für diese Änderung: 6fe2fdc

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ja, das ist identisch

reply_to: @reply_to
)
message.smtp_envelope_to = @smtp_envelope_to_field
Expand Down
6 changes: 5 additions & 1 deletion app/models/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ def title
end

def to_param
"#{id} #{name} #{start_at.year}-#{start_at.month}-#{start_at.day}".parameterize
if start_at
"#{id} #{name} #{start_at.year}-#{start_at.month}-#{start_at.day}".parameterize
else
"#{id} #{name}".parameterize
end
end


Expand Down
4 changes: 2 additions & 2 deletions app/views/search/_preview_officer_group.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
- obj.memberships.includes(:descendant).each do |membership|
%p
= link_to membership.user.title, membership.user
= "(#{t(:since)} #{localize membership.valid_from.to_date})"
= "(#{t(:since)} #{localize membership.valid_from.to_date if membership.valid_from})"

- if obj.scope # which is the object the officer is officer for.
%p
= "#{t(:see_also)}:"
= link_to obj.scope.title, obj.scope
= link_to obj.scope.title, obj.scope