From cb5959ae4653b54f468a7c454a214778a1c61cbb Mon Sep 17 00:00:00 2001 From: sergiotarxz Date: Wed, 17 May 2023 07:26:46 +0200 Subject: [PATCH] Fixing problem with margins. --- js-src/index.ts | 5 +++++ public/css/styles.css | 2 ++ public/css/styles.scss | 3 +++ public/js/bundle.js | 2 +- templates/page/attribute.html.ep | 2 +- templates/page/index.html.ep | 2 +- templates/page/post.html.ep | 2 +- 7 files changed, 14 insertions(+), 4 deletions(-) diff --git a/js-src/index.ts b/js-src/index.ts index a2228dd..dc8248d 100644 --- a/js-src/index.ts +++ b/js-src/index.ts @@ -6,11 +6,16 @@ require('tablesort/src/sorts/tablesort.number'); window.onload = () => { const menu_expand = document.querySelector('a.menu-expand'); const mobile_foldable = document.querySelector('nav.mobile-foldable'); + const first_box = document.querySelector('#first-box'); const tables = document.querySelectorAll('table') if (menu_expand !== null && mobile_foldable !== null) { menu_expand.addEventListener('click', () => { mobile_foldable.classList.toggle('show'); + if (first_box !== null) { + console.log('hola') + first_box.classList.toggle('margin'); + } }); } diff --git a/public/css/styles.css b/public/css/styles.css index 581630b..cd84510 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -8,6 +8,8 @@ body { min-height: 100%; width: 100%; height: 100%; } + body div#first-box.margin { + margin-top: 60px; } body div.padding { padding: 1%; } body div.title-image { diff --git a/public/css/styles.scss b/public/css/styles.scss index f423b8f..4bff555 100644 --- a/public/css/styles.scss +++ b/public/css/styles.scss @@ -14,6 +14,9 @@ html { } body { + div#first-box.margin { + margin-top: 60px; + } div.padding { padding: 1%; } diff --git a/public/js/bundle.js b/public/js/bundle.js index d953138..d273f70 100644 --- a/public/js/bundle.js +++ b/public/js/bundle.js @@ -16,7 +16,7 @@ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tablesort__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tablesort */ \"./node_modules/tablesort/src/tablesort.js\");\n/* harmony import */ var tablesort__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tablesort__WEBPACK_IMPORTED_MODULE_0__);\n\n\nwindow.Tablesort = __webpack_require__(/*! tablesort */ \"./node_modules/tablesort/src/tablesort.js\");\n__webpack_require__(/*! tablesort/src/sorts/tablesort.number */ \"./node_modules/tablesort/src/sorts/tablesort.number.js\");\n\nwindow.onload = () => {\n const menu_expand = document.querySelector('a.menu-expand');\n const mobile_foldable = document.querySelector('nav.mobile-foldable');\n const tables = document.querySelectorAll('table')\n\n if (menu_expand !== null && mobile_foldable !== null) {\n menu_expand.addEventListener('click', () => {\n mobile_foldable.classList.toggle('show');\n });\n }\n\n for (const table of tables) {\n const header = table.querySelector('tr');\n if (header !== null) {\n header.setAttribute('data-sort-method', 'none')\n for (const th of header.querySelectorAll('th')) {\n if (th.getAttribute('data-sort-method') == null) {\n th.setAttribute('data-sort-method', 'thead')\n }\n }\n }\n new (tablesort__WEBPACK_IMPORTED_MODULE_0___default())(table)\n }\n};\n\n\n//# sourceURL=webpack://BurguillosInfo/./js-src/index.ts?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tablesort__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tablesort */ \"./node_modules/tablesort/src/tablesort.js\");\n/* harmony import */ var tablesort__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tablesort__WEBPACK_IMPORTED_MODULE_0__);\n\n\nwindow.Tablesort = __webpack_require__(/*! tablesort */ \"./node_modules/tablesort/src/tablesort.js\");\n__webpack_require__(/*! tablesort/src/sorts/tablesort.number */ \"./node_modules/tablesort/src/sorts/tablesort.number.js\");\n\nwindow.onload = () => {\n const menu_expand = document.querySelector('a.menu-expand');\n const mobile_foldable = document.querySelector('nav.mobile-foldable');\n const first_box = document.querySelector('#first-box');\n const tables = document.querySelectorAll('table')\n\n if (menu_expand !== null && mobile_foldable !== null) {\n menu_expand.addEventListener('click', () => {\n mobile_foldable.classList.toggle('show');\n if (first_box !== null) {\n console.log('hola')\n first_box.classList.toggle('margin');\n }\n });\n }\n\n for (const table of tables) {\n const header = table.querySelector('tr');\n if (header !== null) {\n header.setAttribute('data-sort-method', 'none')\n for (const th of header.querySelectorAll('th')) {\n if (th.getAttribute('data-sort-method') == null) {\n th.setAttribute('data-sort-method', 'thead')\n }\n }\n }\n new (tablesort__WEBPACK_IMPORTED_MODULE_0___default())(table)\n }\n};\n\n\n//# sourceURL=webpack://BurguillosInfo/./js-src/index.ts?"); /***/ }), diff --git a/templates/page/attribute.html.ep b/templates/page/attribute.html.ep index 99d5c60..c1e0c3b 100644 --- a/templates/page/attribute.html.ep +++ b/templates/page/attribute.html.ep @@ -13,7 +13,7 @@ % my $posts = stash 'posts'; % layout 'default', current_category_slug => $category->{slug}, description_og => $description_og; % title $attribute->{title}; -
+

<%= $attribute->{title} %>

<%== $attribute->{description} %> %= include 'page/_list_posts', posts => $posts; diff --git a/templates/page/index.html.ep b/templates/page/index.html.ep index d886ced..a121163 100644 --- a/templates/page/index.html.ep +++ b/templates/page/index.html.ep @@ -12,7 +12,7 @@ % $description_og = Mojo::DOM->new($description_og)->all_text; % layout 'default', current_category => $current_category, description_og => $description_og, ogimage => "$base_url/@{[$current_category->{slug}]}-preview.png"; % title $current_category->{title}; -
+
% if (defined $current_category->{image}) {
Portada de la categoría: <%= $current_category->{title} %> diff --git a/templates/page/post.html.ep b/templates/page/post.html.ep index 3379653..dab113f 100644 --- a/templates/page/post.html.ep +++ b/templates/page/post.html.ep @@ -11,7 +11,7 @@ % my $base_url = config 'base_url'; % layout 'default', current_category_slug => $current_category->{slug}, categories => $categories, description_og => $description_og, ogimage => "$base_url/posts/$post->{slug}-preview.png?v=4"; % title $post->{title}; -
+

<%= $post->{title} %>

% my $user_agent = stash 'useragent'; % if ($user_agent !~ /LinkedInBot/) {