fixes from comments
This commit is contained in:
parent
d7c7d878f2
commit
5a1dae866a
7 changed files with 23 additions and 34 deletions
|
|
@ -114,17 +114,6 @@ class User < ActiveRecord::Base
|
||||||
proposals(conference).count
|
proposals(conference).count
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns user submissions (in any conference)
|
|
||||||
def submissions
|
|
||||||
submissions = []
|
|
||||||
Conference.all.each do |c|
|
|
||||||
unless self.proposals(c).blank?
|
|
||||||
submissions << self.proposals(c)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
submissions
|
|
||||||
end
|
|
||||||
|
|
||||||
def biography_word_count
|
def biography_word_count
|
||||||
if biography.nil?
|
if biography.nil?
|
||||||
0
|
0
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@
|
||||||
- recent_registrations.each_with_index do |registration, index|
|
- recent_registrations.each_with_index do |registration, index|
|
||||||
%tbody
|
%tbody
|
||||||
%tr
|
%tr
|
||||||
%td #{index + 1}
|
%td= index + 1
|
||||||
%td= link_to "#{registration.name}", admin_user_path(registration.user.id)
|
%td= link_to registration.name, admin_user_path(registration.user.id)
|
||||||
%td= link_to "#{registration.conference.title}", admin_conference_path(registration.conference.short_title)
|
%td= link_to registration.conference.title, admin_conference_path(registration.conference.short_title)
|
||||||
%td #{registration.created_at.strftime('%m/%d/%Y')}
|
%td= registration.created_at.strftime('%m/%d/%Y')
|
||||||
- else
|
- else
|
||||||
%h5.text-warning.text-center
|
%h5.text-warning.text-center
|
||||||
No registrations!
|
No registrations!
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,13 @@
|
||||||
- recent_events.each_with_index do |event, index|
|
- recent_events.each_with_index do |event, index|
|
||||||
%tbody
|
%tbody
|
||||||
%tr
|
%tr
|
||||||
%td #{index + 1}
|
%td= index + 1
|
||||||
- if event.submitter
|
- if event.submitter
|
||||||
%td= link_to "#{event.submitter.name}", admin_user_path(event.submitter.id)
|
%td= link_to event.submitter.name, admin_user_path(event.submitter.id)
|
||||||
- else
|
- else
|
||||||
%td Unknown Submitter
|
%td Unknown Submitter
|
||||||
%td= link_to "#{event.title}", admin_conference_event_path(event.conference.short_title, event)
|
%td= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
|
||||||
%td= link_to "#{event.conference.title}", admin_conference_path(event.conference.short_title)
|
%td= link_to event.conference.title, admin_conference_path(event.conference.short_title)
|
||||||
%td
|
%td
|
||||||
.span{'class'=>label_for(event.state)} #{event.state.humanize}
|
.span{'class'=>label_for(event.state)} #{event.state.humanize}
|
||||||
- else
|
- else
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@
|
||||||
- recent_users.each_with_index do |user, index|
|
- recent_users.each_with_index do |user, index|
|
||||||
%tbody
|
%tbody
|
||||||
%tr
|
%tr
|
||||||
%td #{index}
|
%td= index + 1
|
||||||
%td= link_to "#{user.email}", admin_user_path(user.id)
|
%td= link_to user.email, admin_user_path(user.id)
|
||||||
%td #{user.created_at.strftime('%m/%d/%Y')}
|
%td= user.created_at.strftime('%m/%d/%Y')
|
||||||
%td
|
%td
|
||||||
- if user.confirmed?
|
- if user.confirmed?
|
||||||
%span.label.label-success Confirmed
|
%span.label.label-success Confirmed
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,10 @@
|
||||||
= image_tag(key.gravatar_url(size: '25'), title: "Yo #{key.name}!", :alt => '', 'class'=>'img-circle img-responsive text-center')
|
= image_tag(key.gravatar_url(size: '25'), title: "Yo #{key.name}!", :alt => '', 'class'=>'img-circle img-responsive text-center')
|
||||||
.col-md-10
|
.col-md-10
|
||||||
%h4
|
%h4
|
||||||
= link_to "#{key.name}", admin_user_path(key)
|
= link_to key.name, admin_user_path(key)
|
||||||
%div
|
%div
|
||||||
%small
|
%small
|
||||||
= link_to "#{pluralize(value, 'submission')}", admin_user_path(key)
|
= link_to pluralize(value, 'submission'), admin_user_path(key, tab: 'submissions-content')
|
||||||
- else
|
- else
|
||||||
%h4.text-warning
|
%h4.text-warning
|
||||||
No submissions!
|
No submissions!
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
.row
|
.row
|
||||||
.col-md-12.page-header
|
.col-md-12.page-header
|
||||||
%h2
|
%h2
|
||||||
Submissions (#{@user.submissions.length}) for #{@user.name}
|
Submissions (#{@user.events.length}) for #{@user.name}
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.well
|
.well
|
||||||
%table.table.table-bordered.table-striped.table-hover#submissions
|
%table.table.table-bordered.table-striped.table-hover#submissions
|
||||||
|
|
@ -14,8 +14,7 @@
|
||||||
%th Rating
|
%th Rating
|
||||||
%th Created At
|
%th Created At
|
||||||
%tbody
|
%tbody
|
||||||
- @user.submissions.each do |submission|
|
- @user.events.each do |event|
|
||||||
- event = submission[0]
|
|
||||||
%tr
|
%tr
|
||||||
%td= event.id
|
%td= event.id
|
||||||
%td= link_to event.conference.short_title, admin_conference_path(event.conference.short_title)
|
%td= link_to event.conference.short_title, admin_conference_path(event.conference.short_title)
|
||||||
|
|
@ -26,10 +25,10 @@
|
||||||
- if event.conference.call_for_papers && event.conference.call_for_papers.rating && event.conference.call_for_papers.rating > 0
|
- if event.conference.call_for_papers && event.conference.call_for_papers.rating && event.conference.call_for_papers.rating > 0
|
||||||
- event.conference.call_for_papers.rating.times do |counter|
|
- event.conference.call_for_papers.rating.times do |counter|
|
||||||
- if event.average_rating.to_f.round == counter+1
|
- if event.average_rating.to_f.round == counter+1
|
||||||
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true
|
= label_tag 'label_rating', '', class: 'avgrating', avgrate: true
|
||||||
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
|
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
|
||||||
- else
|
- else
|
||||||
= label_tag "label_rating", "", :class => "avgrating"
|
= label_tag 'label_rating', '', class: 'avgrating'
|
||||||
%td= event.created_at
|
%td= event.created_at
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,13 @@
|
||||||
.col-md-12
|
.col-md-12
|
||||||
.tabbable
|
.tabbable
|
||||||
%ul.nav.nav-tabs
|
%ul.nav.nav-tabs
|
||||||
%li.active
|
%li{class: "#{'active' unless params[:tab] == 'submissions-content'}"}
|
||||||
= link_to 'User Info', '#user-info-content', 'data-toggle'=>'tab'
|
= link_to 'User Info', '#user-info-content', 'data-toggle'=>'tab'
|
||||||
- unless @user.submissions.blank?
|
- unless @user.events.blank?
|
||||||
%li= link_to 'Submissions', '#submissions-content', 'data-toggle'=>'tab'
|
%li{class: "#{'active' if params[:tab] == 'submissions-content'}"}
|
||||||
|
= link_to 'Submissions', '#submissions-content', 'data-toggle'=>'tab'
|
||||||
.tab-content
|
.tab-content
|
||||||
#user-info-content.tab-pane.active
|
#user-info-content.tab-pane{class: "#{'active' unless params[:tab] == 'submissions-content'}"}
|
||||||
- if can? :edit, @user
|
- if can? :edit, @user
|
||||||
.pull-right
|
.pull-right
|
||||||
= link_to "Edit", edit_admin_user_path(@user), class: 'btn btn-primary'
|
= link_to "Edit", edit_admin_user_path(@user), class: 'btn btn-primary'
|
||||||
|
|
@ -22,5 +23,5 @@
|
||||||
= show_roles(@user.get_roles)
|
= show_roles(@user.get_roles)
|
||||||
- else
|
- else
|
||||||
%td= @user.send(attr)
|
%td= @user.send(attr)
|
||||||
#submissions-content.tab-pane
|
#submissions-content.tab-pane{class: "#{'active' if params[:tab] == 'submissions-content'}"}
|
||||||
= render 'submissions'
|
= render 'submissions'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue