add links for events/conferences/submitters
This commit is contained in:
parent
6579b3220f
commit
fd43d4de11
7 changed files with 88 additions and 22 deletions
|
|
@ -114,6 +114,17 @@ class User < ActiveRecord::Base
|
||||||
proposals(conference).count
|
proposals(conference).count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Returns user submissions (in any conference)
|
||||||
|
def submissions
|
||||||
|
submissions = Array.new
|
||||||
|
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
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
%tbody
|
%tbody
|
||||||
%tr
|
%tr
|
||||||
%td #{index + 1}
|
%td #{index + 1}
|
||||||
%td #{registration.name}
|
%td= link_to "#{registration.name}", admin_user_path(registration.user.id)
|
||||||
%td #{registration.conference.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
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,12 @@
|
||||||
%tbody
|
%tbody
|
||||||
%tr
|
%tr
|
||||||
%td #{index + 1}
|
%td #{index + 1}
|
||||||
%td #{event.submitter.name}
|
- if event.submitter
|
||||||
%td #{event.title}
|
%td= link_to "#{event.submitter.name}", admin_user_path(event.submitter.id)
|
||||||
%td #{event.conference.title}
|
- else
|
||||||
|
%td Unknown Submitter
|
||||||
|
%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
|
%td
|
||||||
.span{'class'=>label_for(event.state)} #{event.state.humanize}
|
.span{'class'=>label_for(event.state)} #{event.state.humanize}
|
||||||
- else
|
- else
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
%tbody
|
%tbody
|
||||||
%tr
|
%tr
|
||||||
%td #{index}
|
%td #{index}
|
||||||
%td #{user.email}
|
%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?
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
#{key.name}
|
= link_to "#{key.name}", admin_user_path(key)
|
||||||
%div
|
%div
|
||||||
%small
|
%small
|
||||||
#{pluralize(value, 'submission')}
|
= link_to "#{pluralize(value, 'submission')}", admin_user_path(key)
|
||||||
- else
|
- else
|
||||||
%h4.text-warning
|
%h4.text-warning
|
||||||
No submissions!
|
No submissions!
|
||||||
|
|
|
||||||
40
app/views/admin/users/_submissions.html.haml
Normal file
40
app/views/admin/users/_submissions.html.haml
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
.row
|
||||||
|
.col-md-12.page-header
|
||||||
|
%h2
|
||||||
|
Submissions (#{@user.submissions.length}) for #{@user.name}
|
||||||
|
.col-md-12
|
||||||
|
.well
|
||||||
|
%table.table.table-bordered.table-striped.table-hover#submissions
|
||||||
|
%thead
|
||||||
|
%th ID
|
||||||
|
%th Conference
|
||||||
|
%th Title
|
||||||
|
%th State
|
||||||
|
%th Type
|
||||||
|
%th Rating
|
||||||
|
%th Created At
|
||||||
|
%tbody
|
||||||
|
- @user.submissions.each do |submission|
|
||||||
|
- event = submission[0]
|
||||||
|
%tr
|
||||||
|
%td= event.id
|
||||||
|
%td= link_to event.conference.short_title, admin_conference_path(event.conference.short_title)
|
||||||
|
%td= link_to event.title, admin_conference_event_path(event.conference.short_title, event)
|
||||||
|
%td= event.state
|
||||||
|
%td= "#{event.event_type.title} (#{show_time(event.event_type.length)})"
|
||||||
|
%td
|
||||||
|
- 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|
|
||||||
|
- if event.average_rating.to_f.round == counter+1
|
||||||
|
= label_tag "label_rating", "", :class => "avgrating", :avgrate => true
|
||||||
|
= javascript_tag "$('label[avgrate=true]').prevAll().andSelf().addClass('bright');"
|
||||||
|
- else
|
||||||
|
= label_tag "label_rating", "", :class => "avgrating"
|
||||||
|
%td= event.created_at
|
||||||
|
|
||||||
|
:javascript
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#submissions').dataTable( {
|
||||||
|
"bPaginate": false
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
@ -1,14 +1,26 @@
|
||||||
- if can? :edit, @user
|
.row
|
||||||
.pull-right
|
.col-md-12
|
||||||
= link_to "Edit", edit_admin_user_path(@user), class: 'btn btn-primary'
|
.tabbable
|
||||||
%table.table
|
%ul.nav.nav-tabs
|
||||||
- @show_attributes.each do |attr|
|
%li.active
|
||||||
%tr
|
= link_to 'User Info', '#user-info-content', 'data-toggle'=>'tab'
|
||||||
%td{class: 'table20'}
|
- unless @user.submissions.blank?
|
||||||
%b
|
%li= link_to 'Submissions', '#submissions-content', 'data-toggle'=>'tab'
|
||||||
= attr.capitalize.gsub('_', ' ')
|
.tab-content
|
||||||
- if attr == 'roles'
|
#user-info-content.tab-pane.active
|
||||||
%td
|
- if can? :edit, @user
|
||||||
= show_roles(@user.get_roles)
|
.pull-right
|
||||||
- else
|
= link_to "Edit", edit_admin_user_path(@user), class: 'btn btn-primary'
|
||||||
%td= @user.send(attr)
|
%table.table
|
||||||
|
- @show_attributes.each do |attr|
|
||||||
|
%tr
|
||||||
|
%td{class: 'table20'}
|
||||||
|
%b
|
||||||
|
= attr.capitalize.gsub('_', ' ')
|
||||||
|
- if attr == 'roles'
|
||||||
|
%td
|
||||||
|
= show_roles(@user.get_roles)
|
||||||
|
- else
|
||||||
|
%td= @user.send(attr)
|
||||||
|
#submissions-content.tab-pane
|
||||||
|
= render 'submissions'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue