Nuevo plugin Redmine Questions 0.0.7 light
This commit is contained in:
parent
c5b56fffec
commit
7de6fb4627
51 changed files with 2162 additions and 0 deletions
15
plugins/redmine_questions/app/helpers/questions_helper.rb
Normal file
15
plugins/redmine_questions/app/helpers/questions_helper.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue