Page MenuHomePhabricator

indic-wscontest: Fix mobile view
Closed, ResolvedPublic

Description

In the mobile view, the tool is not showing the links of the navbar.

Repo:- https://gerrit.wikimedia.org/r/#/admin/projects/labs/tools/indic-wscontest
Tool:- https://tools.wmflabs.org/indic-wscontest/

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

I want to work on this issue but I am not familiar with Gerrit. Went through the repo linked in the description and cloned it. But I didn't find a way to run the tool on my local machine. Please help!

Hi @Soumyaa1804

  1. git clone "ssh://username@gerrit.wikimedia.org:29418/labs/tools/indic-wscontest"
  2. cd indic-wscontest
  3. pip install -r requirements.txt
  4. python3 app.py
  5. open http://127.0.0.1:5000/

You have to edit templates/base.html's nav. Use Developer Tools of browser to view the tool in the mobile view.

To push the code. See Gerrit Tutorial

On running python3 app.py I got this error:

(venv) soumya@soumya-HP-Laptop-15-da0xxx ~/repos/Wikimedia/indic-wscontest $ python3 app.py
Traceback (most recent call last):
  File "app.py", line 13, in <module>
    app.config.from_object(os.environ['APP_SETTINGS'])
  File "/home/soumya/repos/Wikimedia/venv/lib/python3.6/os.py", line 669, in __getitem__
    raise KeyError(key) from None
KeyError: 'APP_SETTINGS'

@Soumyaa1804 Oh, Export the env variable by export APP_SETTINGS=config.local

  1. pip install -r requirements.txt
  2. python3 app.py
  3. open http://127.0.0.1:5000/

Export the env variable by export APP_SETTINGS=config.local

Should that be in a README file in the repository itself?

I tried to get consumer key at https://meta.wikimedia.org/wiki/Special:OAuthConsumerRegistration/propose?wpownerOnly=1
but it says

You do not have permission to propose new OAuth consumers, for the following reason:

The action you have requested is limited to users in one of the groups: Autoconfirmed users, Confirmed users.

@Soumyaa1804 I don't think in this task, You need a consumer key. It is just about to fix the navbar (html). If you want the login in the tool. You can just return dummy string in def get_current_user().
Example:-

def get_current_user(cached=True):
    if cached:
        return "Dummy"
   ...
   ...
    return "Dummy"

Regarding permission error. You can see https://meta.wikimedia.org/wiki/Newly_registered_user. You have to have Autoconfirmed user rights for proposing the consumer key.

Have a look and let me know if any changes needed.

@Soumyaa1804 Looks good to me. Please Upload the patch.

Change 567348 had a related patch set uploaded (by Soumyaa1804; owner: Soumyaa1804):
[labs/tools/indic-wscontest@master] Fix::navbar in mobile view

https://gerrit.wikimedia.org/r/567348

Change 567348 merged by jenkins-bot:
[labs/tools/indic-wscontest@master] Fix::navbar in mobile view

https://gerrit.wikimedia.org/r/567348

Thanks @Soumyaa1804, You have set up the tool in local machine. if you want to continue the work on this tool. then you can start work on T243658.

Yeah, sure! I'll look into it. Thanks :)