ohilbig01 / simpleStatistics

OJS-Plugin to display cumulative galley views and downloads.
5 stars 3 forks source link

Display problem related to the length of the galley label #3

Closed bibliothekswelt closed 4 months ago

bibliothekswelt commented 8 months ago

I have encountered a display problem in the Simple Statistics plugin that is related to the length of the galley label. If the galley label is longer than one line, the label text is wrapped. The number of views / downloads is then also displayed in the next line. However, if the galley label has a specific length, only the number of views / downloads is wrapped. The number then appears in the same line of the next galley label, directly after the number of views / downloads of that label.

Example:

Name of Galley     Views/Downloads

Galley 1                227
Galley 2 with a very long
label                   181
Galley 3 with a long label
Galley 4             150311

In this case "311" is the number of views / downloads of Galley 3, "150" of Galley 4. Both are combined to 150311.

I have revised the CSS so that the galley label is no longer wrapped and is cut off above a certain limit on larger screens (min-width 768px and above). On smaller screens there is usually enough space also for larger labels because the whole plugin is shown in one column and not on the right-hand side. The number of views / downloads is always displayed to the right of the galley label in the same line, regardless of the length of the galley label. I have also tweaked the CSS code a bit.

I have attached 2 screenshots and the CSS file I have revised.

Current plugin version with display problem

simplestatistics_css problem

Plugin with revised CSS

simplestatistics_corrected css

Revised CSS (uploaded as .txt as I was not able to upload a .css file)

simpleStatistics.txt

ohilbig01 commented 7 months ago

Hi @bibliothekswelt,

thanks for your contribution! Yes, that is a possible solution, I myself would perhaps prefer to do it in a template, using something like {$galleyLabels[$i]|truncate:20:"...":true}. I will include this in the next version (for OJS 3.4.), which is actually ready but I haven't gotten around to uploading it yet. Article versions are also taken into account there, which I had previously overlooked.

Best regards