Reimplement conferences listing

This commit is contained in:
Petko Bordjukov 2016-10-07 04:42:01 +03:00
parent 096befa2ef
commit b245f48fbe
5 changed files with 62 additions and 32 deletions

View File

@ -21,3 +21,13 @@ th.action, td.action {
.fa-minus-square-o { color: $color-failure; }
}
}
.conference-title {
display: inline-block;
@include button-size($padding-base-vertical, $padding-base-horizontal, $font-size-base, $line-height-base, $btn-border-radius-base);
}
.conference-actions {
float: right;
text-align: right;
}

View File

@ -1,16 +1,43 @@
tr
td = conference.title
td.hidden-xs.hidden-sm = l conference.start_date.to_date, format: :long
td.hidden-xs.hidden-sm = l conference.end_date.to_date, format: :long
td.action
= render partial: 'management/call_for_participations/status', locals: {conference: conference}
td
.conference-title
= conference.title
.conference-actions
.visible-xs.dropdown
.button.btn.btn-primary.dropdown-toggle type="button" data-toggle="dropdown"
= icon 'ellipsis-v'
ul.dropdown-menu.dropdown-menu-right
li
= link_to management_conference_path(conference)
= icon 'line-chart', t('actions.view.button', model: Conference.model_name.human)
li
= link_to [:management, conference, :events] do
=> icon 'file-text', Event.model_name.human(count: 2).mb_chars.capitalize
li
= link_to [:management, conference, :volunteers] do
=> icon 'hand-stop-o', t('activerecord.models.volunteer', count: 2).mb_chars.capitalize
li
= link_to [:management, conference, :personal_profiles] do
=> icon 'user', t('activerecord.models.personal_profile', count: 2).mb_chars.capitalize
li.divider
li
= link_to edit_management_conference_path(conference)
= icon :edit, t('actions.edit.button', model: Conference.model_name.human)
li
= link_to management_conference_path(conference), class: [conference.events.any? ? 'disabled' : nil], method: :delete, data: {confirm: t('actions.are_you_sure')}
= icon :trash, t('actions.destroy.button', model: Conference.model_name.human)
td = conference.events.count
td.actions
div.btn-group.btn-group-sm
= link_to management_conference_path(conference), title: t('actions.view.button', model: Conference.model_name.human), class: 'btn btn-info'
= icon :eye
= link_to edit_management_conference_path(conference), title: t('actions.edit.button', model: Conference.model_name.human), class: 'btn btn-primary'
= icon :edit
= link_to management_conference_path(conference), title: t('actions.destroy.button', model: Conference.model_name.human), class: ['btn', 'btn-danger', conference.events.any? ? 'disabled' : nil], method: :delete, data: {confirm: t('actions.are_you_sure')}
= icon :trash
.hidden-xs.btn-group
= link_to management_conference_path(conference), class: 'btn btn-success'
= icon 'line-chart', t('actions.view.button', model: Conference.model_name.human)
= link_to [:management, conference, :events], class: 'btn btn-success' do
=> icon 'file-text', Event.model_name.human(count: 2).mb_chars.capitalize
= link_to [:management, conference, :volunteers], class: 'btn btn-success' do
=> icon 'hand-stop-o', t('activerecord.models.volunteer', count: 2).mb_chars.capitalize
= link_to [:management, conference, :personal_profiles], class: 'btn btn-success' do
=> icon 'user', t('activerecord.models.personal_profile', count: 2).mb_chars.capitalize
.hidden-xs.btn-group<
= link_to edit_management_conference_path(conference), title: t('actions.edit.button', model: Conference.model_name.human), class: 'btn btn-warning'
= icon :edit
= link_to management_conference_path(conference), title: t('actions.destroy.button', model: Conference.model_name.human), class: ['btn', 'btn-danger', conference.events.any? ? 'disabled' : nil], method: :delete, data: {confirm: t('actions.are_you_sure')}
= icon :trash

View File

@ -1,23 +1,13 @@
- content_for :title
= Conference.model_name.human(count: 2).mb_chars.capitalize
.row
.col-lg-12
.container
.row
h1.page-header
= Conference.model_name.human(count: 2).mb_chars.titleize
.panel.panel-default
.panel-heading
h2.panel-title = Conference.model_name.human(count: 2).mb_chars.capitalize
.panel-body
table.table.table-striped.table-hover.record-table#conferences
thead
tr
th = Conference.human_attribute_name :title
th.hidden-xs.hidden-sm = Conference.human_attribute_name :start_date
th.hidden-xs.hidden-sm = Conference.human_attribute_name :end_date
th.action = Conference.human_attribute_name :call_for_papers_open
th = Conference.human_attribute_name :submissions
th.actions
tbody
= render @conferences
table.table.table-striped.table-hover
tbody
= render @conferences
.panel-footer
.text-right
= link_to new_management_conference_path, class: 'btn btn-primary'

View File

@ -1,3 +1,6 @@
- content_for :title
= Event.model_name.human(count: 2).mb_chars.capitalize
.row
h1.page-header
= Event.model_name.human(count: 2).mb_chars.titleize

View File

@ -29,7 +29,7 @@ Rails.application.routes.draw do
end
namespace :management do
root to: 'home#index'
root to: 'conferences#index'
resources :conferences do
resources :events