Page MenuHomePhabricator

A license selection drop down before uploading pictures
Closed, ResolvedPublic

Description

Task

  1. Our uploader lacks a select dropdown like what people have at
    Screenshot 2019-12-24 at 18.26.45.png (41×794 px, 9 KB)
    (from https://test.wikipedia.org/wiki/Special:Upload). For starters, lets just copy that element from Special:Upload and export it to our HTML file ?

Screenshot 2019-12-24 at 18.28.46.png (289×810 px, 39 KB)

  1. You can either copy the element completely using your browser view-source of the page https://test.wikipedia.org/wiki/Special:Upload or can copy paste it from the listing at https://test.wikipedia.org/wiki/MediaWiki:Licenses

Setup Guide for GCI students
This is a Google Code In task.

You have to setup the python-django tool Gdrive to Commons locally to start with contributing. We host our code on Github, so the change should come in as a pull request to https://github.com/tonythomas01/gdrive_to_commons. Steps to contribute are similar to Pull request workflow. Or, you can rely on the following:

  1. Create a local fork of https://github.com/tonythomas01/gdrive_to_commons using your account.
  2. Create a branch with the phabricator task name from origin/master. For eg, git checkout -b T55445 origin/master. Make sure to update your local branch by git pull --rebase or whatever necessary before creating a branch.
  3. Fix the issue you are solving.
  4. Commit it (git commit -m "What you fixed goes here")
  5. Push it to your Github fork of the repo (git push -u origin HEAD)
  6. Later, create a pull request to https://github.com/tonythomas01/gdrive_to_commons from Github with your changes.
  7. Would be pretty cool if you also paste your pull request link on your phabricator task so people know that things are moving.

Event Timeline

Hi, I created a pull request on task T241425. It can be accessed here

Since we are selecting multiple images, each image can have a different license. Should be proceed image-wise or some with other approach?

Since we are selecting multiple images, each image can have a different license. Should be proceed image-wise or some with other approach?

I think we should follow the behaviour of the current media uploader. Can you check the behaviour right now, say on https://commons.wikimedia.org/wiki/Special:UploadWizard ?

Media uploader is gives an option for a common license seletor as well as an individual license selection option.

Media uploader is gives an option for a common license seletor as well as an individual license selection option.

Okey, in this case we need an extended solution here then. I would suggest we copy the behaviour we have on Special:UploadWizard. Even though I merged the single dropdown per upload solution earlier, in the end, we would want something like this.

I would even suggest the following:

  1. Lets make the box big enough, so we do not cram things down.
  2. You can use the elements for the <select> from the templates/licenses.html

And sure-, you will have some merge issues in https://github.com/tonythomas01/gdrive-to-commons/pull/43, sorry for that.

okey, so a problem I see here is that we might need to work around a bit with the description to make sure the license header goes through. For example, look at https://commons.wikimedia.org/w/index.php?title=File:Wikimedia_Hackathon_Prague_2019_-_Group_Photo_-_CLK.png&action=edit

You can see how the license header went into the description. Editing the comment alone, did not actually do the trick.

But good progress. You can tell me if you want to merge https://github.com/tonythomas01/gdrive-to-commons/pull/43 as it state now and work on linking the license header in the description later ?

It's okay. I'll finish up the whole feature and then let's merge. Should push in a day or two

I am extremely sorry as I missed out the template structuring. I have now refactored the code.

def get_initial_page_text(license="", summary="", category=""):

    return """=={{{{int:filedesc}}}}==
{{{{Information|
{{{{en|{0}}}}}
}}}}

=={{{{int:license-header}}}}==
{{{{{1}}}}}

[[Category:{2}]] 
""".format(
        summary, license, category
    )

I believe this follows the required structure and should work!

I would close this as resolved for now. Thank you!