add links for events/conferences/submitters

This commit is contained in:
Stella Rouzi 2014-07-25 01:17:47 +03:00
parent 6579b3220f
commit fd43d4de11
7 changed files with 88 additions and 22 deletions

View 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
} );
} );

View file

@ -1,14 +1,26 @@
- if can? :edit, @user
.pull-right
= link_to "Edit", edit_admin_user_path(@user), class: 'btn btn-primary'
%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)
.row
.col-md-12
.tabbable
%ul.nav.nav-tabs
%li.active
= link_to 'User Info', '#user-info-content', 'data-toggle'=>'tab'
- unless @user.submissions.blank?
%li= link_to 'Submissions', '#submissions-content', 'data-toggle'=>'tab'
.tab-content
#user-info-content.tab-pane.active
- if can? :edit, @user
.pull-right
= link_to "Edit", edit_admin_user_path(@user), class: 'btn btn-primary'
%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'