Skip to content

Commit 96ed39d

Browse files
Add Carousel
1 parent 3fc2fc8 commit 96ed39d

File tree

15 files changed

+70
-21
lines changed

15 files changed

+70
-21
lines changed

Client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sunengine-client",
3-
"version": "2.12.4",
3+
"version": "2.13.0",
44
"description": "SunEngine - web engine with support of blog, forum and articles functionality",
55
"productName": "SunEngine",
66
"author": "Dmitrij Polianin",

Client/src/comp/LinksMenu.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default {
4747
},
4848
methods: {
4949
removeEdgeDelimeters() {
50-
const spans = this.$el.childNodes;
50+
const spans = this.$el.getElementsByClassName("links-menu")[0].childNodes;
5151
5252
spans.forEach(span => {
5353
if (span.classList.contains("hidden")) span.classList.remove("hidden");
@@ -64,7 +64,8 @@ export default {
6464
if (!spans[i + 1] || !spans[i - 1]) return;
6565
6666
if (
67-
currentSpanL > spans[i + 1].getBoundingClientRect().left ||
67+
spans[i + 1].classList.contains("newline") ||
68+
currentSpanL > spans[i + 1].getBoundingClientRect().left ||
6869
currentSpanR < spans[i - 1].getBoundingClientRect().right
6970
) {
7071
span.classList.add("hidden");

Client/src/css/app.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ $paddings: (8px 16px 24px);
126126

127127
// ——— Elements ————————————————————————————————————
128128

129+
.text-carousel {
130+
color: $primary;
131+
}
132+
129133
.captcha-block {
130134
padding: 10px 10px 10px 44px;
131135
border-radius: 5px;

Client/src/i18n/en-us/admin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,6 @@ export default {
361361
items: {
362362
"Global:Locale": "Interface language",
363363
"Global:SiteName": "Site name",
364-
"Global:SiteTitle": "Site title",
365364
"Global:SiteSubTitle": "Site subtitle",
366365
"Global:IconsSet": "Icon set",
367366
"Global:PageTitleTemplate": "Site title template in browser",
@@ -371,6 +370,8 @@ export default {
371370
"Global:OpenExternalLinksAtNewTab": "Open external links in new window",
372371
"Global:IndexMaterial": "Index page",
373372
"Global:layoutOptions": "Layout options https://quasar.dev/layout/layout#QLayout-API",
373+
"Parts:SiteTitle": "Site title",
374+
"Parts:FooterSeparatorClassName": "Footer separator css class name",
374375
"Parts:HeaderBackground": "Header line background",
375376
"Parts:MenuLogo": "Menu logo",
376377
"Dev:ShowExceptions": "Show exceptions",

Client/src/i18n/ru/admin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ export default {
394394
"Global:SiteName": "Имя сайта",
395395
"Global:PageTitleTemplate":
396396
"Шаблон заголовка (title) страниц сайта в браузере",
397-
"Global:SiteTitle": "Заголовок сайта",
398397
"Global:SiteSubTitle": "Подзаголовок сайта",
399398
"Global:HomePageRedirect": "Перенаправление с главной страницы",
400399
"Global:DisallowRegistration": "Запретить регистрацию новых пользователей",
@@ -403,6 +402,8 @@ export default {
403402
"Global:IconsSet": "Иконки",
404403
"Global:IndexMaterial": "Главная страница",
405404
"Global:layoutOptions": "Настройки шаблона https://quasar.dev/layout/layout#QLayout-API",
405+
"Parts:SiteTitle": "Заголовок сайта",
406+
"Parts:FooterSeparatorClassName": "Имя класса css иконки разделителя в подвале",
406407
"Parts:HeaderBackground": "Фон шапки",
407408
"Parts:MenuLogo" :"Логотип в меню",
408409
"Dev:ShowExceptions": "Показывать исключения в логах",

Client/src/layout/Layout.vue

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,13 @@
134134
linkClasses="layout__footer-link"
135135
:menuItem="footerMenuItem"
136136
>
137-
<q-icon
138-
:name="$iconsSet.Layout.heart"
139-
class="layout__footer-separator-icon"
140-
size="12px"
141-
/>
137+
<q-icon v-if="footerSeparatorClassName"
138+
:name="footerSeparatorClassName"
139+
class="layout__footer-separator-icon"
140+
size="12px"
141+
/>
142+
<span v-else class="layout__footer-separator-icon">
143+
</span>
142144
</LinksMenu>
143145

144146
<!-- Do not remove this component from the layout. -->
@@ -172,6 +174,11 @@ export default {
172174
}
173175
},
174176
computed: {
177+
footerSeparatorClassName() {
178+
if(config.Global.FooterSeparatorClassName === "-")
179+
return null;
180+
return config.Global.FooterSeparatorClassName ?? this.$iconsSet.Layout.heart;
181+
},
175182
siteTitle() {
176183
return config.Global.SiteTitle;
177184
},

Client/src/modules/material/Material.vue

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,23 @@
88
:subTitle="material.subTitle"
99
/>
1010

11+
<q-carousel transition-prev="jump-right"
12+
transition-next="jump-left"
13+
swipeable
14+
animated
15+
control-color="carousel"
16+
navigation
17+
infinite
18+
padding
19+
arrows
20+
v-model="carouselCurrent" v-if="carouselImages" >
21+
<q-carousel-slide :name="img" v-for="img in carouselImages" :key="img" class="column no-wrap flex-center">
22+
<img :src="img" class="material__carousel--img" />
23+
</q-carousel-slide>
24+
</q-carousel>
25+
26+
27+
1128
<div class="material__text q-mb-lg" v-html="material.text"></div>
1229

1330
<footer>
@@ -153,7 +170,9 @@ export default {
153170
material: null,
154171
comments: null,
155172
page: null,
156-
headersPrepared: false
173+
headersPrepared: false,
174+
carouselImages: null,
175+
carouselCurrent: null
157176
};
158177
},
159178
watch: {
@@ -256,6 +275,7 @@ export default {
256275
}
257276
},
258277
methods: {
278+
259279
loadDataMaterial() {
260280
return this.$request(this.$Api.Materials.Get, {
261281
idOrName: this.idOrName
@@ -268,13 +288,23 @@ export default {
268288
}
269289
this.title = this.material.title;
270290
this.$nextTick(() => {
291+
this.preapairCarousel();
271292
prepareLocalLinks.call(this, this.$el, "material__text");
272293
prepareParagraphs.call(this, this.$el, "material__text");
273294
if (this.material.settingsJson?.allowInnerJavaScript)
274295
execScripts(this.$el);
275296
});
276297
});
277298
},
299+
preapairCarousel() {
300+
const imgs = Array.from(this.$el.getElementsByTagName("img"));
301+
const carImgs = imgs.filter(x=>x.hasAttribute("carousel"));
302+
if(!carImgs || carImgs.length === 0)
303+
return;
304+
this.carouselImages = carImgs.map(x=>x.getAttribute("src"));
305+
this.carouselCurrent = this.carouselImages[0];
306+
carImgs.forEach(x=>x.remove());
307+
},
278308
async loadDataComments() {
279309
await this.$request(this.$Api.Comments.GetMaterialComments, {
280310
materialId: this.material.id
@@ -355,4 +385,8 @@ export default {
355385
.material__tags {
356386
text-align: center;
357387
}
388+
389+
.material__carousel--img {
390+
height: 100%;
391+
}
358392
</style>

README.RU.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
# SunEngine
1111

12-
<a href="#"><img src="https://img.shields.io/static/v1?label=%D0%92%D0%B5%D1%80%D1%81%D0%B8%D1%8F&message=v2.12.4&color=green"></a>
12+
<a href="#"><img src="https://img.shields.io/static/v1?label=%D0%92%D0%B5%D1%80%D1%81%D0%B8%D1%8F&message=v2.13.0&color=green"></a>
1313
<a href="#"><img src="https://github.com/sunengine/SunEngine/workflows/.NET%20Core/badge.svg" ></a>
1414
<a href="#"><img src="https://github.com/sunengine/SunEngine/workflows/Quasar/badge.svg" ></a>
1515
<br/>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Build on AspNet Core, VueJS, Quasar.</h3>
88

99
# SunEngine
1010

11-
<a href="#"><img src="https://img.shields.io/static/v1?label=Version&message=v2.12.4&color=green"></a>
11+
<a href="#"><img src="https://img.shields.io/static/v1?label=Version&message=v2.13.0&color=green"></a>
1212
<a href="#"><img src="https://github.com/sunengine/SunEngine/workflows/.NET%20Core/badge.svg" ></a>
1313
<a href="#"><img src="https://github.com/sunengine/SunEngine/workflows/Quasar/badge.svg" ></a>
1414
<br/>

Server/SunEngine.Cli/SunEngine.Cli.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>net5.0</TargetFramework>
55
<LangVersion>latest</LangVersion>
6-
<Version>2.12.4</Version>
6+
<Version>2.13.0</Version>
77
<Title>SunEngine</Title>
88
<Authors>Dmitrij Polianin</Authors>
99
<Description>Site engine with blog, forum and articles functionalities on Asp.Net Core and Vue.Js.</Description>

0 commit comments

Comments
 (0)