Massive revamping for Rails 8 and Zurb

This commit is contained in:
Christoph Haas 2025-03-16 00:44:43 +01:00
parent 7f9502fdfb
commit b5534b1900
89 changed files with 12555 additions and 736 deletions

0
app/assets/builds/.keep Normal file
View file

File diff suppressed because it is too large Load diff

View file

@ -1,4 +0,0 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link application.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -61,7 +61,7 @@
// 57. Xy Grid
@use "sass:color";
@import 'util/util';
@import 'foundation-sites/scss/util/util';
// 1. Global
// ---------

View file

@ -1,36 +0,0 @@
//
// Provides a drop-in pointer for the default Trix stylesheet that will format the toolbar and
// the trix-editor content (whether displayed or under editing). Feel free to incorporate this
// inclusion directly in any other asset bundle and remove this file.
//
//= require trix/dist/trix
// We need to override trix.csss image gallery styles to accommodate the
// <action-text-attachment> element we wrap around attachments. Otherwise,
// images in galleries will be squished by the max-width: 33%; rule.
.trix-content {
.attachment-gallery {
> action-text-attachment,
> .attachment {
flex: 1 0 33%;
padding: 0 0.5em;
max-width: 33%;
}
&.attachment-gallery--2,
&.attachment-gallery--4 {
> action-text-attachment,
> .attachment {
flex-basis: 50%;
max-width: 50%;
}
}
}
action-text-attachment {
.attachment {
padding: 0 !important;
max-width: 100% !important;
}
}
}

View file

@ -1,3 +0,0 @@
// Place all the styles related to the admin controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

View file

@ -0,0 +1,22 @@
// Customize Foundation settings before loading the framework
// @use '_settings' with (
// // Override default variables
// $primary-color: #1779ba,
// $header-color: green
// );
// @import 'foundation-sites/scss/foundation';
@import 'foundation_and_overrides';
// @import 'foundation-sites/scss/util/util';
// Include specific Foundation components (optional)
// see https://get.foundation/sites/docs/sass.html#adjusting-css-output
@include foundation-global-styles;
@include foundation-grid;
@include foundation-typography;
@include foundation-forms;
@include foundation-button;
// Add more components as needed
@import 'my_styles';

View file

@ -1,16 +0,0 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require font-awesome
*= require my_styles
*/
@import "foundation_and_overrides";

View file

@ -1,4 +0,0 @@
last 2 versions
ie >= 9
Android >= 2.3
ios >= 7

View file

@ -1,7 +1,7 @@
@charset 'utf-8';
@import 'settings';
@import 'foundation';
@import '_settings';
@import '../../../node_modules/foundation-sites/scss/foundation';
// If you'd like to include motion-ui the foundation-rails gem comes prepackaged with it, uncomment the 3 @imports, if you are not using the gem you need to install the motion-ui sass package.
//
@ -9,48 +9,60 @@
// We include everything by default. To slim your CSS, remove components you don't use.
// Global styles
@include foundation-global-styles;
@include foundation-xy-grid-classes;
//@include foundation-grid;
//@include foundation-flex-grid;
@include foundation-flex-classes;
@include foundation-typography;
@include foundation-forms;
@include foundation-typography;
// Grids (choose one)
@include foundation-xy-grid-classes;
// @include foundation-grid;
// @include foundation-flex-grid;
// Generic components
@include foundation-button;
@include foundation-accordion;
@include foundation-accordion-menu;
@include foundation-badge;
@include foundation-breadcrumbs;
@include foundation-button-group;
@include foundation-callout;
@include foundation-card;
@include foundation-close-button;
@include foundation-menu;
@include foundation-menu-icon;
@include foundation-drilldown-menu;
@include foundation-dropdown;
@include foundation-dropdown-menu;
@include foundation-responsive-embed;
@include foundation-label;
@include foundation-media-object;
@include foundation-off-canvas;
@include foundation-orbit;
@include foundation-pagination;
@include foundation-progress-bar;
@include foundation-slider;
@include foundation-sticky;
@include foundation-reveal;
@include foundation-switch;
@include foundation-table;
// Basic components
@include foundation-badge;
@include foundation-breadcrumbs;
@include foundation-callout;
@include foundation-card;
@include foundation-dropdown;
@include foundation-pagination;
@include foundation-tooltip;
// Containers
@include foundation-accordion;
@include foundation-media-object;
@include foundation-orbit;
@include foundation-responsive-embed;
@include foundation-tabs;
@include foundation-thumbnail;
@include foundation-title-bar;
@include foundation-tooltip;
@include foundation-top-bar;
@include foundation-visibility-classes;
@include foundation-float-classes;
// If you'd like to include motion-ui the foundation-rails gem comes prepackaged with it, uncomment the 3 @imports, if you are not using the gem you need to install the motion-ui sass package.
//
// @include motion-ui-transitions;
// @include motion-ui-animations;
// Menu-based containers
@include foundation-menu;
@include foundation-menu-icon;
@include foundation-accordion-menu;
@include foundation-drilldown-menu;
@include foundation-dropdown-menu;
// Layout components
@include foundation-off-canvas;
@include foundation-reveal;
@include foundation-sticky;
@include foundation-title-bar;
@include foundation-top-bar;
// Helpers
@include foundation-float-classes;
// @include foundation-flex-classes;
@include foundation-visibility-classes;
// @include foundation-prototype-classes;

File diff suppressed because one or more lines are too long

View file

@ -1,42 +1,41 @@
// This is a manifest file that'll be compiled into application.js, which will include all the files
// listed below.
//
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
//
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// compiled file.
//
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
// about supported directives.
//
//= require jquery
//= require jquery_ujs
//= require foundation
//= require_tree .
// Entry point for the build script in your package.json
// import "@hotwired/turbo-rails";
// import "jquery";
import "foundation-sites";
// import 'foundation-sites/dist/css/foundation.min.css'; // CSS
import "./controllers";
$(function(){ $(document).foundation(); });
// // Entry point for the build script in your package.json
import jquery from "jquery";
window.jQuery = jquery;
window.$ = jquery;
$(function () {
$(document).foundation();
});
// Load reviews on package's details page
load_reviews = function() {
// Display message while loading reviews
// $('#reviews').html("<i>Loading reviews...</i>");
// load_reviews = function() {
// // Display message while loading reviews
// // $('#reviews').html("<i>Loading reviews...</i>");
// Hide the DIV so that in can be faded in later
$('#reviews').hide();
// // Hide the DIV so that in can be faded in later
// $('#reviews').hide();
// The URL is specified in the #reviews's DIV data attribute
var url = $('#reviews').attr('data-package-reviews-url');
$('#reviews').load(url, null,
// Fade in the reviews as soon as the DIV is loaded and filled
function(){
$(this).fadeIn('slow')
}
);
};
// // The URL is specified in the #reviews's DIV data attribute
// var url = $('#reviews').attr('data-package-reviews-url');
// $('#reviews').load(url, null,
// // Fade in the reviews as soon as the DIV is loaded and filled
// function(){
// $(this).fadeIn('slow')
// }
// );
// };
// Initialize the upload form.
upload_form_init = function() {
function upload_form_init() {
// Disable the submit button if Javascript is supported.
// Upload will start right after selecting images.
$('#file-submit').hide();
@ -45,12 +44,12 @@ upload_form_init = function() {
$('#file').on('change', upload_form_files_selected);
};
upload_form_files_selected = function() {
function upload_form_files_selected() {
no_files = this.files.length;
if (no_files > 0) {
$('#file-label').html(no_files+" files selected - uploading…"); // change label
$('#file-select-button').attr('disabled','disabled'); // disable select button
$('#file-form').submit(); // start upload
$('#file-form').trigger('submit'); // start upload
}
};

View file

@ -0,0 +1,9 @@
import { Application } from "@hotwired/stimulus"
const application = Application.start()
// Configure Stimulus development experience
application.debug = false
window.Stimulus = application
export { application }

View file

@ -0,0 +1,7 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
connect() {
this.element.textContent = "Hello World!"
}
}

View file

@ -0,0 +1,8 @@
// This file is auto-generated by ./bin/rails stimulus:manifest:update
// Run that command whenever you add a new controller or create them with
// ./bin/rails generate stimulus controllerName
import { application } from "./application"
import HelloController from "./hello_controller"
application.register("hello", HelloController)

View file

@ -1,2 +1,7 @@
class ApplicationJob < ActiveJob::Base
# Automatically retry jobs that encountered a deadlock
# retry_on ActiveRecord::Deadlocked
# Most jobs are safe to ignore if the underlying records are no longer available
# discard_on ActiveJob::DeserializationError
end

View file

@ -1,3 +1,3 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
primary_abstract_class
end

View file

@ -0,0 +1,3 @@
<div class="trix-content">
<%= yield -%>
</div>

View file

@ -7,9 +7,14 @@ html
/ meta name="keywords" content="debian screenshots packages applications linux"
meta name="viewport" content="width=device-width, initial-scale=1.0"
/ TODO: make the keywords reflect the virtual host (e.g. Debian)
// Includes all stylesheet files in app/assets/stylesheets
/ = stylesheet_link_tag :app, "data-turbo-track": "reload"
/ = javascript_include_tag "application", "data-turbo-track": "reload", type: "module"
= stylesheet_link_tag "application", media: "all"
/ = javascript_include_tag "vendor/modernizr"
= javascript_include_tag "application", "data-turbolinks-track" => true
= javascript_include_tag "application", "data-turbo-track": "reload", type: "module"
= csrf_meta_tags
body
@ -21,6 +26,7 @@ html
#messages
= render 'layouts/messages'
= yield
= render 'layouts/footer'
// Load Javascript libraries