diff --git a/Gemfile b/Gemfile index f41c8896..28b25f54 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,10 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.5.0' -# Gems to install: faker, shoulda matchers +# +# Rails essentials +# + # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.1' # Use sqlite3 and postgres as the database for Active Record @@ -20,56 +23,47 @@ gem 'sassc-rails' gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtimes gem 'mini_racer', platforms: :ruby -# See https://github.com/bokmann/font-awesome-rails for details -gem 'font-awesome-rails' - -# Use CoffeeScript for .coffee assets and views -gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' +# Flexible authentication solution for Rails with Warden +# https://github.com/plataformatec/devise +gem 'devise' +gem 'devise-bootstrap-views', '~> 1.0' +gem 'devise-i18n' +# Provides different authentication strategies +gem 'omniauth' +gem 'omniauth_openid_connect' +# Role management, minimal authorization through OO design and pure Ruby classes +# https://github.com/varvet/pundit +gem 'pundit' +# Reduces boot times through caching; required in config/boot.rb +gem 'bootsnap', '>= 1.1.0', require: false +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.2' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' - # Use ActiveStorage variant # gem 'mini_magick', '~> 4.8' -# Flexible authentication solution for Rails with Warden -# https://github.com/plataformatec/devise -gem 'devise' -# Role management, minimal authorization through OO design and pure Ruby classes -# https://github.com/varvet/pundit -gem 'pundit' - -# Fancy default views and javascript helpers https://github.com/twbs/bootstrap-rubygem -gem 'bootstrap', '~> 4.3.1' -gem 'devise-bootstrap-views', '~> 1.0' -gem 'devise-i18n' -gem 'jquery-rails' -# Jquery datatables ruby gems for assets pipeline, https://datatables.net/ -# https://github.com/mkhairi/jquery-datatables -gem 'jquery-datatables' +# +# Application +# # Ruby interface to the VMware vSphere API # https://github.com/vmware/rbvmomi gem 'rbvmomi' - -# Provides form.select extensions -gem 'select2-rails' - -# Provides different authentication strategies -gem 'omniauth' -gem 'omniauth_openid_connect' - -# Allow locks on database -gem 'with_advisory_lock' - # Ruby Git gem 'git' - +# Allow locks on database +# https://github.com/ClosureTree/with_advisory_lock +gem 'with_advisory_lock' +# SSH private and public key generator in pure Ruby (RSA & DSA) +# https://github.com/bensie/sshkey +gem 'sshkey', '~> 1.9' # Mina for deployment # Have a look in the tutorial: # https://github.com/lnikell/wiki/wiki/Deploy-rails-application-with-Mina,-Nginx-and-Puma @@ -83,20 +77,32 @@ gem 'mina-logs', require: false # Announce Mina deploys to Slack channels, https://github.com/krichly/mina-slack gem 'execjs', require: false gem 'mina-slack', require: false, github: 'krichly/mina-slack' - -# Reduces boot times through caching; required in config/boot.rb -gem 'bootsnap', '>= 1.1.0', require: false - # Coveralls is a web service to help you track your code coverage # over time, and ensure that all your new code is fully covered # https://coveralls.io/github/hpi-swt2/vm-portal gem 'coveralls', require: false - # Report errors in production to central Errbit system # https://github.com/errbit/errbit # https://github.com/airbrake/airbrake gem 'airbrake', '~> 5.0' +# +# Packaged JS & CSS libraries +# + +# Fancy default views and javascript helpers https://github.com/twbs/bootstrap-rubygem +gem 'bootstrap', '~> 4.3.1' +# jQuery for Rails https://github.com/rails/jquery-rails +gem 'jquery-rails' +# Jquery datatables ruby gems for assets pipeline, https://datatables.net/ +# https://github.com/mkhairi/jquery-datatables +gem 'jquery-datatables' +# The font-awesome font bundled as an asset for the rails asset pipeline +# See https://github.com/bokmann/font-awesome-rails +gem 'font-awesome-rails' +# Integrate Select2 javascript library with Rails asset pipeline +# https://github.com/argerim/select2-rails +gem 'select2-rails' # Packaged clipboard.js JS library for copying text to clipboard # https://github.com/sadiqmmm/clipboard-rails gem 'clipboard-rails' @@ -149,4 +155,3 @@ end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: %i[mingw mswin x64_mingw jruby] -gem 'sshkey', '~> 1.9' diff --git a/app/assets/javascripts/app_settings.coffee b/app/assets/javascripts/app_settings.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/app_settings.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 50073a3d..f1b138c3 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -30,9 +30,8 @@ // https://github.com/turbolinks/turbolinks#observing-navigation-events document.addEventListener("turbolinks:load", function() { // Initialize 'Select2', jQuery based replacement for select boxes - // https://github.com/argerim/select2-rails#usage - $('.selecttwo').select2(); - + // https://github.com/argerim/select2-rails#include-select2-rails-stylesheet-assets + $('.selecttwo').select2({ theme: "bootstrap" }); // Initialize Boostrap tooltips for all elements having data-toggle // attribute set to 'tooltip'. Uses the title attr as tooltip. // https://getbootstrap.com/docs/4.0/components/tooltips diff --git a/app/assets/javascripts/dashboard.coffee b/app/assets/javascripts/dashboard.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/dashboard.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/landing.coffee b/app/assets/javascripts/landing.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/landing.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/operating_systems.coffee b/app/assets/javascripts/operating_systems.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/operating_systems.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/request_templates.coffee b/app/assets/javascripts/request_templates.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/request_templates.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/requests.coffee b/app/assets/javascripts/requests.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/requests.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/servers.coffee b/app/assets/javascripts/servers.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/servers.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/slack.coffee b/app/assets/javascripts/slack.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/slack.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/users.coffee b/app/assets/javascripts/users.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/users.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/javascripts/vms.coffee b/app/assets/javascripts/vms.coffee deleted file mode 100644 index 24f83d18..00000000 --- a/app/assets/javascripts/vms.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/app_settings.scss b/app/assets/stylesheets/app_settings.scss deleted file mode 100644 index e0b8a156..00000000 --- a/app/assets/stylesheets/app_settings.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the AppSettings controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 152f5ff1..a45b1ecf 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -9,23 +9,36 @@ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS * files in this directory. Styles in this file should be added after the last require_* statement. * It is generally better to create a new file per style scope. - - *= require font-awesome - *= require_self - *= require_tree . */ - + + /* + * Remove all the *= require and *= require_tree statements from the Sass file. + * Instead, use @import to import Sass files. + * Do not use *= require in Sass or your other stylesheets will not be + * able to access the Bootstrap mixins and variables. + * See: https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails + */ + +// Custom bootstrap variables must be set or *before* bootstrap is imported $primary: #0C415F; $danger: #a80833; $primary-active: #1f6993; $primary-hover: #1a5b82; +// https://github.com/bokmann/font-awesome-rails#sass-support +@import "font-awesome"; // https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails -// Custom bootstrap variables must be set or imported *before* bootstrap. @import "bootstrap"; +// https://github.com/argerim/select2-rails/issues/135 +@import "select2.css"; +@import "select2-bootstrap"; +// Custom styles for select2: app/assets/stylesheets/custom.scss +@import "select2-custom"; // Bootstrap styling for datatables // https://github.com/mkhairi/jquery-datatables#stylesheets @import 'datatables/dataTables.bootstrap4'; +// Custom styles for datatables: app/assets/stylesheets/datatables-custom.scss +@import 'datatables-custom'; // optional datatables styles for extensions, include when used //@import 'datatables/extensions/AutoFill/autoFill.bootstrap4'; //@import 'datatables/extensions/Buttons/buttons.bootstrap4'; @@ -39,71 +52,6 @@ $primary-hover: #1a5b82; //@import 'datatables/extensions/Scroller/scroller.bootstrap4'; //@import 'datatables/extensions/Select/select.bootstrap4'; -th { - @extend .text-white; - @extend .bg-primary; -} - -html, body { - height: 100%; - min-width: 1000px; - width: 100%; -} - -.page-container { - margin: 25px 0 0 50px; - width: calc(100% - 100px); -} - -h1 { - color: $primary; -} - -.dashboard-header-link { - text-decoration: none !important; -} - -h3:hover { - text-decoration: none; - color: $primary-hover; -} - -body { - display: flex; - flex-direction: column; -} - -#content { - flex: 1 0 auto; -} - -#footer { - flex-shrink: 0; - - a { - color: white; - } - - .footer-element { - padding-top: 20px; - - &__left { - @extend .footer-element; - padding-left: 50px; - } - } -} - -.dropdown-menu { - padding: 10px; - width: auto; -} - -.bg-primary-light { - background-color: #e6f3ff; -} - -#menu-profile-dropdown { - padding-top: 3px; -} +// All custom CSS: app/assets/stylesheets/custom.scss +@import 'custom'; diff --git a/app/assets/stylesheets/resource_allocation.scss b/app/assets/stylesheets/charts.scss similarity index 90% rename from app/assets/stylesheets/resource_allocation.scss rename to app/assets/stylesheets/charts.scss index 23acda0c..45dd5f63 100644 --- a/app/assets/stylesheets/resource_allocation.scss +++ b/app/assets/stylesheets/charts.scss @@ -1,5 +1,4 @@ // Place all the styles related to the Requests controller here. -// They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ .graphLabel { @@ -33,4 +32,5 @@ position: relative; text-align: center; display: inline-block; -} \ No newline at end of file +} + diff --git a/app/assets/stylesheets/custom.scss b/app/assets/stylesheets/custom.scss new file mode 100644 index 00000000..7ab2c9af --- /dev/null +++ b/app/assets/stylesheets/custom.scss @@ -0,0 +1,82 @@ +th { + @extend .text-white; + @extend .bg-primary; +} + +html, body { + height: 100%; + min-width: 1000px; + width: 100%; +} + +.page-container { + margin: 25px 0 0 50px; + width: calc(100% - 100px); +} + +h1 { + color: $primary; +} + +body { + display: flex; + flex-direction: column; +} + +#content { + flex: 1 0 auto; + padding-bottom: 5em; +} + +#footer { + flex-shrink: 0; + + a { + color: white; + } + + .footer-element { + padding-top: 20px; + + &__left { + @extend .footer-element; + padding-left: 50px; + } + } +} + +.dropdown-menu { + padding: 10px; + width: auto; +} + +.bg-primary-light { + background-color: #e6f3ff; +} + +#menu-profile-dropdown { + padding-top: 3px; +} + +.notification-bell { + #notification-alert { + margin-top: -0.4em; + margin-left: 0.6em; + display: none; + } +} + +.round { + height: 1rem; + width: 1rem; + border-radius: 0.5rem; + vertical-align: middle; + margin-right: 0.5rem; + display: inline-block; +} + +.half-screen-box { + width: 49%; + flex: 1; +} + diff --git a/app/assets/stylesheets/dashboard.scss b/app/assets/stylesheets/dashboard.scss deleted file mode 100644 index 3a51a8cf..00000000 --- a/app/assets/stylesheets/dashboard.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the dashboard controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/datatables-custom.scss b/app/assets/stylesheets/datatables-custom.scss new file mode 100644 index 00000000..bf5a8436 --- /dev/null +++ b/app/assets/stylesheets/datatables-custom.scss @@ -0,0 +1,7 @@ +// Place all the styles related to styling datatables elements here +// You can use Sass (SCSS) here: http://sass-lang.com/ + +// Place search box +.dataTables_filter { + text-align: initial !important; +} \ No newline at end of file diff --git a/app/assets/stylesheets/landing.scss b/app/assets/stylesheets/landing.scss deleted file mode 100644 index c4fe6e75..00000000 --- a/app/assets/stylesheets/landing.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Landing controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ \ No newline at end of file diff --git a/app/assets/stylesheets/notifications.scss b/app/assets/stylesheets/notifications.scss deleted file mode 100644 index d8daaa78..00000000 --- a/app/assets/stylesheets/notifications.scss +++ /dev/null @@ -1,11 +0,0 @@ -// Place all the styles related to the Notifications controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -.notification-bell { - #notification-alert { - margin-top: -0.4em; - margin-left: 0.6em; - display: none; - } -} diff --git a/app/assets/stylesheets/operating_systems.scss b/app/assets/stylesheets/operating_systems.scss deleted file mode 100644 index 621406b1..00000000 --- a/app/assets/stylesheets/operating_systems.scss +++ /dev/null @@ -1,12 +0,0 @@ -// Place all the styles related to the OperatingSystems controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ -div { - &.field, &.actions { - margin-bottom: 10px; - } - } - - label { - display: block; - } diff --git a/app/assets/stylesheets/request_templates.scss b/app/assets/stylesheets/request_templates.scss deleted file mode 100644 index ee80308f..00000000 --- a/app/assets/stylesheets/request_templates.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the RequestTemplates controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/requests.scss b/app/assets/stylesheets/requests.scss deleted file mode 100644 index 252bdaf6..00000000 --- a/app/assets/stylesheets/requests.scss +++ /dev/null @@ -1,48 +0,0 @@ -// Place all the styles related to the Requests controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ -//= require select2 - -div { - &.field { - margin-bottom: 20px; - } -} - -label { - display: block; -} - -#content{ - padding-bottom: 5em; -} - -.table-fixed-columns{ - table-layout: fixed; - word-wrap: break-word; -} - -.test{ - width: 30%; -} - -.right-buffer{ - margin-right: 5px; -} - -/* Selected items on top */ -.select2-selection__choice { - background-color: #0C415F !important; - color: #FFFFFF !important; -} - -.select2-container { - width: 100% !important; -} - -.styled-form { - h5 { - font-weight: bold; - font-size: 1.2em; - } -} \ No newline at end of file diff --git a/app/assets/stylesheets/select2-custom.scss b/app/assets/stylesheets/select2-custom.scss new file mode 100644 index 00000000..6d705910 --- /dev/null +++ b/app/assets/stylesheets/select2-custom.scss @@ -0,0 +1,8 @@ +// Place all the styles related to styling select2 elements here +// You can use Sass (SCSS) here: http://sass-lang.com/ + +/* Selected items have Bootstrap primary background */ +.select2-selection__choice { + @extend .text-white; + @extend .bg-primary; +} diff --git a/app/assets/stylesheets/servers.scss b/app/assets/stylesheets/servers.scss deleted file mode 100644 index 4710386b..00000000 --- a/app/assets/stylesheets/servers.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the servers controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/slack.scss b/app/assets/stylesheets/slack.scss deleted file mode 100644 index 57bf03be..00000000 --- a/app/assets/stylesheets/slack.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the slack controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss deleted file mode 100644 index 31a2eacb..00000000 --- a/app/assets/stylesheets/users.scss +++ /dev/null @@ -1,3 +0,0 @@ -// Place all the styles related to the Users controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/assets/stylesheets/vms.scss b/app/assets/stylesheets/vms.scss deleted file mode 100644 index 493ccb7c..00000000 --- a/app/assets/stylesheets/vms.scss +++ /dev/null @@ -1,17 +0,0 @@ -// Place all the styles related to the vm controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -.half-screen-box { - width: 49%; - flex: 1; -} - -.round { - height: 1rem; - width: 1rem; - border-radius: 0.5rem; - vertical-align: middle; - margin-right: 0.5rem; - display: inline-block; -} diff --git a/app/views/dashboard/_widget.erb b/app/views/dashboard/_widget.erb index b3e4d250..157c3417 100644 --- a/app/views/dashboard/_widget.erb +++ b/app/views/dashboard/_widget.erb @@ -1,12 +1,10 @@ <% unless vms.empty? %>
- <%= link_to vms_path, method: :get, class: "dashboard-header-link" do %> -
-
-

<%= header %>

-
-
- <% end %> +
+ <%= link_to vms_path, class: 'text-white' do %> +

<%= fa_icon('desktop', text: header) %>

+ <% end %> +
<%= render 'vms/table', {vms: vms, id: id, buttons: buttons, datatable_options: {searching: false, paging: false, info:false}} %> diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb index 3c3b2314..db70b4c2 100644 --- a/app/views/dashboard/index.html.erb +++ b/app/views/dashboard/index.html.erb @@ -1,24 +1,18 @@ -
-
-

Dashboard

-
-
+

Dashboard

+
+ <%# left column - VMs %>
<%= render 'widget', {vms: @vms.slice(0...max_shown_vms), id: 'vms_active', header: 'Active VMs', buttons: nil} %> <%= render 'widget', {vms: @archivable.slice(0...max_shown_vms), id: 'vms_to_be_archived', header: 'Archivable VMs', buttons: nil} %> <%= render 'widget', {vms: @revivable.slice(0...max_shown_vms), id: 'vms_to_be_revived', header: 'Revivable VMs', buttons: nil} %>
- - - - - + <%# right column - notifications %>
- <%= link_to notifications_path, class: "dashboard-header-link text-white" do %> + <%= link_to notifications_path, class: "text-white" do %>

<%= fa_icon('bell') %> Notifications

<% end %>
diff --git a/app/views/operating_systems/_form.html.erb b/app/views/operating_systems/_form.html.erb index ec2a0399..28db2ee0 100644 --- a/app/views/operating_systems/_form.html.erb +++ b/app/views/operating_systems/_form.html.erb @@ -16,7 +16,7 @@ <%= form.text_field :name, class: "form-control" %>
-
+
<%= form.submit class: "btn btn-primary" %>
<% end %> diff --git a/app/views/projects/_form.html.erb b/app/views/projects/_form.html.erb index a668a328..7cdc47df 100644 --- a/app/views/projects/_form.html.erb +++ b/app/views/projects/_form.html.erb @@ -21,18 +21,15 @@ <%= form.text_area :description, cols: "40", rows: "4", class: 'form-control' %>
-

Responsible users:

- <%= form.select 'responsible_user_ids', - options_from_collection_for_select(User.all, - :id, - :human_readable_identifier, - selected: selected_user_ids), - {}, - { multiple: true, class: "selecttwo form-group", data: { placeholder: 'Responsible users' }} - %> - -
-
- <%= form.submit id: 'submitProjectButton', class: "btn btn-primary" %> +
+ <%= form.label "Responsible users" %> + <%= form.select 'responsible_user_ids', + options_from_collection_for_select(User.all, :id, + :human_readable_identifier, + selected: selected_user_ids), + {}, + { multiple: true, class: "form-control selecttwo", data: { placeholder: 'Responsible users' }} %>
+ + <%= form.submit id: 'submitProjectButton', class: "btn btn-primary" %> <% end %> diff --git a/app/views/request_templates/_form.html.erb b/app/views/request_templates/_form.html.erb index c1a88bb7..d7425038 100644 --- a/app/views/request_templates/_form.html.erb +++ b/app/views/request_templates/_form.html.erb @@ -32,7 +32,5 @@ <%= form.select :operating_system, operating_system_options, {}, {class: 'form-control'}%>
-
- <%= form.submit class: "btn btn-primary" %> -
+ <%= form.submit class: "btn btn-primary" %> <% end %> diff --git a/app/views/request_templates/edit.html.erb b/app/views/request_templates/edit.html.erb index a5baa72b..69dc7cad 100644 --- a/app/views/request_templates/edit.html.erb +++ b/app/views/request_templates/edit.html.erb @@ -2,4 +2,3 @@ <%= render 'form', request_template: @request_template %> -<%= link_to 'Back', request_templates_path %> diff --git a/app/views/request_templates/show.html.erb b/app/views/request_templates/show.html.erb index ef8608d0..b3377ea1 100644 --- a/app/views/request_templates/show.html.erb +++ b/app/views/request_templates/show.html.erb @@ -30,4 +30,4 @@ <%= link_to 'Edit', edit_request_template_path(@request_template) %> | -<%= link_to 'Back', request_templates_path %> +<%= link_to 'Back', request_templates_path, class: "btn btn-secondary" %> diff --git a/app/views/requests/_form.html.erb b/app/views/requests/_form.html.erb index c554bd54..b7b07213 100644 --- a/app/views/requests/_form.html.erb +++ b/app/views/requests/_form.html.erb @@ -79,7 +79,7 @@
- <%= form.label :operating_system, "Operating System *" %>
+ <%= form.label :operating_system, "Operating System *" %> <%= form.select :operating_system, operating_system_options, {}, id: 'operating_system', class: 'form-control' %>
@@ -112,7 +112,7 @@ :human_readable_identifier, (@request.users - @request.sudo_users).collect(&:id)), {}, - {class: ' selecttwo', multiple: true} %> + {class: 'form-control selecttwo', multiple: true} %>
diff --git a/app/views/servers/_form.html.erb b/app/views/servers/_form.html.erb index 9677aeea..36d4e296 100644 --- a/app/views/servers/_form.html.erb +++ b/app/views/servers/_form.html.erb @@ -99,7 +99,7 @@ function addInput() var inputKind = document.createElement("INPUT"); inputKind.setAttribute("type", "text"); inputKind.setAttribute("placeholder", "Software " + countBox); - inputKind.setAttribute("class", "form-control"); + inputKind.setAttribute("class", "form-control mt-1"); inputKind.setAttribute("name", boxName); inputKind.setAttribute("id", boxName); @@ -110,11 +110,10 @@ function addInput() } -
- +
+
-
- <%= form.submit class: "btn btn-primary" %> -
+ <%= form.submit class: "btn btn-primary" %> <% end %> + diff --git a/app/views/servers/new.html.erb b/app/views/servers/new.html.erb index 67f336b2..ab3c28f6 100644 --- a/app/views/servers/new.html.erb +++ b/app/views/servers/new.html.erb @@ -2,4 +2,3 @@ <%= render 'form', server: @server %> -<%= link_to 'Back', servers_path %>