Inventory & Requests

Request for form for this post: What we can learn from Messina’s economic model?

1 Like

@MariaEuler some of the forms have broken images, can we just remove them? Edgeryders Forms

I fyou are ok with them beeing removed from the text that is the source of the text sure. If not I would need to set up new posts as text sources. which should it be?

Note: For the Messina event multiple similar posts in different categories where requested for forms. therefore there is a doubling of forms happening there but you can follow which is connected to what via the inventory.

Hopefully we can avoid this in future by using this inventory.

here the requested form @nadia:

  1. Edgeryders Forms
  2. What we can learn from Messina’s economic model? - Comment Invitation
    3.What we can learn from Messina’s economic model?

I figured it out :slight_smile: - if you upload an image into the post directly it will break - if you just add the url for an image then it will work. Look here Edgeryders Forms with source being Co-working spaces: can they help employees and freelancers in the covid19 world? - Comment Invitation

1 Like

can you link the sourcec for the text? This is the sourc for the form. I would like to see how you did it in the text post

or show me in this one how to add the picture:

I really tried.

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