[REM] website, website_blog, website_event: remove text size on cover

task-2144335
This commit is contained in:
Romain Derie
2020-02-03 15:25:20 +00:00
committed by Jeremy Kersten
parent 860c7d79dd
commit d64eb2981f
9 changed files with 8 additions and 92 deletions
@@ -1051,7 +1051,6 @@ options.registry.CoverProperties = options.Class.extend({
// Update saving dataset
this.$target[0].dataset.coverClass = this.$el.find('[data-cover-opt-name="size"] we-button.active').data('selectClass') || '';
this.$target[0].dataset.textSizeClass = this.$el.find('[data-cover-opt-name="text_size"] we-button.active').data('selectClass') || '';
this.$target[0].dataset.textAlignClass = this.$el.find('[data-cover-opt-name="text_align"] we-button.active').data('selectClass') || '';
this.$target[0].dataset.filterValue = this.$filterValueOpts.filter('.active').data('filterValue') || 0.0;
this.$target[0].dataset.filterColor = this.$filterColorOpts.filter('.active').data('filterColor') || '';
@@ -151,7 +151,6 @@ var WysiwygMultizone = Wysiwyg.extend({
'background-color': el.dataset.filterColor,
'opacity': el.dataset.filterValue,
'resize_class': el.dataset.coverClass,
'text_size_class': el.dataset.textSizeClass,
'text_align_class': el.dataset.textAlignClass,
};
@@ -416,14 +416,6 @@
<we-button data-filter-color="oe_purple">Purple</we-button>
<we-button data-filter-color="oe_green">Green</we-button>
</we-select>
<we-select string="Text Size" data-cover-opt-name="text_size">
<we-button data-select-class="o_record_cover_font_hero">Hero</we-button>
<we-button data-select-class="o_record_cover_font_huge">Huge</we-button>
<we-button data-select-class="o_record_cover_font_big">Big</we-button>
<we-button data-select-class="">Regular</we-button>
<we-button data-select-class="o_record_cover_font_small">Small</we-button>
<we-button data-select-class="o_record_cover_font_tiny">Tiny</we-button>
</we-select>
<we-select string="Text Alignment" data-cover-opt-name="text_align">
<we-button data-select-class="">Left</we-button>
<we-button data-select-class="text-center">Centered</we-button>
+1 -2
View File
@@ -329,11 +329,10 @@
<t t-set="_cp" t-value="_cp or json.loads(_record.cover_properties)"/>
<div t-att-data-use_size="use_size"
t-att-data-use_filters="use_filters"
t-att-data-use_text_size="use_text_size"
t-att-data-use_text_align="use_text_align"
t-att-data-res-model="request.env.user.has_group('website.group_website_publisher') and _record._name"
t-att-data-res-id="request.env.user.has_group('website.group_website_publisher') and _record.id"
t-attf-class="o_record_cover_container d-flex flex-column h-100 bg-secondary #{use_size and _cp.get('resize_class')} #{use_text_size and _cp.get('text_size_class')} #{use_text_align and _cp.get('text_align_class')} #{additionnal_classes}">
t-attf-class="o_record_cover_container d-flex flex-column h-100 bg-secondary #{use_size and _cp.get('resize_class')} #{use_text_align and _cp.get('text_align_class')} #{additionnal_classes}">
<div class="o_record_cover_component o_record_cover_image" t-attf-style="background-image: #{_cp.get('background-image')};"/>
<div t-if="use_filters" t-attf-class="o_record_cover_component o_record_cover_filter #{_cp.get('background-color')}" t-attf-style="opacity: #{_cp.get('opacity', 0.0)};"/>
<t t-raw="0"/>
@@ -4,12 +4,12 @@
<record id="blog_blog_1" model="blog.blog">
<field name="name">Travel</field>
<field name="subtitle">Holiday tips</field>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/blog_1.jpeg')", "text_size_class": "o_record_cover_font_big", "resize_class": "o_record_has_cover o_half_screen_height", "background-color": "oe_black", "opacity": "0.4"}</field>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/blog_1.jpeg')", "resize_class": "o_record_has_cover o_half_screen_height", "background-color": "oe_black", "opacity": "0.4"}</field>
</record>
<record id="blog_blog_2" model="blog.blog">
<field name="name">Astronomy</field>
<field name="subtitle">Astronomy is “stargazing"</field>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/blog_2.jpeg')", "text_size_class": "o_record_cover_font_big", "resize_class": "o_record_has_cover o_half_screen_height", "background-color": "oe_black", "opacity": "0.4"}</field>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/blog_2.jpeg')", "resize_class": "o_record_has_cover o_half_screen_height", "background-color": "oe_black", "opacity": "0.4"}</field>
</record>
<!-- TAGS -->
@@ -37,7 +37,7 @@
<field name="is_published" eval="True"/>
<field name="published_date" eval="time.strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="tag_ids" eval="[(6, 0, [ref('blog_tag_1'), ref('blog_tag_2')])]"/>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_1.jpg')", "resize_class": "o_record_has_cover o_full_screen_height", "text_size_class": "o_record_cover_font_big", "background-color": "oe_black", "opacity": "0"}</field>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_1.jpg')", "resize_class": "o_record_has_cover o_half_screen_height", "background-color": "oe_black", "opacity": "0"}</field>
<field name="content"><![CDATA[
<p class="lead">Sierra Tarahumara, popularly known as Copper Canyon is situated in Mexico. The area is a favorite destination among those seeking an adventurous vacation.</p>
<p>Copper Canyon is one of the six gorges in the area. Although the name suggests that the gorge might have some relevance to copper mining, this is not the case. The name is derived from the copper and green lichen covering the canyon. Copper Canyon has two climatic zones. The region features an alpine climate at the top and a subtropical climate at the lower levels. Winters are cold with frequent snowstorms at the higher altitudes. Summers are dry and hot. The capital city, Chihuahua, is a high altitude desert where weather ranges from cold winters to hot summers. The region is unique because of the various ecosystems that exist within it.</p>
@@ -72,7 +72,7 @@
<field name="is_published" eval="True"/>
<field name="published_date" eval="(datetime.now()-relativedelta(days=2)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="tag_ids" eval="[(6, 0, [ref('blog_tag_2')])]"/>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_2.jpg')", "resize_class": "o_record_has_cover o_half_screen_height", "text_size_class": "o_record_cover_font_big", "background-color": "oe_blue", "opacity": "0.4"}</field>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_2.jpg')", "resize_class": "o_record_has_cover o_half_screen_height", "background-color": "oe_blue", "opacity": "0.4"}</field>
<field name="content"><![CDATA[
<section class="container">
<div class="row">
@@ -170,7 +170,7 @@ People who live on the island have never even seen this remarkable scenery unles
<field name="tag_ids" eval="[(6, 0, [ref('blog_tag_5')])]"/>
<field name="website_published" eval="True"/>
<field name="published_date" eval="(datetime.now()-relativedelta(days=6)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_4.jpg')", "resize_class": "o_record_has_cover o_half_screen_height", "text_size_class": "o_record_cover_font_big", "text_align_class": "text-center", "background-color": "oe_black", "opacity": "0.2"}</field>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_4.jpg')", "resize_class": "o_record_has_cover o_half_screen_height", "text_align_class": "text-center", "background-color": "oe_black", "opacity": "0.2"}</field>
<field name="content"><![CDATA[
<p class="lead">It is safe to say that at some point on our lives, each and every one of us has that moment when we are suddenly stunned when we come face to face with the enormity of the universe that we see in the night sky.</p>
@@ -253,7 +253,7 @@ People who live on the island have never even seen this remarkable scenery unles
<field name="tag_ids" eval="[(6, 0, [ref('blog_tag_3'), ref('blog_tag_4')])]"/>
<field name="website_published" eval="True"/>
<field name="published_date" eval="(datetime.now()-relativedelta(days=3)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_6.jpg')", "resize_class": "o_record_has_cover o_full_screen_height", "text_size_class": "o_record_cover_font_huge", "text_align_class": "text-center", "background-color": "oe_black", "opacity": "0.2"}</field>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_6.jpg')", "resize_class": "o_record_has_cover o_half_screen_height", "text_align_class": "text-center", "background-color": "oe_black", "opacity": "0.2"}</field>
<field name="content"><![CDATA[
<p class="lead">Buying the right telescope to take your love of astronomy to the next level is a big next step in the development of your passion for the stars.</p>
<p>In many ways, it is a big step from someone who is just fooling around with astronomy to a serious student of the science. But you and I both know that there is still another big step after buying a telescope before you really know how to use it.</p>
@@ -294,7 +294,7 @@ People who live on the island have never even seen this remarkable scenery unles
<field name="tag_ids" eval="[(6, 0, [ref('blog_tag_5')])]"/>
<field name="website_published" eval="True"/>
<field name="published_date" eval="(datetime.now()-relativedelta(days=7)).strftime('%Y-%m-%d %H:%M:%S')"/>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_7.jpg')", "resize_class": "o_record_has_cover o_half_screen_height", "text_size_class": "o_record_cover_font_big", "background-color": "oe_black", "opacity": "0.4"}</field>
<field name="cover_properties">{"background-image": "url('/website_blog/static/src/img/cover_7.jpg')", "resize_class": "o_record_has_cover o_half_screen_height", "background-color": "oe_black", "opacity": "0.4"}</field>
<field name="content"><![CDATA[
<p class="lead">For many of us, our very first experience of learning about the celestial bodies begins when we saw our first full moon in the sky. It is truly a magnificent view even to the naked eye.</p>
<p>If the night is clear, you can see amazing detail of the lunar surface just star gazing on in your back yard.
@@ -2,29 +2,6 @@
$o-wblog-sidebar-width: 280px;
$o-wblog-loader-size: 50px;
$o-wblog-title-sizes-variants: (
tiny: (
title: $display4-size*0.6,
subtitle: $lead-font-size
),
small: (
title: $display4-size*0.75,
subtitle: $lead-font-size
),
big: (
title: $display3-size,
subtitle: $lead-font-size*1.25
),
huge: (
title: $display2-size,
subtitle: $lead-font-size*1.5
),
hero: (
title: $display1-size,
subtitle: $lead-font-size*1.75
)
) !default;
// ======= ANIMATIONS =======
// Generic fade-in
@keyframes o-wblog-fade-In {
@@ -232,18 +209,6 @@ $o-wblog-title-sizes-variants: (
}
}
// Size variants
@each $size, $map in $o-wblog-title-sizes-variants {
.o_record_cover_font_#{$size} .o_wblog_post_title {
#o_wblog_post_name {
@include font-size(map-get($map, title));
}
#o_wblog_post_subtitle {
@include font-size(map-get($map, subtitle));
}
}
}
// Refine multi-lines titles when using 'regular' cover
.o_wblog_regular_cover_container #o_wblog_post_name {
line-height: 1;
@@ -158,7 +158,6 @@ list of filtered posts (by date or tag).
<t t-if="blog or first_post" t-call="website.record_cover">
<t t-set="_record" t-value="blog or first_post"/>
<t t-set="use_filters" t-value="True"/>
<t t-set="use_text_size" t-value="True"/>
<t t-set="use_text_align" t-value="True"/>
<t t-set="additionnal_classes" t-value="'o_wblog_post_page_cover o_record_has_cover cover_auto'"/>
@@ -234,7 +233,6 @@ list of filtered posts (by date or tag).
<t t-set="_record" t-value="blog_post"/>
<t t-set="use_filters" t-value="True"/>
<t t-set="use_size" t-value="True"/>
<t t-set="use_text_size" t-value="True"/>
<t t-set="additionnal_classes" t-value="'o_wblog_post_page_cover'"/>
<div class="container text-center position-relative h-100 d-flex flex-column flex-grow-1 justify-content-around">
@@ -437,7 +435,6 @@ list of filtered posts (by date or tag).
<a id="o_wblog_next_post_info" class="d-none"
t-att-data-size="_cp.get('resize_class')"
t-att-data-text="_cp.get('text_size_class')"
t-att-data-url="'/blog/' + slug(next_post.blog_id) + '/post/' + slug(next_post) + '?anim'"/>
<t t-set="next_cover_is_full" t-value="bool({'o_full_screen_height', 'cover_full'}.intersection(_cp.get('resize_class', '').split(' ')))"/>
@@ -1,26 +1,3 @@
$o-wevent-event-title-sizes-variants: (
tiny: (
title: $display4-size*0.6,
subtitle: $lead-font-size
),
small: (
title: $display4-size*0.75,
subtitle: $lead-font-size
),
big: (
title: $display3-size,
subtitle: $lead-font-size*1.25
),
huge: (
title: $display2-size,
subtitle: $lead-font-size*1.5
),
hero: (
title: $display1-size,
subtitle: $lead-font-size*1.75
)
) !default;
.o_wevent_event_searchbar_form {
flex: 0 0 100%;
@@ -193,17 +170,6 @@ $o-wevent-event-title-sizes-variants: (
}
}
@each $size, $map in $o-wevent-event-title-sizes-variants {
.o_record_cover_font_#{$size} .o_wevent_event_title {
.o_wevent_event_name {
@include font-size(map-get($map, title));
}
.o_wevent_event_subtitle {
@include font-size(map-get($map, subtitle));
}
}
}
.o_wevent_registration_btn {
flex: 0 0 100%;
@@ -394,7 +394,6 @@
<t t-set="_record" t-value="event"/>
<t t-set="use_filters" t-value="True"/>
<t t-set="use_size" t-value="True"/>
<t t-set="use_text_size" t-value="True"/>
<t t-set="use_text_align" t-value="True"/>
<div class="container d-flex flex-column flex-grow-1 justify-content-around">