diff --git a/TODO b/TODO index 44fcfc2..453cbc4 100644 --- a/TODO +++ b/TODO @@ -4,11 +4,20 @@ - Sponsorship - Admin: - - Create a conference, halls, tracks + - # Create a conference, halls, tracks - Starting a CFP - - conferences#show -> admin dashboard + - # conferences#show -> admin dashboard - proposals#index -> grouped by user - volunteers#index -> approved volunteers - events#index -> approved events - sponsorships#index -> generate token, links to send around - scheduling -> calendar with events + + - users: + - edit profile: image upload and stuff + - show profile + +Notes: + - .row > .col-lg-12 -> put that outside of the "yield"? + - mb_chars? + - human_attribute_name -> create a short alias? diff --git a/app/assets/stylesheets/management/_colors.scss b/app/assets/stylesheets/management/_colors.scss new file mode 100644 index 0000000..ffc861a --- /dev/null +++ b/app/assets/stylesheets/management/_colors.scss @@ -0,0 +1,2 @@ +$color-success: #468847; // green +$color-failure: #d9230f; // red diff --git a/app/assets/stylesheets/management/_record_tables.scss b/app/assets/stylesheets/management/_record_tables.scss index d4faf9f..634febe 100644 --- a/app/assets/stylesheets/management/_record_tables.scss +++ b/app/assets/stylesheets/management/_record_tables.scss @@ -15,4 +15,9 @@ th.action, td.action { .record-table td { vertical-align: middle !important; -} \ No newline at end of file + + &.boolean-col { + .fa-check-square-o { color: $color-success; } + .fa-minus-square-o { color: $color-failure; } + } +} diff --git a/app/assets/stylesheets/management/application.scss b/app/assets/stylesheets/management/application.scss index d83c409..1a229ce 100644 --- a/app/assets/stylesheets/management/application.scss +++ b/app/assets/stylesheets/management/application.scss @@ -8,7 +8,8 @@ @import "morris"; +@import "colors"; @import "layout"; @import "forms"; @import "record_tables"; -@import "dashboard"; \ No newline at end of file +@import "dashboard"; diff --git a/app/controllers/management/users_controller.rb b/app/controllers/management/users_controller.rb index c6871d9..bb5107b 100644 --- a/app/controllers/management/users_controller.rb +++ b/app/controllers/management/users_controller.rb @@ -1,22 +1,23 @@ module Management class UsersController < ManagementController - before_action :assign_user, only: [:show, :toggle_admin] - def index @users = User.all end def toggle_admin + @user = find_user @user.toggle_admin! end def show + @user = find_user + @profile = @user.speaker_profile end private - def assign_user - @user = User.find params[:id] + def find_user + User.find(params[:id]) end end end diff --git a/app/views/layouts/management/_navigation.html.slim b/app/views/layouts/management/_navigation.html.slim index 80afd39..9635ed2 100644 --- a/app/views/layouts/management/_navigation.html.slim +++ b/app/views/layouts/management/_navigation.html.slim @@ -7,6 +7,7 @@ nav.navbar.navbar-static-top.navbar-inverse role="navigation" span.icon-bar = link_to management_path, class: 'navbar-brand' | Clarion + .navbar-collapse.collapse.navbar-inverse-collapse - if user_signed_in? ul.nav.navbar-nav diff --git a/app/views/management/users/index.html.slim b/app/views/management/users/index.html.slim new file mode 100644 index 0000000..add033f --- /dev/null +++ b/app/views/management/users/index.html.slim @@ -0,0 +1,30 @@ +.row + .col-lg-12 + .panel.panel-default + .panel-heading + h2.panel-title= User.model_name.human(count: 2).mb_chars.capitalize + .panel-body + table.table.table-striped.table-hover.record-table#conferences + thead + tr + th = User.human_attribute_name :title + th = User.human_attribute_name :admin + th.actions + tbody + - @users.each do |user| + tr + td= user.name + td.boolean-col + - if user.admin? + = icon 'check-square-o' + - else + = icon 'minus-square-o' + + td.actions + div.btn-group.btn-group-sm + = link_to management_user_path(user), title: t('actions.view.button', model: User.model_name.human), class: 'btn btn-info' + = icon :eye + = link_to edit_management_user_path(user), title: t('actions.edit.button', model: User.model_name.human), class: 'btn btn-primary' + = icon :edit + = link_to management_user_path(user), title: t('actions.destroy.button', model: User.model_name.human), class: ['btn', 'btn-danger'], remote: true, method: :delete, data: {confirm: t('actions.are_you_sure')} + = icon :trash diff --git a/app/views/management/users/show.html.slim b/app/views/management/users/show.html.slim new file mode 100644 index 0000000..22b9aa2 --- /dev/null +++ b/app/views/management/users/show.html.slim @@ -0,0 +1,12 @@ +- content_for :title + = @user.name + +.row + .col-lg-12 + h1.page-header + // - if @profile.present? + // = image_tag(@profile.picture.medium.url) + = @user.name + + - if @profile.present? + p.biography= simple_format @profile.biography