Skip to content

Commit

Permalink
Sort out spacing of tabs on thematical pages
Browse files Browse the repository at this point in the history
  • Loading branch information
stacytalbot committed Aug 18, 2020
1 parent 3781660 commit 8f10682
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 43 deletions.
22 changes: 12 additions & 10 deletions app/javascript/components/tabs/Tabs.vue
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
<template>
<div class="tabs">
<ul class="tabs__triggers">
<tab-trigger
v-for="tab, index in tabTriggers"
:key="`${tab.id}-${index}`"
:id="tab.id"
:selected-id="selectedId"
:title="tab.title"
v-on:click:tab="click"
/>
</ul>
<div class="container">
<ul class="tabs__triggers">
<tab-trigger
v-for="tab, index in tabTriggers"
:key="`${tab.id}-${index}`"
:id="tab.id"
:selected-id="selectedId"
:title="tab.title"
v-on:click:tab="click"
/>
</ul>
</div>

<slot :selected-id="selectedId" />
</div>
Expand Down
8 changes: 3 additions & 5 deletions app/views/layouts/cms/_equity.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
}
%>

<section class="container">
<%= render partial: "partials/tabs/tabs-equity", locals: {
tabs: tabs
} %>
</section>
<%= render partial: "partials/tabs/tabs-equity", locals: {
tabs: tabs
} %>

<section class="container">
<%= render "partials/cards/resources" %>
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/partials/_hero-area-types.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<% end %>
>
<div class="hero__container container">

<div class="hero__content">
<h1><%= title %></h1>

Expand Down
18 changes: 10 additions & 8 deletions app/views/pame/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<%= render partial: "./layouts/partials/hero-basic", locals: { title: @cms_page.label, classes: "#{@cms_page.slug} bg-image-overlay--white" } %>

<section class="container page-padding--bottom">
<section class="page-padding--bottom">
<tabs
class="tabs--hero"
:tab-triggers="<%= @tabs %>"
>
<template slot-scope="{ selectedId }">
<tab-target :id="1" :selected-id="selectedId">
<filtered-table
:attributes="<%= @table_attributes %>"
endpoint="/pame/list"
:filters="<%= @filters %>"
:json="<%= @json %>"
>
</filtered-table>
<div class="container">
<filtered-table
:attributes="<%= @table_attributes %>"
endpoint="/pame/list"
:filters="<%= @filters %>"
:json="<%= @json %>"
>
</filtered-table>
</div>
</tab-target>

<tab-target :id="2" :selected-id="selectedId">
Expand Down
2 changes: 1 addition & 1 deletion app/views/partials/tabs/_tabs-equity.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<%= cms_fragment_render("tab-content-1") %>
</section>

<section class="section-padding--bottom">
<section class="container section-padding--bottom">
<select-equity
:protected-areas="<%= protected_areas.to_json %>"
><select-equity>
Expand Down
30 changes: 12 additions & 18 deletions app/views/partials/tabs/_tabs-thematic-area-database.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,13 @@
>
<template slot-scope="{ selectedId }">
<tab-target :id="1" :selected-id="selectedId">
<div class="container">
<section class="container--medium section-padding--bottom">
<%= cms_fragment_render("tab-content-1") %>
</section>
<section class="container--medium section-padding--bottom">
<%= cms_fragment_render("tab-content-1") %>
</section>

<section class="section-padding--bottom">
<%= render partial: "partials/search/protected-areas", locals: { config: config_search } %>
</section>
</div>
<section class="section-padding--bottom">
<%= render partial: "partials/search/protected-areas", locals: { config: config_search } %>
</section>

<section class="map-section">
<%= render partial: "partials/maps/main", locals: {
Expand All @@ -22,19 +20,15 @@
</tab-target>

<tab-target :id="2" :selected-id="selectedId">
<div class="container">
<section class="container--medium">
<%= cms_fragment_render("tab-content-2") %>
</section>
</div>
<section class="container--medium">
<%= cms_fragment_render("tab-content-2") %>
</section>
</tab-target>

<tab-target :id="3" :selected-id="selectedId">
<div class="container">
<section class="container--medium">
<%= cms_fragment_render("tab-content-3") %>
</section>
</div>
<section class="container--medium">
<%= cms_fragment_render("tab-content-3") %>
</section>
</tab-target>
</template>
</tabs>

0 comments on commit 8f10682

Please sign in to comment.