From b674e109a5e2f7c1db9cb8bbd0ab2003cbdf0f8d Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sat, 25 Jul 2015 18:56:52 +0200 Subject: [PATCH] adds appropriate text for comment replies --- app/helpers/comments_helper.rb | 11 +++++++++++ app/views/comments/_form.html.erb | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 app/helpers/comments_helper.rb diff --git a/app/helpers/comments_helper.rb b/app/helpers/comments_helper.rb new file mode 100644 index 000000000..8e8aae90c --- /dev/null +++ b/app/helpers/comments_helper.rb @@ -0,0 +1,11 @@ +module CommentsHelper + + def comment_link_text(parent) + parent.class == Debate ? "Comentar" : "Responder" + end + + def comment_button_text(parent) + parent.class == Debate ? "Publicar comentario" : "Publicar respuesta" + end + +end \ No newline at end of file diff --git a/app/views/comments/_form.html.erb b/app/views/comments/_form.html.erb index fbe743f88..d8315688a 100644 --- a/app/views/comments/_form.html.erb +++ b/app/views/comments/_form.html.erb @@ -1,4 +1,4 @@ -<%= link_to "Comentar", "", class: "js-add-comment-link", data: {'id': parent.id} %> +<%= link_to comment_link_text(parent), "", class: "js-add-comment-link", data: {'id': parent.id} %> \ No newline at end of file