Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ Role.create(role_type: :main_bartender, group_uid: 6)
## Testing & Linting

To Run the test locally the following command can be used
```
```bash
bundle exec rspec
```

To run the linting locally you can use the following commands
```
```bash
yarn lint
yarn run sass-lint -v -q
bundle exec rubocop
Expand All @@ -72,7 +72,17 @@ bundle exec rubocop

When migrations are executed on master and everthing worked they can be archived with the following command.

bundle exec rails db:migrate:archive
```bash
bundle exec rails db:migrate:archive
```

## Updating Fonts

When fonts need to be updated, they can be copied from the node_modules folder to assets/fonts with the following command.

```bash
yarn update:font
```

## Deploying

Expand Down
10 changes: 10 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
$fa-font-path: "/webfonts";

@import "@fortawesome/fontawesome-free/scss/fontawesome";
@import "@fortawesome/fontawesome-free/scss/solid";
@import "@fortawesome/fontawesome-free/scss/regular";
@import "@fortawesome/fontawesome-free/scss/brands";
@import 'bootstrap/scss/bootstrap';
@import 'theme_sofia';
@import 'order_screen';
Expand Down Expand Up @@ -75,6 +81,10 @@ a {
}
}

.btn-login {
width: 100%
}
Comment on lines +84 to +86

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Add missing semicolon in CSS rule.

Line 85 is missing a semicolon after the width property, which is a critical syntax error that will cause CSS parsing to fail.

 .btn-login {
-  width: 100%
+  width: 100%;
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
.btn-login {
width: 100%
}
.btn-login {
width: 100%;
}
🤖 Prompt for AI Agents
In app/assets/stylesheets/application.scss around lines 84 to 86, the .btn-login
rule is missing a semicolon after the width property; open that file and add a
trailing semicolon so the rule reads width: 100%; then save and re-run your CSS
linter/build to ensure parsing succeeds.


.footer {
position: absolute;
bottom: 0;
Expand Down
1 change: 0 additions & 1 deletion app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'jquery';
import 'bootstrap';

import WebFont from 'webfontloader';
import '@fortawesome/fontawesome-free/css/all.css';

WebFont.load({
google: {
Expand Down
2 changes: 1 addition & 1 deletion app/views/partials/_login_prompt.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Log in with a <%= Rails.application.config.x.site_association %> account.
</p>
<div class="d-grid">
<%= link_to "Sign in with #{Rails.application.config.x.site_association}", user_amber_oauth2_omniauth_authorize_path, class: 'btn btn-primary', data: { turbo_method: :post } %>
<%= button_to "Sign in with #{Rails.application.config.x.site_association}", user_amber_oauth2_omniauth_authorize_path, class: 'btn btn-primary btn-login', data: { turbo: "false" } %>
</div>
</div>
</div>
Expand Down
24 changes: 24 additions & 0 deletions bin/copy_fontawesome_fonts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env ruby
# Copies FontAwesome font files from node_modules to public/webfonts

require 'fileutils'

# Source and destination directories
source = File.expand_path('../node_modules/@fortawesome/fontawesome-free/webfonts', __dir__)
dest = File.expand_path('../public/webfonts', __dir__)

unless Dir.exist?(source)
abort "Source directory not found: #{source}\nDid you run 'yarn install' or 'npm install'?"
end

FileUtils.mkdir_p(dest)

# Copy all font files
font_exts = %w[.woff2 .woff .ttf .eot]
Dir.entries(source).each do |file|
next unless font_exts.include?(File.extname(file))
FileUtils.cp(File.join(source, file), File.join(dest, file))
puts "Copied #{file}"
end

puts "All FontAwesome fonts copied to #{dest}"
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"lint:styles:fix": "stylelint 'app/**/*.s+(a|c)ss' 'app/**/*.vue' --ignore-path .gitignore --fix",
"build": "webpack --config webpack.config.js",
"watch": "webpack --config webpack.config.js --watch",
"build:css": "sass ./app/assets/stylesheets/application.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules"
"build:css": "sass ./app/assets/stylesheets/application.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules",
"update:font": "ruby bin/copy_fontawesome_fonts"
},
"dependencies": {
"@babel/core": "^7.28.5",
Expand Down
Binary file added public/webfonts/fa-brands-400.woff2
Binary file not shown.
Binary file added public/webfonts/fa-regular-400.woff2
Binary file not shown.
Binary file added public/webfonts/fa-solid-900.woff2
Binary file not shown.
Binary file added public/webfonts/fa-v4compatibility.woff2
Binary file not shown.