aelve / haskell-issues

An unofficial issue tracker for all things Haskell-related
18 stars 0 forks source link

lpaste: Allow editing of annotations #20

Closed Gurkenglas closed 8 years ago

Gurkenglas commented 8 years ago

Currently, editing an annotation leaves the original annotation unchanged and behaves as if your annotation had always been its own paste, which is now edited.

neongreen commented 8 years ago

I made a pull request to fix this: https://github.com/chrisdone/lpaste/pull/36.

Gurkenglas commented 8 years ago

Left some refactorings on https://github.com/chrisdone/lpaste/pull/36/files#diff-e68eb2d137b310b5ebd78ae6caefbbcbL14 . Is this the right way to suggest these?

Gurkenglas commented 8 years ago

Hmm by the way clicking Private or Public when editing a paste doesn't change whether it's listed on the public list I think. There should be either just one button or they should do different things.

Gurkenglas commented 8 years ago

Oh and it looks like a whole bunch of other stuff also isn't updated, like what channel to have the lpaste-IRCbot post to.

neongreen commented 8 years ago

I just checked and it's updated (when editing both pastes and annotations). Or did you mean something else?

Gurkenglas commented 8 years ago

What channel the bot posts to is used for the current revision, but the next revision has the setting used in the original post set as default again.

neongreen commented 8 years ago

It doesn't for me. Here are the exact steps:

sudo -u postgres psql

\c hpaste
insert into channel values (1,'haskell')
insert into channel values (2,'java')
insert into channel values (3,'c++')
\q

Then I ran the server and made a new paste with channel = "haskell" (ID turned out to be 49). Then I edited it to have channel = "java" and saved the paste. Then I curled the edit page (just to make sure that it's not browser substituting the last used value or something):

$ curl -s http://localhost:10000/edit/49 | tidy -q | grep selected
<option value="java" selected="selected">java</option>

So, it does save the channel.

Gurkenglas commented 8 years ago

Here's my steps: https://www.dropbox.com/s/14z34e55iakmyn0/lpastechannel.gif?dl=0

neongreen commented 8 years ago

But but my patch hasn't been merged yet, let alone deployed on lpaste.net! I agree that the version on lpaste.net handles channels incorrectly, but this bug isn't present in the pull request.

Gurkenglas commented 8 years ago

Ah, I didn't think you changed that since https://github.com/chrisdone/lpaste/pull/36 didn't say you did.

Gurkenglas commented 8 years ago

Waaait, this thread wasn't even about that.

neongreen commented 8 years ago

Okay, I made another pull request, let's see how it goes.

neongreen commented 8 years ago

It has been deployed, and editing of annotations works now.