-
Notifications
You must be signed in to change notification settings - Fork 0
/
portal_home
174 lines (169 loc) · 7.34 KB
/
portal_home
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
{% if portal.current_tab and portal.current_tab == "home" %}
<section>
{{ page_message }}
</section>
<section class="container-fluid px-0 fw-helpcenter mb-md-n64">
<div class="container">
<div class="row">
<div class="col-md-9 col-lg-6 mx-auto">
{% assign search_text = 'portal_translations.banner.search_text' | t %}
{{ portal | search_element: search_text }}
</div>
</div>
</div>
</section>
{% endif %}
<section class="container-fluid px-0 mt-16">
<div class="container">
<div class="row justify-content-center">
{%for card in portal.home_cards %}
{% if card.show %}
<div class="col-md-6 col-xl-3 mb-8">
<a class="card fw-horizontal" href="{{card.url}}" aria-label={{card.label}}>
<div class="col-3 px-0 my-auto text-center">
<div class="fw-category-icon">
{{ card.image }}
</div>
</div>
<div class="card-body col-9">
<h2 class="mt-0 card-title fs-18 line-clamp-2">{{card.label}}</h2>
<p class="line-clamp-3">{{card.description}}</p>
</div>
</a>
</div>
{% endif %}
{% endfor %}
</div>
</div>
</section>
{% assign solutionCards = 1 %}
{% assign solutionCardsLimit = 3 %}
{% if portal.has_solutions and solutionCardsLimit != 0 %}
<section class="container-fluid px-0">
<div class="container">
<div class="fw-section-heading text-center mt-28 mt-md-44 mb-24 mb-md-16">
<h2>{{ 'portal_translations.home.solutions' | t }}</h2>
<a href="{{ portal.solutions_home_url }}">{{ 'portal_translations.home.view_articles' | t }}</a>
</div>
<div class="row justify-content-center">
{% for category in portal.solution_categories %}
{% if solutionCards > solutionCardsLimit %}{% break %}{% endif %}
{% if category.folders_count > 0 %}
{% for folder in category.folders %}
{% assign solutionCards = solutionCards | plus:1 %}
<div class="col-md-4 col-xl-3 mb-8">
<a class="card h-100 fw-kbase-card" aria-label="{{ category.name | escape_once }}" href="{{ category.url }}">
<div class="px-0 my-auto fw-icon-holder">
{% if category.icon %}
<img src="{{category.icon}}" class="img-fluid" alt="{{ category.name | escape_once }}">
{% else %}
<span class="icon-category"></span>
{% endif %}
</div>
<div class="card-body">
<p class="mt-0 card-title fs-18 line-clamp-2">{{ category.name | escape_once }}</p>
<p class="line-clamp-2">{{ category.description }}</p>
</div>
</a>
</div>
{% break %}
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
</section>
{% endif %}
{% assign forumCards = 1 %}
{% assign forumCardsLimit = 3 %}
{% if portal.has_forums and forumCardsLimit != 0 %}
<section class="container-fluid px-0 pb-60">
<div class="container">
<div class="fw-section-heading text-center mt-28 mt-md-44 mb-24 mb-md-16">
<h2>{{ 'portal_translations.home.forums' | t }}</h2>
<a href="{{ portal.discussions_home_url }}">{{ 'portal_translations.home.view_topics' | t }}</a>
</div>
<div class="row justify-content-center">
{% for category in portal.forum_categories %}
{% if forumCards > forumCardsLimit %}{% break %}{% endif %}
{% if category.forums_count > 0 %}
{% for forum in category.forums %}
{% assign forumCards = forumCards | plus:1 %}
<div class="col-md-4 col-xl-3 mb-8">
<a class="card h-100" href="{{ category.url }}" aria-label="{{ category.name | escape_once }}">
<div class="card-body">
<p class="mt-0 card-title fs-18 line-clamp-2">{{ category.name | escape_once }}</p>
<p class="line-clamp-2">{{ category.description | escape_once }}</p>
</div>
</a>
</div>
{% break %}
{% endfor %}
{% endif %}
{% endfor %}
</div>
</div>
</section>
{% endif %}
<section class="container-fluid px-0 pt-60 pb-44 bg-dark">
<div class="container">
{% if portal.has_solutions %}
{% assign articles = portal | popular_articles:4 %}
{% if articles.size > 0 %}
<div class="col-xl-9 mx-auto mb-32">
<div class="fw-section-heading row mb-16">
<div class="col-md-8 text-center text-lg-start">
<h4>{{ 'portal_translations.home.popular_articles' | t }}</h4>
</div>
<div class="col-md-4 text-center text-end">
<a href="{{portal.solutions_home_url}}">{{ 'portal_translations.home.view_articles' | t }}</a>
</div>
</div>
<div class="fw-articles">
<div class="row">
{% for article in articles %}
<a class="col-md-6 fw-article-info d-flex" href="{{article.url}}" aria-label='{{ 'portal_translations.home.url-aria-label' | t }}'>
<div class="pt-4 pe-8"><span class="icon-article pr-8"></span></div>
<div>
<p class="fs-18 semi-bold line-clamp-2">{{article.title"}}</p>
<p class="line-clamp-2 fw-meta-info">{{ article | solution_author_info: 'portal_home' }}
</p>
</div>
<p></p>
</a>
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% endif %}
{% if portal.has_forums %}
{% assign topics = portal.most_viewed_topics %}
{% if topics.size > 0 %}
<div class="col-xl-9 mx-auto">
<div class="fw-section-heading row mb-16">
<div class="col-md-8 text-center text-lg-start">
<h4>{{ 'portal_translations.home.treanding_topics' | t }}</h4>
</div>
<div class="col-md-4 text-center text-end">
<a href="{{portal.discussions_home_url}}">{{ 'portal_translations.home.view_topics' | t }}</a>
</div>
</div>
<div class="fw-articles odd-count">
<div class="row">
{% for topic in topics limit:4 %}
<a class="col-md-6 fw-article-info d-flex" href="{{topic.topic_url}}" aria-label="{% translate portal_translations.home.url-aria-label %}">
<div class="pt-4 pe-8"><span class="icon-topic pe-8"></span></div>
<div>
<p class="fs-18 semi-bold line-clamp-2">{{ topic.title | escape_once }}</p>
<p class="line-clamp-2 fw-meta-info">{% translate portal_translations.home.topic.created_on %} {{topic.created_on_strftime}} {% translate portal_translations.home.topic.by %} {{topic.author_name}}</p>
</div>
</a>
{% endfor %}
</div>
</div>
</div>
{% endif %}
{% endif %}
</div>
</section>