From 1890aece1d58661dea22cde34f2682c90ac582fe Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Sun, 1 Mar 2015 17:01:28 +0200 Subject: [PATCH 1/5] remove datatable error in admin/users#index due to submissions table --- app/views/admin/users/_submissions.html.haml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/views/admin/users/_submissions.html.haml b/app/views/admin/users/_submissions.html.haml index c671a45b..0daa1368 100644 --- a/app/views/admin/users/_submissions.html.haml +++ b/app/views/admin/users/_submissions.html.haml @@ -4,7 +4,7 @@ Submissions (#{@user.events.length}) for #{@user.name} .col-md-12 .well - %table.table.table-bordered.table-striped.table-hover#submissions + %table.table.table-bordered.table-striped.table-hover.datatable#submissions %thead %th ID %th Conference @@ -30,10 +30,3 @@ - else = label_tag 'label_rating', '', class: 'avgrating' %td= event.created_at - -:javascript - $(document).ready(function() { - $('#submissions').dataTable( { - "bPaginate": false - } ); - } ); From 93bbd0ea0d446323a683567fd2059cc6486939e7 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Sun, 1 Mar 2015 17:15:57 +0200 Subject: [PATCH 2/5] td width with col-md --- app/assets/stylesheets/osem-rating.css.scss | 9 +++++---- app/views/admin/events/_proposal.html.haml | 2 +- app/views/admin/events/_voting.html.haml | 2 +- app/views/admin/events/index.html.haml | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/osem-rating.css.scss b/app/assets/stylesheets/osem-rating.css.scss index 4eae3429..7312ac45 100644 --- a/app/assets/stylesheets/osem-rating.css.scss +++ b/app/assets/stylesheets/osem-rating.css.scss @@ -5,14 +5,15 @@ .avgrating.bright { background-image: image-url("star-bright.png"); } .avgrating { background: image-url("star.png") 0 0; - width: 26px; - height: 26px; + margin-right: -2px; + width: 24px; + height: 24px; display: inline-block; } .myrating, .othersrating { background: image-url("star.png") 0 0; - width: 26px; - height: 26px; + width: 24px; + height: 24px; float: left; } diff --git a/app/views/admin/events/_proposal.html.haml b/app/views/admin/events/_proposal.html.haml index 03160090..d6349ab1 100644 --- a/app/views/admin/events/_proposal.html.haml +++ b/app/views/admin/events/_proposal.html.haml @@ -11,7 +11,7 @@ .col-md-12 %table.table %tr - %td{:style => "width:15%"} + %td.col-md-2 %b Type %td .dropdown diff --git a/app/views/admin/events/_voting.html.haml b/app/views/admin/events/_voting.html.haml index 43e54ff1..43b44cea 100644 --- a/app/views/admin/events/_voting.html.haml +++ b/app/views/admin/events/_voting.html.haml @@ -1,6 +1,6 @@ %table.table#myrating %tr - %td{:style => "width:15%"} + %td.col-md-2 %b Rating %td - if @event.average_rating.to_f > 0 diff --git a/app/views/admin/events/index.html.haml b/app/views/admin/events/index.html.haml index f0925497..137d5a15 100644 --- a/app/views/admin/events/index.html.haml +++ b/app/views/admin/events/index.html.haml @@ -40,7 +40,7 @@ =link_to event.title, admin_conference_event_path(@conference.short_title, event) - if @conference.call_for_paper && @conference.call_for_paper.rating && @conference.call_for_paper.rating > 0 - %td{:style => "width:96px"} + %td.col-md-1 - if event.average_rating.to_f > 0 #{event.average_rating}/#{@conference.call_for_paper.rating} %br From bc2b26251021cf01b076b36bf51edd247e756546 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Mon, 2 Mar 2015 11:35:08 +0200 Subject: [PATCH 3/5] add username and nickname in user#show and styling changes --- app/controllers/admin/users_controller.rb | 2 +- app/views/admin/users/show.html.haml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index bfe0b4cf..607cbe7b 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -14,7 +14,7 @@ module Admin # Variable @show_attributes holds the attributes that are visible for the 'show' action # If you want to change the attributes that are shown in the 'show' action of users # add/remove the attributes in the following string array - @show_attributes = %w(name email affiliation biography registered attended roles created_at + @show_attributes = %w(name email username nickname affiliation biography registered attended roles created_at updated_at sign_in_count current_sign_in_at last_sign_in_at current_sign_in_ip last_sign_in_ip) end diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 98196a37..ef0f7b6e 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -11,11 +11,11 @@ #user-info-content.tab-pane{class: "#{'active' unless params[:tab] == 'submissions-content'}"} - if can? :edit, @user .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' %table.table - @show_attributes.each do |attr| %tr - %td{class: 'table20'} + %td.col-md-2 %b = attr.capitalize.gsub('_', ' ') - if attr == 'roles' From fcca0e71d2d44588f3515bb2e129c3716cce2194 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Mon, 2 Mar 2015 12:58:06 +0200 Subject: [PATCH 4/5] show label of confirmed or unconfirmed in users#show --- app/views/admin/users/show.html.haml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index ef0f7b6e..81804a95 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -12,6 +12,12 @@ - if can? :edit, @user .pull-right = link_to 'Edit', edit_admin_user_path(@user), class: 'btn btn-primary' + - if @user.confirmed? + %span.label.label-success + confirmed + - else + %span.label.label-warning + unconfirmed %table.table - @show_attributes.each do |attr| %tr From 393f26c6798b001975981eda2a7a7520f79c5772 Mon Sep 17 00:00:00 2001 From: Stella Rouzi Date: Thu, 11 Jun 2015 15:15:02 +0300 Subject: [PATCH 5/5] De-activate buttons in registrations#show when conference has ended, so that user cannot edit registration details after the conference is over. --- app/views/conference_registrations/show.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/conference_registrations/show.html.haml b/app/views/conference_registrations/show.html.haml index 898493f2..298a1da3 100644 --- a/app/views/conference_registrations/show.html.haml +++ b/app/views/conference_registrations/show.html.haml @@ -101,9 +101,9 @@ .col-md-12 -if @registration .btn-group-vertical.pull-right - = link_to 'Edit your Registration', edit_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success' + = link_to 'Edit your Registration', edit_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success', disabled: @conference.end_date < Date.today = link_to 'Unregister', conference_conference_registrations_path(@conference.short_title), - method: :delete, class: 'btn btn-danger btn-xs', confirm: 'Are you sure you want to unregister?' + method: :delete, class: 'btn btn-danger btn-xs', confirm: 'Are you sure you want to unregister?', disabled: @conference.end_date < Date.today - else = link_to 'Register', new_conference_conference_registrations_path(@conference.short_title), class: 'btn btn-success btn-lg pull-right'