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; } .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 tr
td = conference.title td
td.hidden-xs.hidden-sm = l conference.start_date.to_date, format: :long .conference-title
td.hidden-xs.hidden-sm = l conference.end_date.to_date, format: :long = conference.title
td.action .conference-actions
= render partial: 'management/call_for_participations/status', locals: {conference: conference} .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 .hidden-xs.btn-group
td.actions = link_to management_conference_path(conference), class: 'btn btn-success'
div.btn-group.btn-group-sm = icon 'line-chart', t('actions.view.button', model: Conference.model_name.human)
= link_to management_conference_path(conference), title: t('actions.view.button', model: Conference.model_name.human), class: 'btn btn-info' = link_to [:management, conference, :events], class: 'btn btn-success' do
= icon :eye => icon 'file-text', Event.model_name.human(count: 2).mb_chars.capitalize
= link_to edit_management_conference_path(conference), title: t('actions.edit.button', model: Conference.model_name.human), class: 'btn btn-primary' = link_to [:management, conference, :volunteers], class: 'btn btn-success' do
= icon :edit => icon 'hand-stop-o', t('activerecord.models.volunteer', count: 2).mb_chars.capitalize
= 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')} = link_to [:management, conference, :personal_profiles], class: 'btn btn-success' do
= icon :trash => 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 - content_for :title
= Conference.model_name.human(count: 2).mb_chars.capitalize = Conference.model_name.human(count: 2).mb_chars.capitalize
.container
.row .row
.col-lg-12 h1.page-header
= Conference.model_name.human(count: 2).mb_chars.titleize
.panel.panel-default .panel.panel-default
.panel-heading table.table.table-striped.table-hover
h2.panel-title = Conference.model_name.human(count: 2).mb_chars.capitalize tbody
.panel-body = render @conferences
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
.panel-footer .panel-footer
.text-right .text-right
= link_to new_management_conference_path, class: 'btn btn-primary' = 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 .row
h1.page-header h1.page-header
= Event.model_name.human(count: 2).mb_chars.titleize = Event.model_name.human(count: 2).mb_chars.titleize

View File

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