Inventory & Requests

I would like to note that many of the texts in these forms a quite long and maybe not perfect for the format. @alberto said as much. Pinged you together in another thread to clear this up.

Good night for today.

ping @owen just today this issue of pictures in forms came up again and nadia seems to have found a fix. can you have a look here?

@MariaEuler it looks like they display - but the sizing is not great, as there is no particular formatting of the images. I’ll include an improvement in the next update.

I still do not get it to work. Would like to see the text source nadia formated but can not find it. but let’s figure this out tomorrow.

this is the text source: Co-working spaces: can they help employees and freelancers in the covid19 world?

1 Like

Come meet everyone on October 16: Info session about our new Worldbuilding academy! to Edgeryders Forms …ok figured it out as well. the display sizing issue fixed would be nice, but yes, we can do it if necessary. :slight_smile:

the difference is here:

(1) from Nadia’s post:

![|480x360](https://i.ytimg.com/vi/oGCEGycWgfo/hqdefault.jpg)

(2) when I upload an image:

![hqdefault|480x360](upload://6zYuxB5stQ53ZzgZlE5XGMioww3.jpeg)

Notice in the second one the url is not a hosted image url (or at least the server it is hosted on is not shown in the string).

Now if I right click that image in the post and copy the image url, then include that in the post it will work.

This is an issue with uploading images in posts on Discourse. @matthias maybe you have an idea of why this happens & if it can be fixed.

1 Like

Cool

@owen could you check out why the image displays so weird int he form here?

Hey @MariaEuler

Yes it’s what we discussed yesterday with image sizing, I will have a fix up this weekend.

1 Like

Fixed now.

1 Like

It’s not something we can fix since it is intentionally that way by Discourse. But you can do the same transformation that Discourse does to calculate the final URL for img tags from the upload:// URL. I’ll show how it works with one example:

Let’s say we have the following upload URL and a corresponding so-called “cooked” URL:

upload://w6Q793RK3Xl2Tjw1IoVXzmv3X00.jpeg
https://edgeryders.eu/uploads/default/original/2X/e/e10b857825d31d2c8479e246704de45ff241da44.jpeg

The cooked URL contains the hostname, directory uploads/default/original/2X, then a directory with one letter conforming to the first letter of the image filename, and then the image file basename, and the original file extension. The non-obvious part is to create the image filename. This is done by interpreting the basename of the upload URL w6Q793RK3Xl2Tjw1IoVXzmv3X00 as a Base62 number with character set 0-9 , a-z , A-Z and convert it to a Base16 number.

Discourse uses the base62-rb gem library for this purpose, and I just tried that conversion successfully as follows in IRB (an interactive Ruby shell):

$ gem install base62-rb
$ irb
irb(main):001:0> require 'base62-rb'
=> true
irb(main):004:0> Base62.decode("w6Q793RK3Xl2Tjw1IoVXzmv3X00").to_s(16)
=> "e10b857825d31d2c8479e246704de45ff241da44"

So your task would be to do the same in JavaScript. For reference, the place where Discourse itself does this is models/upload.rb line 277:

1 Like

Thanks for the explanation!

ping @owen could you please check the pictures in these two form sets? For some reasons they do not work event so I used and URL. What do I do wrong?

+ and much more important on the top of the tell.form it shows the date the teext souce post was made, which is in conflict with the date of the actual event. can you remove this? (Maybe in general)

ping @owen could you please check the pictures in these two form sets? For some reasons they do not work event so I used and URL. What do I do wrong?

@Maria it looks like they display fine?

  • and much more important on the top of the tell.form it shows the date the teext souce post was made, which is in conflict with the date of the actual event. can you remove this? (Maybe in general)

Yep, that’s done now.

1 Like

Hi,

I have seen this post has already its form but it contains a broken link and I do not know how to correct it. The link under “alien economy on Earth” should point to this page and not to the empty one where it points now.
Thanks

ping @owen @MariaEuler

Works for me ???

Weird. If I click it on the form (not on the original page) it takes me here which appears to be an empty page.

Not weird at all. On the form, the link points to https://tell.edgeryders.eu/t/13876 (which is obviously empty), instead of https://edgeryders.eu/t/13876. If you have edit privileges, change it. If not, ask @owen. It might even be a bug, if the Webkit adds a default first part of the URL.

Yes, that is why I posted. I do not know how to correct that because I am not yet that familiar with the Discourse to go mess with it.