Merge pull request #13943 from pavelk-lab/replace-brand-story-angular-with-details

Replace Angular expand/collapse with native HTML <details>/<summary> for brand story
This commit is contained in:
Rachel Arnould
2026-02-27 15:37:00 +01:00
committed by GitHub
5 changed files with 63 additions and 45 deletions

View File

@@ -1,5 +0,0 @@
angular.module('Darkswarm').controller "HomeCtrl", ($scope) ->
$scope.brandStoryExpanded = false
$scope.toggleBrandStory = ->
$scope.brandStoryExpanded = !$scope.brandStoryExpanded

View File

@@ -6,21 +6,21 @@
%p
= t :brandstory_intro
#brand-story-text.hide-show.slideable
%p
= t :brandstory_part1
%p
= t :brandstory_part2
%p
= t :brandstory_part3
%p
= t :brandstory_part4
%p
%strong
= t :brandstory_part5_strong
%p
= t :brandstory_part6
%a.text-vbig{"slide-toggle" => "#brand-story-text", "ng-click" => "toggleBrandStory()"}
%i.ofn-i_005-caret-down{"ng-hide" => "brandStoryExpanded"}
%i.ofn-i_006-caret-up{ "ng-show" => "brandStoryExpanded"}
%details#brand-story-text
%summary
%i.ofn-i_005-caret-down
%i.ofn-i_006-caret-up
.brand-story-content
%p
= t :brandstory_part1
%p
= t :brandstory_part2
%p
= t :brandstory_part3
%p
= t :brandstory_part4
%p
%strong
= t :brandstory_part5_strong
%p
= t :brandstory_part6

View File

@@ -5,7 +5,7 @@
- content_for :page_alert do
= render "shared/menu/alert"
%div{"ng-controller" => "HomeCtrl"}
%div
= render "home/tagline"
#panes

View File

@@ -71,8 +71,50 @@
}
}
a.text-vbig i {
font-size: 75px;
#brand-story-text {
text-align: center;
margin-top: 1rem;
summary {
list-style: none;
cursor: pointer;
display: inline-block;
&::-webkit-details-marker {
display: none;
}
&::marker {
display: none;
}
i {
font-size: 75px;
}
.ofn-i_005-caret-down {
display: inline-block;
}
.ofn-i_006-caret-up {
display: none;
}
}
&[open] summary {
.ofn-i_005-caret-down {
display: none;
}
.ofn-i_006-caret-up {
display: inline-block;
}
}
.brand-story-content {
margin-top: 1rem;
text-align: left;
}
}
}

View File

@@ -1,19 +0,0 @@
describe "HomeCtrl", ->
ctrl = null
scope = null
beforeEach ->
module 'Darkswarm'
scope = {}
inject ($controller) ->
ctrl = $controller 'HomeCtrl', {$scope: scope}
it "starts with the brand story contracted", ->
expect(scope.brandStoryExpanded).toBe false
it "toggles the brand story", ->
scope.toggleBrandStory()
expect(scope.brandStoryExpanded).toBe true
scope.toggleBrandStory()
expect(scope.brandStoryExpanded).toBe false