Skip to content

Commit 7670214

Browse files
Text dissplayed in tooltips for long texts in columns "ressource" and "user"
1 parent 957915d commit 7670214

File tree

3 files changed

+95
-41
lines changed

3 files changed

+95
-41
lines changed

server/assets/css/app.css

Lines changed: 46 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -308,28 +308,65 @@ nav {
308308
.tooltip {
309309
position: relative;
310310
display: inline-table;
311+
311312
}
312313

313-
.tooltip .tooltiptext {
314+
.tooltiptext {
314315
visibility: hidden;
315-
width:max-content;
316-
background-color: #165f55;
317-
color: #fff;
316+
width: 1000px;
317+
background-color: rgb(242, 248, 249);
318318
text-emphasis:unset;
319-
text-align: center;
319+
320320
border-radius: 6px;
321-
padding: 5px 0;
322321
position: absolute;
323322
z-index: 1;
324-
bottom: 120%;
325-
left: 5%;
326-
margin-left: 2em;
323+
margin-left: -12em;
324+
margin-top:-1em;
327325
opacity: 0;
328326
transition: opacity 0.7s;
329327
}
330328

329+
.tooltiptextleftcolumn {
330+
text-align: left;
331+
}
332+
333+
.tooltiptextrigthcolumn {
334+
text-align: center;
335+
transform: translate(-50%, 0%);
336+
}
337+
331338
.tooltip:hover .tooltiptext {
332339
visibility: visible;
333340
opacity: 1;
334341
padding: 1em;
342+
}
343+
344+
.scrolldown {
345+
border-collapse: collapse;
346+
border-spacing: 0;
347+
width: 100%;
348+
}
349+
350+
.scrolldown thead , .scrolldown tbody {
351+
display: block;
352+
}
353+
354+
.scrolldown tbody tr, .scrolldown thead tr {
355+
display: grid;
356+
grid-template-columns: 1.2fr 0.6fr 1.2fr 1fr;
357+
}
358+
359+
.scrolldown thead {
360+
color: #3f4246;
361+
font-size: small;
362+
}
363+
364+
.scrolldown tbody {
365+
max-height: 100px;
366+
overflow-y: auto;
367+
overflow-x: hidden;
368+
color: #3f4246;
369+
line-height: 0%;
370+
font-size: small;
371+
table-layout: fixed;
335372
}

server/lib/field_hub_web/live/project_show.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ defmodule FieldHubWeb.Live.ProjectShow do
4444
|> assign(:confirm_project_name, "")
4545
|> assign(:delete_files, false)
4646
|> assign(:hide_cache_cleared_message, true)
47-
|> assign(:n_changes_to_display, 5)
47+
|> assign(:n_changes_to_display, 100)
4848
|> assign(:page_title, project)
4949
|> read_project_doc()
5050
}

server/lib/field_hub_web/live/project_show.html.heex

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@
6868

6969
<section>
7070
<tr>
71-
<td valign="top" class="column-last-changes-slider">
72-
<form id="last_changes_form" phx-change="change_count_select">
73-
Show the {@n_changes_to_display}<br /> last changes
74-
<div class="slider-container">
71+
<%!-- <td valign="top" class="column-last-changes-slider">
72+
<form id="last_changes_form" phx-change="change_count_select"> --%>
73+
<%!-- Show the {@n_changes_to_display}<br /> last changes --%>
74+
<%!-- <div class="slider-container">
7575
<input
7676
type="range"
7777
min="2"
@@ -80,40 +80,57 @@
8080
class="slider"
8181
name="n-last-changes"
8282
/>
83-
</div>
84-
</form>
85-
</td>
86-
<td>
87-
<table>
88-
<tbody class="row-compact">
89-
<tr class="row-head">
83+
</div> --%>
84+
<%!-- </form>
85+
</td> --%>
86+
<%!-- <td> --%>
87+
<%!-- <td>
88+
10 changes <br />
89+
50 changes <br />
90+
100 changes <br />
91+
All changes <br />
92+
</td> --%>
93+
<td>History</td>
94+
<td>
95+
96+
<table class="scrolldown">
97+
<thead>
98+
<tr>
9099
<th>Ressource</th>
91100
<th>Action</th>
92101
<th>User</th>
93102
<th>Time</th>
94103
</tr>
95-
<%= for change <- last_n_changes do %>
96-
<% {type, date_time, user_name} =
97-
CouchService.extract_most_recent_change_info(change) %>
98-
<tr>
99-
<td>'{change["doc"]["resource"]["identifier"]}'</td>
100-
<td>{type}</td>
101-
<td>
102-
<i>{ user_name |> String.slice(0..24) }</i>
103-
<div class="tooltip" :if={ String.length(user_name) > 24 } >
104-
...
105-
<span class="tooltiptext">{ user_name } </span>
106-
</div>
107-
</td>
108-
<td class="column-date-time">
109-
{Calendar.strftime(date_time, "%c")}
110-
</td>
111-
</tr>
112-
<% end %>
104+
</thead>
105+
<tbody>
106+
<%= for change <- last_n_changes do %>
107+
<% {type, date_time, user_name} =
108+
CouchService.extract_most_recent_change_info(change) %>
109+
<tr>
110+
<td>
111+
{ change["doc"]["resource"]["identifier"] |> String.slice(0..18) }
112+
<div class="tooltip" :if={ String.length(change["doc"]["resource"]["identifier"]) > 18 } >
113+
...
114+
<span class="tooltiptext tooltiptextleftcolumn">{ change["doc"]["resource"]["identifier"] } </span>
115+
</div>
116+
</td>
117+
<td>{type}</td>
118+
<td>
119+
<i>{ user_name |> String.slice(0..18) }</i>
120+
<div class="tooltip" :if={ String.length(user_name) > 18 } >
121+
...
122+
<span class="tooltiptext tooltiptextrigthcolumn">{ user_name } </span>
123+
</div>
124+
</td>
125+
<td class="column-date-time">
126+
{Calendar.strftime(date_time, "%c")}
127+
</td>
128+
</tr>
129+
<% end %>
113130
</tbody>
114-
</table>
131+
</table>
115132
</td>
116-
</tr>
133+
</tr>
117134
</section>
118135

119136
<section>

0 commit comments

Comments
 (0)