User/Person models merge

This commit is contained in:
Stella Rouzi 2014-06-23 19:07:50 +03:00
parent 66b84e3660
commit 23bf55b66c
80 changed files with 1064 additions and 1221 deletions

View file

@ -3,7 +3,7 @@
%td{:style => "width:15%"}
%b Rating
%td
- if @event.average_rating.to_f > 0
- if @event.average_rating.to_f > 0
#{@event.average_rating}/#{@conference.call_for_papers.rating}
- else
Rating: 0/#{@conference.call_for_papers.rating}
@ -15,20 +15,20 @@
- else
= label_tag "label_rating", "", :class => "avgrating"
%tr
%td
%td
%b Voters
%td
= @event.voters.length
- if @event.voters.length > 0
(
= @ratings.map {|x| "#{x.first_name} #{x.last_name}"}.join ', '
= @ratings.map {|x| "#{x.name}"}.join ', '
)
%tr
%td
%td
%b Your vote
%td
- @conference.call_for_papers.rating.times do |counter|
- voted = @event.voted?(@event, current_user.person)
- voted = @event.voted?(@event, current_user)
- if voted && voted.rating == counter+1
= link_to "", vote_admin_conference_event_path(@conference.short_title, @event, :rating => counter+1), :remote => true, :id =>"label#{counter+1}", :class => "myrating", :voted => true
- else
@ -37,20 +37,20 @@
- if @ratings.length > 0
- @ratings.each do |rate|
- unless rate.person_id == current_user.person.id
- unless rate.user_id == current_user.id
%tr
%td
= rate.first_name
= rate.last_name
%td
- @conference.call_for_papers.rating.times do |counter|
- voted = @event.voted?(@event, rate.person)
- voted = @event.voted?(@event, rate.user)
- if voted && voted.rating == counter+1
= label_tag "label#{counter+1}", "", :class => "othersrating", :voted => true
= javascript_tag "$('label[voted=true]').prevAll().andSelf().addClass('bright');"
- else
= label_tag "label#{counter+1}", "", :class => "othersrating"
:javascript
:javascript
$(function () {
var checkedId = $("a[voted='true']").attr('id');
$('a[id=' + checkedId + ']').prevAll().andSelf().addClass('bright');
@ -68,4 +68,4 @@
$(".myrating").click(function() {
$(this).siblings().removeClass("bright");
$(this).prevAll().andSelf().addClass("bright");
});
});