ElkArte Community

Project Support => Support => Topic started by: Ruth on April 23, 2016, 12:59:37 pm

Title: Less space between attachments
Post by: Ruth on April 23, 2016, 12:59:37 pm
Hello!

I would like to have less space between the attachments in a post and the informations about the pictures should not need 3 lines.
I can remember I did this once (in BoardIndex.template?) but with some syntax error. O:-)

Now I have just resized the font a little, but there is still a lot of space between the pictures.

Code: [Select]
.attachments, .custom_fields_above_signature {
    border-top: 1px solid #436d94;
    font-size: 0.8em;
}

Is there a possibility to make a change in CSS to set the informations about the attachments in a single line?

It should look like the second picture.
Title: Re: Less space between attachments
Post by: Flavio93Zena on April 23, 2016, 01:08:56 pm
Site URL? Theme used? Resolution?
Title: Re: Less space between attachments
Post by: Ruth on April 23, 2016, 01:31:22 pm

Why do you need to know? Site Url is a secret. ;)

And the resolution should not matter, the informations about the attachment in a single line, as I would like to have it, should always stay the same, in any resolution.



It is the Default, the Light-Theme, with some changing.
Title: Re: Less space between attachments
Post by: Ruth on April 24, 2016, 04:57:47 am
I found it in Display.template.php on line 878 and changed it to this:

Code: [Select]
	, ', $attachment['size'], ($attachment['is_image'] ? ', ' . $attachment['real_width'] . 'x' . $attachment['real_height'] . ', ' . sprintf($txt['attach_viewed'], $attachment['downloads']) : ', ' . sprintf($txt['attach_downloaded'], $attachment['downloads'])), '

This time without syntax error. ;) It is looking better now to me.
Title: Re: Less space between attachments
Post by: emanuele on April 30, 2016, 06:39:41 am
Why the heck did I lost this one? :'(

Sorry! :-[

BTW, looking for a way to obtain almost the same result without touching the template, you could try with a simple css trick:
Code: [Select]
.attachment_name br:after {
    content: ' ';
}

.attachment_name br {
    content: ' ';
}
.attachment_name {
    word-break: normal;
}
that forces the br to behave like a space.
The "word-break" is to avoid oddities in certain cases. ;)
Title: Re: Less space between attachments
Post by: Ruth on April 30, 2016, 07:13:55 am
Thank you very much, Emanuele!  :) I have changed it. It is much better that way.

I really love it, that things like this can be done in CSS.
(If you know, how to do it) ;)
Title: Re: Less space between attachments
Post by: emanuele on April 30, 2016, 08:02:48 am
:D
Title: Re: Less space between attachments
Post by: Ruth on May 08, 2016, 03:09:33 pm
It is only working in Opera, Emanuele, I did not notice it before.

My users asked me, if they can get the attachments centered, so I changed it for them and afterwards I had a look at the attachments in Opera, Firefox and IE.

See the difference:
Title: Re: Less space between attachments
Post by: emanuele on May 08, 2016, 06:19:53 pm
Apparently it doesn't work reliably cross-brower... a bad trick. :(
Title: Re: Less space between attachments
Post by: Flavio93Zena on May 08, 2016, 11:47:00 pm
Code: [Select]
.attachment_name br { display: none; }
This should kill the spaces, but I am not sure about other implications, as it looks a bit different from the regular Light.
Title: Re: Less space between attachments
Post by: Ruth on May 09, 2016, 03:38:11 am
Thank you very much,  Flavio. I have tried it. It looks nearly the same as it was by using Emanueles trick.
And it only works in Opera, not with Firefox or IE, too.

I think, I will make this change in Display.template.php again. It should work for all browsers, as I believe?
It would be the only change in default, I did not touch it for anything else until now.

Our theme is not this much different to the light theme, Flavio. Just a bit more of color and many, many icons as smileys. ;)
Title: Re: Less space between attachments
Post by: Ruth on May 09, 2016, 03:52:17 am
No! It worked that way, Flavio! Great.

I uploadet (uploaded?) an older version first, without this changing. O:-)

It looks fine in all browsers now.
Title: Re: Less space between attachments
Post by: emanuele on May 09, 2016, 04:07:23 am
Except there is (for sure) no space between the size and the "viewed" part. ;)
Title: Re: Less space between attachments
Post by: Ruth on May 09, 2016, 05:28:07 am
Yes...there was no space between the size and the last part, Emanuele.

So I did this in index.german.php:

Code: [Select]
$txt['attach_viewed'] = '%1$d-mal angesehen';

changed to:

Code: [Select]
$txt['attach_viewed'] = ' %1$d-mal angesehen';

A little space there is working fine. ;)
Title: Re: Less space between attachments
Post by: Flavio93Zena on May 09, 2016, 07:23:36 am
Great :)
Title: Re: Less space between attachments
Post by: Ruth on July 15, 2017, 12:14:15 am
Since the last update the attachments in our forum are not proper centered.
I am not sure if and how  I can change this?  O:-) Adding a break somewhere in Display.template.php? Where?

My testforum is still runnig with ElkArte 1.0.9 and the attachments are still centered there.

I am adding a few screenshots. 

In forum everything is still looking proper, if the picture has 780 Pixel width and if the name of an attachment is long enough to get into a new line under the picture. (1. screenshot)

If the name is very short or the picture has less width, the names of the attachments are getting to the right side and therefore those attachments are no longer centered.  (2. and 3. screenshot)            

It should look again like it is still in my testforum (4. screenshot)
Title: Re: Less space between attachments
Post by: emanuele on July 15, 2017, 04:56:02 pm
If my test site doesn't have anything weird, I think with 1.0.10 the attachments area was changed to look a bit like the one on this site.
It may be that some of your custom css is having some... conflict with it.
Maybe @Spuds has an idea, otherwise I guess I'd need an account and a link to a topic that shows the issue (send it to me via PM, of course).
Title: Re: Less space between attachments
Post by: Ruth on July 16, 2017, 02:09:26 am
Quote from: emanuele – It may be that some of your custom css is having some... conflict with it.

It seems to be so... yes, Emanuele ;)

I do not need the attachments centered, it was a wish of my members.
But I still would like to have less space between the attachments as it is here on ElkArte.net.

Maybe it would be better to change everything back in our forum as it is in default... or better to wait until ElkArte 1.1. is finished?
I think I have to do a lot of changing in my custom.css anyway with Elkarte 1.1. ::)

But it would be kind if you have a look at the attachments in our forum.
 I will create a test-topic with several attachments and send you a pm about the account.
Title: Re: Less space between attachments
Post by: emanuele on July 16, 2017, 05:55:55 am
As far as I can see, the vertical distance between attachments is more or less the same as here, there is about 10px of difference.
Anyway we can do something.

To center the images, I'd use display block on two classes and to change the distance I'd tweak the line height of the name line, something like this:
Code: [Select]
.postarea .attachments .attachment {
    display: block;
}

.postarea .attachments .attachment_name {
    display: block;
    line-height: 1.3em;
}
in your custom_light.css
Title: Re: Less space between attachments
Post by: Ruth on July 16, 2017, 09:40:55 am
Thank you, Emanuele.

I have tried it, but nothing has changed.



Edit:

Sorry, Emanuele...

It seems to me, that my FTP Client is not working at all at the moment
I uploaded changed files a few times today, but it  does not show me any changing in the files.
I have to contact my hoster.
Title: Re: Less space between attachments
Post by: radu81 on July 16, 2017, 04:49:08 pm
Before contacting your hoster check the file permissions. You can do it with right click on your file in filezila or also on file manager included into Cpanel (if you have it). It should be 755 for folders and 644 for files.
Title: Re: Less space between attachments
Post by: Ruth on July 16, 2017, 06:07:59 pm
That one, Radu? I had a look at this today, but I never touched anything there....
Title: Re: Less space between attachments
Post by: Jorin on July 17, 2017, 01:26:44 am
No, these are the settings of ElkArte, don't use them. You use a FTP programm, right? Use this, connect to the server, click on a file you changed with the right mouse button and choose "CHMOD". Then you can see the file permissions.
Title: Re: Less space between attachments
Post by: Ruth on July 17, 2017, 02:13:38 am
Yes, I have tried this also yesterday, Jorin  but there is no "CHMOD" to see for me, with a right mouseclic , just that usual stuff O:-) (see screenshot)

Everything seems to work as usual, if I upload files via FTP. But it does not show me the date, when the file was uploaded/changed yesterday - just the date when I downloaded that file yesterday.

Last shown changes there from the files are from July 2016

Download is working, but not the upload. I tried it with a custom_light.css and two other files yesterday.


Wenn ich einen rechten Mausklick auf eine Datei mache, bekomme ich nur das übliche angezeigt, nichts mit Berechtigungen zu der jeweiligen Datei, Jorin. Im Juli 2016 habe ich wohl zum letzten Mal Dateien per FTP überspielt. Diese Änderungen werden mir auch angezeigt. Von gestern nur die Uhrzeit, wann ich eine Datei heruntergeladen habe.

Ich komme auch nicht weiter nach oben , oberhalb vom "root", was sonst immer ging. Nur noch bis zum root/htdocs, also dorthin, wo die einzelnen Ordner und Dateien liegen. Schaut für mich so aus, als ob da die Berechtigungen verändert worden wären.
Title: Re: Less space between attachments
Post by: Jorin on July 17, 2017, 02:29:47 am
See the CHMOD reference here: http://www.net2ftp.com/homepage/help-user.html
Title: Re: Less space between attachments
Post by: Ruth on July 17, 2017, 02:36:01 am
Ah! I see! I will try it again...

I uploaded one file again to see that green icon. But I cannot see any "CHMOD"  O:-)

Edit: It shows me the Date from today now, when I uploaded that file again. (two hours earlier than it really was) Must be the time from the upload, because I downloaded nothing today.

Title: Re: Less space between attachments
Post by: Jorin on July 17, 2017, 03:00:45 am
QuoteSelect directories or files and click on Chmod on the Browse Screen. The next screen show the current permissions...

Try this please. I don't use Net2FTP so I don't understand what the problem is right now.  O:-)
Title: Re: Less space between attachments
Post by: Ruth on July 17, 2017, 03:02:37 am
I have tried this also, Jorin. But there is no "Chmod on the Browse Screen" or "next screen" to see for me. Just the green icon.
Title: Re: Less space between attachments
Post by: Jorin on July 17, 2017, 03:13:05 am
That's not so good.  ;)
Title: Re: Less space between attachments
Post by: emanuele on July 17, 2017, 02:40:57 pm
@Ruth are you restricted to use only your mobile phone to work on the site?
Otherwise, installing a client like https://filezilla-project.org/ is usually way easier than use a browser to connect to ftp, but anyone has its own preferences. ;)

Quote from: Ruth – Edit: It shows me the Date from today now, when I uploaded that file again. (two hours earlier than it really was) Must be the time from the upload, because I downloaded nothing today.
Ask your host, it's easier. ;)
Title: Re: Less space between attachments
Post by: Frenzie on July 17, 2017, 03:01:44 pm
Quote from: Ruth – Edit: It shows me the Date from today now, when I uploaded that file again. (two hours earlier than it really was) Must be the time from the upload, because I downloaded nothing today.
If the minutes match it's a timezone difference.
Title: Re: Less space between attachments
Post by: Ruth on July 18, 2017, 09:12:19 am
Thank you all very much for your help!

I contacted my hoster - and I think, there was changed something about the permissions today, because any changings in my files are working since today when I upload my files again.

I was a bit confused before, ::)  therefore I mixed things up:

All files I had changed during the last days had been overwritten by uploading them via FTP, because I can see my changings if I download those files again. But the changings did not work and they also were not shown to me in the "Console".

Emanuele, I do not have a mobile phone, I am working with an old pc ;)  - and I think something like filezilla would be a good opinion for me.

Your code for the centered attachments is working splendit, everything is looking nice and proper again.

I changed it that way, so a few of smaller attachments can stand side by side in one row:

Code: [Select]
.postarea .attachments .attachment {
    display: inline-block;
}

.postarea .attachments .attachment_name {
    display: block;
    line-height: 1.3em;
}

Thank you for your help!
Title: Re: Less space between attachments
Post by: radu81 on July 18, 2017, 10:53:23 am
if your css is saved and you are not seeing the modifications into "console" try CTRL + F5 or set your browser in incognito mode