From bef289950b4ba5634855fa5978e344542c3c0a52 Mon Sep 17 00:00:00 2001
From: calcu1on
© Dan Chadwick {$year}
", + ]; + + return $build; + } + +} diff --git a/web/modules/custom/ufc/src/Fighter.php b/web/modules/custom/ufc/src/Fighter.php index eaf3a3f..1fd5304 100644 --- a/web/modules/custom/ufc/src/Fighter.php +++ b/web/modules/custom/ufc/src/Fighter.php @@ -107,6 +107,9 @@ public function setFighterPage(string $url): void { * Checks is the fighters has stats to pull before proceeding. */ public function checkValidFighter(): bool { + if (!$this->crawler) { + return FALSE; + } $athlete_stats = $this->crawler->filter('h2.stats-records__title')->count(); if ($athlete_stats == 0) { return FALSE; diff --git a/web/modules/custom/ufc/src/Services/FightImporter.php b/web/modules/custom/ufc/src/Services/FightImporter.php index 074d307..8a3036a 100644 --- a/web/modules/custom/ufc/src/Services/FightImporter.php +++ b/web/modules/custom/ufc/src/Services/FightImporter.php @@ -163,6 +163,9 @@ private function removeExistingEvents(): void { */ public static function createFightsByEvent($event, $context): void { try { + /* \Drupal::messenger()->addStatus(print_r($event->field_event_url->uri)); */ + /* \Drupal::messenger()->addStatus(print_r($event->label())); */ + /* exit(); */ $event_page_html = \Drupal::httpClient() ->get(self::EVENT_BASE . $event->field_event_url->uri) ->getBody()->getContents(); diff --git a/web/modules/custom/ufc/src/Services/FighterImporter.php b/web/modules/custom/ufc/src/Services/FighterImporter.php index 90bb9fe..1fd7bbb 100644 --- a/web/modules/custom/ufc/src/Services/FighterImporter.php +++ b/web/modules/custom/ufc/src/Services/FighterImporter.php @@ -98,9 +98,9 @@ public function importFighters(): void { else { $fighters_by_div = self::getListOfCurrentFighters(); // Process each fighter into system. - /* foreach ($fighters_by_div as $division => $fighters) { */ - /* $this->processDivision($division, $fighters); */ - /* } */ + foreach ($fighters_by_div as $division => $fighters) { + $this->processDivision($division, $fighters); + } } } /** @@ -109,7 +109,7 @@ public function importFighters(): void { * @param mixed $div * @param mixed $fighters */ - public static function processDivision($div, $fighters, &$context): void { + public static function processDivision($div, $fighters): void { \Drupal::logger('ufc')->notice("Starting to update $div"); foreach ($fighters as $fighter_data) { diff --git a/web/themes/custom/dchadwick/css/style.css b/web/themes/custom/dchadwick/css/style.css index f1ca3e9..58abf39 100644 --- a/web/themes/custom/dchadwick/css/style.css +++ b/web/themes/custom/dchadwick/css/style.css @@ -601,6 +601,41 @@ table.cols-5 td.incorrect { line-height: 24px; } +.margin-1 { + margin: 1rem; +} +.margin-2 { + margin: 2rem; +} + +.m-top-1 { + margin-top: 1rem; +} +.m-top-2 { + margin-top: 2rem; +} + +.m-bottom-1 { + margin-bottom: 1rem; +} +.m-bottom-2 { + margin-bottom: 2rem; +} + +.padding-1 { + padding: 1rem; +} +.padding-2 { + padding: 2rem; +} + +.p-topbottom-1 { + padding: 1rem 0; +} +.p-topbottom-2 { + padding: 2rem 0; +} + html { font-size: 100%; box-sizing: border-box; diff --git a/web/themes/custom/dchadwick/src/sass/partials/lb-styles.scss b/web/themes/custom/dchadwick/src/sass/partials/lb-styles.scss new file mode 100644 index 0000000..330da51 --- /dev/null +++ b/web/themes/custom/dchadwick/src/sass/partials/lb-styles.scss @@ -0,0 +1,54 @@ +.margin { + &-1 { + margin: 1rem; + } + + &-2 { + margin: 2rem; + } +} + +.m-top { + &-1 { + margin-top: 1rem; + } + + &-2 { + margin-top: 2rem; + } +} + +.m-bottom { + &-1 { + margin-bottom: 1rem; + } + + &-2 { + margin-bottom: 2rem; + } +} + +.padding { + + &-1 { + padding: 1rem; + } + + &-2 { + padding: 2rem; + } + +} + +.p-topbottom { + + &-1 { + padding: 1rem 0; + + } + + &-2 { + padding: 2rem 0; + } + +} diff --git a/web/themes/custom/dchadwick/src/sass/style.scss b/web/themes/custom/dchadwick/src/sass/style.scss index a0e173f..7d17342 100644 --- a/web/themes/custom/dchadwick/src/sass/style.scss +++ b/web/themes/custom/dchadwick/src/sass/style.scss @@ -49,6 +49,7 @@ $container-plus-padding: 1216px; @import "partials/article"; @import "partials/breadcrumbs"; @import "partials/characters"; +@import "partials/lb-styles"; html { font-size: 100%;