From 8b524a32acb3531aeef13ffd6cd20aa246c78009 Mon Sep 17 00:00:00 2001 From: Arnaud Levy <contact@arnaudlevy.com> Date: Mon, 9 Aug 2021 17:36:17 +0200 Subject: [PATCH] style --- app/assets/images/sun.svg | 182 ++++++++++++++++++ app/assets/stylesheets/admin/styles.sass | 13 +- .../admin/application_controller.rb | 2 +- app/controllers/admin/programs_controller.rb | 1 + app/models/university.rb | 2 + app/views/admin/application/_nav.html.erb | 2 +- app/views/admin/application/_top.html.erb | 2 +- app/views/admin/dashboard/index.html.erb | 9 +- 8 files changed, 207 insertions(+), 6 deletions(-) create mode 100644 app/assets/images/sun.svg diff --git a/app/assets/images/sun.svg b/app/assets/images/sun.svg new file mode 100644 index 000000000..48876d51b --- /dev/null +++ b/app/assets/images/sun.svg @@ -0,0 +1,182 @@ +<svg width="1441" height="1455" viewBox="0 0 1441 1455" fill="none" xmlns="http://www.w3.org/2000/svg"> +<path d="M723.137 601.869V131.556" stroke="#999999"/> +<path d="M723.137 601.869V131.556" stroke="#282828"/> +<path d="M709.981 605.158L660.647 134.845" stroke="#999999"/> +<path d="M709.981 605.158L660.647 134.845" stroke="#282828"/> +<path d="M696.825 605.158L598.158 144.712" stroke="#999999"/> +<path d="M696.825 605.158L598.158 144.712" stroke="#282828"/> +<path d="M683.67 608.447L538.958 161.156" stroke="#999999"/> +<path d="M683.67 608.447L538.958 161.156" stroke="#282828"/> +<path d="M670.514 615.025L479.758 184.179" stroke="#999999"/> +<path d="M670.514 615.025L479.758 184.179" stroke="#282828"/> +<path d="M660.647 618.314L423.846 210.49" stroke="#999999"/> +<path d="M660.647 618.314L423.846 210.49" stroke="#282828"/> +<path d="M650.781 624.892L374.513 246.668" stroke="#999999"/> +<path d="M650.781 624.892L374.513 246.668" stroke="#282828"/> +<path d="M640.914 634.759L325.179 286.135" stroke="#999999"/> +<path d="M640.914 634.759L325.179 286.135" stroke="#282828"/> +<path d="M631.047 644.625L282.423 328.891" stroke="#999999"/> +<path d="M631.047 644.625L282.423 328.891" stroke="#282828"/> +<path d="M621.181 654.492L242.957 378.224" stroke="#999999"/> +<path d="M621.181 654.492L242.957 378.224" stroke="#282828"/> +<path d="M614.603 664.359L206.779 427.558" stroke="#999999"/> +<path d="M614.603 664.359L206.779 427.558" stroke="#282828"/> +<path d="M611.314 674.225L180.467 483.469" stroke="#999999"/> +<path d="M611.314 674.225L180.467 483.469" stroke="#282828"/> +<path d="M604.736 687.381L157.445 542.669" stroke="#999999"/> +<path d="M604.736 687.381L157.445 542.669" stroke="#282828"/> +<path d="M601.447 700.537L141.001 601.87" stroke="#999999"/> +<path d="M601.447 700.537L141.001 601.87" stroke="#282828"/> +<path d="M601.447 713.692L131.134 664.359" stroke="#999999"/> +<path d="M601.447 713.692L131.134 664.359" stroke="#282828"/> +<path d="M598.158 726.848H127.845" stroke="#999999"/> +<path d="M598.158 726.848H127.845" stroke="#282828"/> +<path d="M601.447 740.003L131.134 789.337" stroke="#999999"/> +<path d="M601.447 740.003L131.134 789.337" stroke="#282828"/> +<path d="M601.447 749.87L141.001 848.537" stroke="#999999"/> +<path d="M601.447 749.87L141.001 848.537" stroke="#282828"/> +<path d="M604.736 763.026L157.445 907.738" stroke="#999999"/> +<path d="M604.736 763.026L157.445 907.738" stroke="#282828"/> +<path d="M611.314 776.181L180.467 966.938" stroke="#999999"/> +<path d="M611.314 776.181L180.467 966.938" stroke="#282828"/> +<path d="M614.603 786.048L206.779 1022.85" stroke="#999999"/> +<path d="M614.603 786.048L206.779 1022.85" stroke="#282828"/> +<path d="M621.181 799.204L242.957 1075.47" stroke="#999999"/> +<path d="M621.181 799.204L242.957 1075.47" stroke="#282828"/> +<path d="M631.047 809.07L282.423 1121.52" stroke="#999999"/> +<path d="M631.047 809.07L282.423 1121.52" stroke="#282828"/> +<path d="M640.914 815.648L325.179 1167.56" stroke="#999999"/> +<path d="M640.914 815.648L325.179 1167.56" stroke="#282828"/> +<path d="M650.781 825.515L374.513 1207.03" stroke="#999999"/> +<path d="M650.781 825.515L374.513 1207.03" stroke="#282828"/> +<path d="M660.647 832.093L423.846 1239.92" stroke="#999999"/> +<path d="M660.647 832.093L423.846 1239.92" stroke="#282828"/> +<path d="M670.514 838.671L479.758 1266.23" stroke="#999999"/> +<path d="M670.514 838.671L479.758 1266.23" stroke="#282828"/> +<path d="M683.67 841.959L538.958 1289.25" stroke="#999999"/> +<path d="M683.67 841.959L538.958 1289.25" stroke="#282828"/> +<path d="M696.825 845.248L598.158 1305.7" stroke="#999999"/> +<path d="M696.825 845.248L598.158 1305.7" stroke="#282828"/> +<path d="M709.981 848.537L660.647 1315.56" stroke="#999999"/> +<path d="M709.981 848.537L660.647 1315.56" stroke="#282828"/> +<path d="M723.137 848.537V1318.85" stroke="#999999"/> +<path d="M723.137 848.537V1318.85" stroke="#282828"/> +<path d="M736.292 848.537L782.337 1315.56" stroke="#999999"/> +<path d="M736.292 848.537L782.337 1315.56" stroke="#282828"/> +<path d="M746.159 845.248L844.826 1305.7" stroke="#999999"/> +<path d="M746.159 845.248L844.826 1305.7" stroke="#282828"/> +<path d="M759.314 841.959L904.026 1289.25" stroke="#999999"/> +<path d="M759.314 841.959L904.026 1289.25" stroke="#282828"/> +<path d="M772.47 838.671L963.227 1266.23" stroke="#999999"/> +<path d="M772.47 838.671L963.227 1266.23" stroke="#282828"/> +<path d="M782.337 832.093L1019.14 1239.92" stroke="#999999"/> +<path d="M782.337 832.093L1019.14 1239.92" stroke="#282828"/> +<path d="M795.492 825.515L1071.76 1207.03" stroke="#999999"/> +<path d="M795.492 825.515L1071.76 1207.03" stroke="#282828"/> +<path d="M805.359 815.648L1117.81 1167.56" stroke="#999999"/> +<path d="M805.359 815.648L1117.81 1167.56" stroke="#282828"/> +<path d="M811.937 809.07L1163.85 1121.52" stroke="#999999"/> +<path d="M811.937 809.07L1163.85 1121.52" stroke="#282828"/> +<path d="M821.804 799.204L1203.32 1075.47" stroke="#999999"/> +<path d="M821.804 799.204L1203.32 1075.47" stroke="#282828"/> +<path d="M828.381 786.048L1236.21 1022.85" stroke="#999999"/> +<path d="M828.381 786.048L1236.21 1022.85" stroke="#282828"/> +<path d="M834.959 776.181L1262.52 966.938" stroke="#999999"/> +<path d="M834.959 776.181L1262.52 966.938" stroke="#282828"/> +<path d="M838.248 763.026L1285.54 907.738" stroke="#999999"/> +<path d="M838.248 763.026L1285.54 907.738" stroke="#282828"/> +<path d="M841.537 749.87L1301.98 848.537" stroke="#999999"/> +<path d="M841.537 749.87L1301.98 848.537" stroke="#282828"/> +<path d="M844.826 740.003L1311.85 789.337" stroke="#999999"/> +<path d="M844.826 740.003L1311.85 789.337" stroke="#282828"/> +<path d="M844.826 726.848H1315.14" stroke="#999999"/> +<path d="M844.826 726.848H1315.14" stroke="#282828"/> +<path d="M844.826 713.692L1311.85 664.359" stroke="#999999"/> +<path d="M844.826 713.692L1311.85 664.359" stroke="#282828"/> +<path d="M841.537 700.537L1301.98 601.87" stroke="#999999"/> +<path d="M841.537 700.537L1301.98 601.87" stroke="#282828"/> +<path d="M838.248 687.381L1285.54 542.669" stroke="#999999"/> +<path d="M838.248 687.381L1285.54 542.669" stroke="#282828"/> +<path d="M834.959 674.225L1262.52 483.469" stroke="#999999"/> +<path d="M834.959 674.225L1262.52 483.469" stroke="#282828"/> +<path d="M828.381 664.359L1236.21 427.558" stroke="#999999"/> +<path d="M828.381 664.359L1236.21 427.558" stroke="#282828"/> +<path d="M821.804 654.492L1203.32 378.224" stroke="#999999"/> +<path d="M821.804 654.492L1203.32 378.224" stroke="#282828"/> +<path d="M811.937 644.625L1163.85 328.891" stroke="#999999"/> +<path d="M811.937 644.625L1163.85 328.891" stroke="#282828"/> +<path d="M805.359 634.759L1117.81 286.135" stroke="#999999"/> +<path d="M805.359 634.759L1117.81 286.135" stroke="#282828"/> +<path d="M795.492 624.892L1071.76 246.668" stroke="#999999"/> +<path d="M795.492 624.892L1071.76 246.668" stroke="#282828"/> +<path d="M782.337 618.314L1019.14 210.49" stroke="#999999"/> +<path d="M782.337 618.314L1019.14 210.49" stroke="#282828"/> +<path d="M772.47 615.025L963.227 184.179" stroke="#999999"/> +<path d="M772.47 615.025L963.227 184.179" stroke="#282828"/> +<path d="M759.314 608.447L904.026 161.156" stroke="#999999"/> +<path d="M759.314 608.447L904.026 161.156" stroke="#282828"/> +<path d="M746.159 605.158L844.826 144.712" stroke="#999999"/> +<path d="M746.159 605.158L844.826 144.712" stroke="#282828"/> +<path d="M736.292 605.158L782.337 134.845" stroke="#999999"/> +<path d="M736.292 605.158L782.337 134.845" stroke="#282828"/> +<path d="M753.576 608.36L875.302 154.073" stroke="#3E3E3E"/> +<path d="M740.017 608.132L814.091 141.076" stroke="#3E3E3E"/> +<path d="M727.31 604.727L751.177 134.433" stroke="#3E3E3E"/> +<path d="M713.751 604.499L689.738 134.995" stroke="#3E3E3E"/> +<path d="M699.342 607.448L626.596 141.911" stroke="#3E3E3E"/> +<path d="M688.96 608.071L565.78 152.855" stroke="#3E3E3E"/> +<path d="M677.727 611.871L508.764 175.032" stroke="#3E3E3E"/> +<path d="M665.643 618.848L450.897 200.385" stroke="#3E3E3E"/> +<path d="M653.559 625.825L398.532 230.618" stroke="#3E3E3E"/> +<path d="M641.474 632.802L347.641 268.056" stroke="#3E3E3E"/> +<path d="M632.567 640.63L299.928 306.345" stroke="#3E3E3E"/> +<path d="M626.836 649.309L260.042 353.541" stroke="#3E3E3E"/> +<path d="M617.078 660.314L222.482 404.766" stroke="#3E3E3E"/> +<path d="M610.496 672.17L191.276 457.693" stroke="#3E3E3E"/> +<path d="M607.091 684.877L165.572 515.499" stroke="#3E3E3E"/> +<path d="M600.509 696.734L146.222 575.008" stroke="#3E3E3E"/> +<path d="M600.281 710.292L133.225 636.219" stroke="#3E3E3E"/> +<path d="M597.728 719.823L127.433 695.955" stroke="#3E3E3E"/> +<path d="M597.499 733.381L127.995 757.395" stroke="#3E3E3E"/> +<path d="M600.448 747.791L134.911 820.536" stroke="#3E3E3E"/> +<path d="M601.071 758.173L145.855 881.353" stroke="#3E3E3E"/> +<path d="M604.02 772.583L167.18 941.545" stroke="#3E3E3E"/> +<path d="M610.997 784.667L193.385 996.236" stroke="#3E3E3E"/> +<path d="M618.825 793.574L222.767 1051.78" stroke="#3E3E3E"/> +<path d="M625.802 805.658L260.205 1102.67" stroke="#3E3E3E"/> +<path d="M633.63 814.566L299.345 1147.21" stroke="#3E3E3E"/> +<path d="M641.458 823.473L346.541 1187.09" stroke="#3E3E3E"/> +<path d="M653.314 830.055L397.766 1224.65" stroke="#3E3E3E"/> +<path d="M665.17 836.637L450.693 1255.86" stroke="#3E3E3E"/> +<path d="M677.026 843.218L508.499 1281.56" stroke="#3E3E3E"/> +<path d="M689.734 846.623L568.008 1300.91" stroke="#3E3E3E"/> +<path d="M702.441 850.028L626.042 1313.06" stroke="#3E3E3E"/> +<path d="M712.823 849.405L688.956 1319.7" stroke="#3E3E3E"/> +<path d="M726.381 849.633L750.395 1319.14" stroke="#3E3E3E"/> +<path d="M739.94 849.861L813.536 1312.22" stroke="#3E3E3E"/> +<path d="M751.173 846.061L874.353 1301.28" stroke="#3E3E3E"/> +<path d="M765.583 843.113L933.694 1283.13" stroke="#3E3E3E"/> +<path d="M777.667 836.136L988.385 1256.92" stroke="#3E3E3E"/> +<path d="M785.723 831.484L1044.78 1224.37" stroke="#3E3E3E"/> +<path d="M797.807 824.508L1094.82 1190.1" stroke="#3E3E3E"/> +<path d="M807.566 813.503L1140.21 1147.79" stroke="#3E3E3E"/> +<path d="M816.473 805.675L1180.09 1100.59" stroke="#3E3E3E"/> +<path d="M823.055 793.819L1217.65 1049.37" stroke="#3E3E3E"/> +<path d="M829.637 781.962L1248.86 996.44" stroke="#3E3E3E"/> +<path d="M835.367 773.283L1273.71 941.811" stroke="#3E3E3E"/> +<path d="M838.772 760.576L1293.06 882.302" stroke="#3E3E3E"/> +<path d="M842.177 747.869L1306.06 821.091" stroke="#3E3E3E"/> +<path d="M842.405 734.31L1312.7 758.177" stroke="#3E3E3E"/> +<path d="M842.633 720.751L1312.14 696.738" stroke="#3E3E3E"/> +<path d="M842.861 707.193L1305.22 633.596" stroke="#3E3E3E"/> +<path d="M839.061 695.96L1294.28 572.78" stroke="#3E3E3E"/> +<path d="M835.261 684.727L1275.28 516.615" stroke="#3E3E3E"/> +<path d="M828.285 672.643L1249.92 458.748" stroke="#3E3E3E"/> +<path d="M824.485 661.41L1216.51 405.532" stroke="#3E3E3E"/> +<path d="M817.508 649.325L1182.25 355.493" stroke="#3E3E3E"/> +<path d="M806.503 639.567L1140.79 306.928" stroke="#3E3E3E"/> +<path d="M797.824 633.836L1093.59 267.042" stroke="#3E3E3E"/> +<path d="M786.819 624.078L1042.37 229.482" stroke="#3E3E3E"/> +<path d="M774.963 617.496L989.44 198.276" stroke="#3E3E3E"/> +<path d="M765.432 614.942L931.634 172.572" stroke="#3E3E3E"/> +</svg> diff --git a/app/assets/stylesheets/admin/styles.sass b/app/assets/stylesheets/admin/styles.sass index d94ee86ef..745ece612 100644 --- a/app/assets/stylesheets/admin/styles.sass +++ b/app/assets/stylesheets/admin/styles.sass @@ -4,8 +4,19 @@ h1 .sidebar-nav .fas min-width: 20px +body[data-theme=dark] + .sidebar-content + background-color: black + background-image: asset-url('sun.svg') + background-repeat: no-repeat + background-position-x: center + background-position-y: -420px + background-size: 400% + .sidebar-brand + padding: 90px 80px 120px + #topbar padding-left: 2.5rem padding-right: 2.5rem - .nav-link.avatar + .nav-link--last padding-right: 0 diff --git a/app/controllers/admin/application_controller.rb b/app/controllers/admin/application_controller.rb index c8422068b..168a63016 100644 --- a/app/controllers/admin/application_controller.rb +++ b/app/controllers/admin/application_controller.rb @@ -1,4 +1,4 @@ -class Admin::ApplicationController < ActionController::Base +class Admin::ApplicationController < ApplicationController layout 'admin/layouts/application' before_action :authenticate_user! diff --git a/app/controllers/admin/programs_controller.rb b/app/controllers/admin/programs_controller.rb index b58659b6b..e74568c38 100644 --- a/app/controllers/admin/programs_controller.rb +++ b/app/controllers/admin/programs_controller.rb @@ -2,6 +2,7 @@ class Admin::ProgramsController < Admin::ApplicationController load_and_authorize_resource def index + @programs = current_university.programs breadcrumb end diff --git a/app/models/university.rb b/app/models/university.rb index 46e65f759..ce30a34fc 100644 --- a/app/models/university.rb +++ b/app/models/university.rb @@ -19,6 +19,8 @@ class University < ApplicationRecord include WithIdentifier + has_many :programs + def to_s "#{name}" end diff --git a/app/views/admin/application/_nav.html.erb b/app/views/admin/application/_nav.html.erb index 5016cfd06..00d41bb7c 100644 --- a/app/views/admin/application/_nav.html.erb +++ b/app/views/admin/application/_nav.html.erb @@ -1,7 +1,7 @@ <nav id="sidebar" class="sidebar"> <div class="sidebar-content js-simplebar"> <%= link_to admin_root_path, class: 'sidebar-brand' do %> - <%= image_tag 'osuny-white.svg', class: 'img-fluid pe-5 py-3' %> + <%= image_tag 'osuny-white.svg', class: 'img-fluid' %> <% end %> <%= render_navigation context: :admin %> </div> diff --git a/app/views/admin/application/_top.html.erb b/app/views/admin/application/_top.html.erb index 48773f038..ec95c6a8a 100644 --- a/app/views/admin/application/_top.html.erb +++ b/app/views/admin/application/_top.html.erb @@ -15,7 +15,7 @@ </div> </li> <li> - <a class="nav-link avatar" href="#"> + <a class="nav-link nav-link--last" href="#"> <%= image_tag 'avatar.jpg', class: 'avatar img-fluid rounded-circle' %> </a> </li> diff --git a/app/views/admin/dashboard/index.html.erb b/app/views/admin/dashboard/index.html.erb index 31d13701f..403cc0368 100644 --- a/app/views/admin/dashboard/index.html.erb +++ b/app/views/admin/dashboard/index.html.erb @@ -50,8 +50,8 @@ <div class="card illustration flex-fill"> <div class="card-body p-0 d-flex flex-fill"> <div class="p-3"> - <h4>Bonjour - <%= current_user.first_name %> !</h4> + <h4>Bonjour <%= current_user.first_name %> !</h4> + <p><%= current_university %></p> </div> </div> </div> @@ -2656,6 +2656,11 @@ maintainAspectRatio: false, legend: { display: false + }, + scale: { + gridLines: { + color: "rgba(0, 123, 255, 0.2)" + } } } }); -- GitLab