Skip to content

Commit 030df65

Browse files
authored
fix: display actual number of industrial users (ocaml#2922)
1 parent c30b3f4 commit 030df65

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

src/ocamlorg_frontend/pages/industrial_users.eml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ let job_card (job: Data.Job.t) =
5353
</div>
5454
</a>
5555

56-
let render ~(users : Data.Industrial_user.t list) ~success_stories ~(top_story: Data.Success_story.t) ~(testimonials: Data.Testimonial.t list) ~jobs_with_count =
56+
let render ~number_of_industrial_users ~(users : Data.Industrial_user.t list) ~success_stories ~(top_story: Data.Success_story.t) ~(testimonials: Data.Testimonial.t list) ~jobs_with_count =
5757
Layout.render
5858
~use_swiper:true
5959
~title:"OCaml in Industry"
@@ -138,18 +138,7 @@ the community and learn more about how they use OCaml."
138138
</div>
139139
<% ); %>
140140
</div>
141-
<% ); %>
142-
</div>
143-
<a href="<%s Url.success_story top_story.slug %>" class="flex-1 relative rounded-lg overflow-hidden md:flex max-h-[400px] group">
144-
<div class="absolute inset-0 z-10 flex flex-col justify-end text-dark-title p-6 <%s get_background_class (top_story) %>">
145-
<div class="h-10 mb-2"><img class="h-full" src='<%s Ocamlorg_static.Media.url top_story.card_logo %>' alt=""></div>
146-
<p class="mb-3 text-xl"><%s top_story.title %></p>
147-
<div class="flex items-center">
148-
<%s! Icons.blog "h-5" %>
149-
<p class="group-hover:underline ml-2 cursor-pointer">Read Story</p>
150-
</div>
151-
</div>
152-
<img class="w-full object-cover transition-transform duration-500 ease-[cubic-bezier(.7,0,0,1)] scale-105 group-hover:scale-100" src="<%s! Ocamlorg_static.Media.url (top_story).background %>" alt="">
141+
<% ); %>List.length users |> string_of_inttion-500 ease-[cubic-bezier(.7,0,0,1)] scale-105 group-hover:scale-100" src="<%s! Ocamlorg_static.Media.url (top_story).background %>" alt="">
153142
</a>
154143
</div>
155144
</div>
@@ -209,7 +198,7 @@ the community and learn more about how they use OCaml."
209198
</div>
210199
<div class="flex items-center justify-center">
211200
<a href="<%s Url.industrial_businesses %>" class="h-11 border btn-outline text-primary items-center mt-5 lg:mt-12 inline-flex py-1 px-4 rounded-md md:text-lg">
212-
View <%s List.length users |> string_of_int %> Businesses Using OCaml
201+
View <%s number_of_industrial_users |> string_of_int %> Businesses Using OCaml
213202
</a>
214203
</div>
215204
</div>

src/ocamlorg_web/lib/handler.ml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ let industrial_users _req =
328328
in
329329
let top_story = List.hd (sort_by_priority_desc Data.Success_story.all) in
330330
let users = Data.Industrial_user.featured |> Ocamlorg.Import.List.take 6 in
331+
let number_of_industrial_users = List.length Data.Industrial_user.all in
331332
let success_stories =
332333
match sort_by_priority_desc Data.Success_story.all with
333334
| [] -> []
@@ -340,8 +341,8 @@ let industrial_users _req =
340341
let jobs_with_count = (jobs, List.length Data.Job.all) in
341342

342343
Dream.html
343-
(Ocamlorg_frontend.industrial_users ~users ~success_stories ~top_story
344-
~testimonials ~jobs_with_count)
344+
(Ocamlorg_frontend.industrial_users ~number_of_industrial_users ~users
345+
~success_stories ~top_story ~testimonials ~jobs_with_count)
345346

346347
let industrial_businesses _req =
347348
let businesses = Data.Industrial_user.all in

0 commit comments

Comments
 (0)