Nuevo plugin Redmine Questions 0.0.7 light

This commit is contained in:
Manuel Cillero 2018-02-02 23:35:10 +01:00
parent c5b56fffec
commit 7de6fb4627
51 changed files with 2162 additions and 0 deletions

View file

@ -0,0 +1,15 @@
module QuestionsHelper
def vote_tag(object, user, options={})
content_tag("span", vote_link(object, user))
end
def vote_link(object, user)
return '' unless user && user.logged? && user.respond_to?('voted_for?')
voted = user.voted_for?(object)
url = {:controller => 'questions', :action => 'vote', :id => object}
link_to((voted ? l(:button_questions_unvote) : l(:button_questions_vote)), url,
:class => (voted ? 'icon icon-vote' : 'icon icon-unvote'))
end
end