-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GO-127 Show sender name by FS MessageThreads #474
Conversation
<% if @message_thread.box.communication_to_multiple_subjects? %> | ||
<% if @message_thread.is_outbox && @message_thread.recipient.present? %> | ||
Komu: <%= @message_thread.recipient %> | ||
<% elsif !@message_thread.is_outbox && @message_thread.sender.present? %> | ||
Od: <%= @message_thread.sender %> | ||
<% end %> | ||
<% elsif @message_thread.sender.present? %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keby sme tu spravili dve metody show_recipient?
a show_sender?
a schovali tu logiku tam?
@luciajanikova rozumiem co si urobila myslim, ze helper nie je uplne najlepsie miesto, mozno keby sme to nazvali |
Do modelov podla mna uplne nie, lebo to co v tych metodach checkujeme (sender, recipient) tahame cez query takto, nie je to priamo v modeli dostupne. Preto som to dala do helpera. |
Ok, rozmiem, podla komentu by sa to malo neskor dostat na uroven vlakna cize neskor to mozeme dat aj do modelu, dajme si tam teda todo. |
app/helpers/message_thread_helper.rb
Outdated
@@ -0,0 +1,9 @@ | |||
module MessageThreadHelper | |||
def self.show_recipient?(message_thread) | |||
message_thread.box.communication_to_multiple_subjects? && message_thread.is_outbox && message_thread.recipient.present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tomuto comunication_to_multiple_subjects?
inak uplne nerozumiem. Co to znamena?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Snazila som sa tym pomenovat to, ci ten dany typ boxu komunikuje k/od X subjektom - rozne institucie (ako Upvs::Box), vtedy ma zmysel rozlisovat pripady kedy zobrazujeme prijimatela/odosielatela alebo
to je komunikacia vzdy voci 1 subjektu (ako Fs::Box) a vtedy ma zmysel vzdy ukazovat iba odosielatela, resp. asi skor nazov boxu, ktoreho sa to tyka.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aha, dava zmysel. V tom pripade mi dava skor zmysel to otocit single_recipient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upravila som
Pri UPVS boxoch je mozna komunikacia ku viacerym subjektom, tak v pripade outboxovych sprav chceme na threade zobrazovat komu posledna outboxova sprava isla, inak odosielatela.
Pri FS boxoch je mozna komunikacia iba k jednemu subjektu (FS), tak chceme na threade zobrazovat vzdy odosielatela.