Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra pages #59

Merged
merged 6 commits into from
Feb 26, 2018
Merged

Extra pages #59

merged 6 commits into from
Feb 26, 2018

Conversation

noirbizarre
Copy link
Contributor

This PR adds the following pages:

  • usage
  • strategy
  • publishing
  • FAQ (and subsections)

It also adds the data.public.lu terms as a themed terms.html template.

Also added: related tests

@noirbizarre noirbizarre added this to the 1.0.0 milestone Feb 21, 2018
@noirbizarre noirbizarre self-assigned this Feb 21, 2018
@noirbizarre noirbizarre added this to To Do in Road to udata 1.X via automation Feb 21, 2018
@noirbizarre noirbizarre moved this from To Do to In progress in Road to udata 1.X Feb 21, 2018
@petzlux
Copy link
Contributor

petzlux commented Feb 21, 2018

I get the following error:

udata_1          | Installing collected packages: gouvlu
udata_1          |   Running setup.py develop for gouvlu
udata_1          | Successfully installed gouvlu
mongodb_1        | 2018-02-21T16:14:01.979+0000 I NETWORK  [initandlisten] connection accepted from 172.24.0.5:41158 #1 (1 connection now open)
udata_1          | Traceback (most recent call last):
udata_1          |   File "/usr/local/bin/udata", line 11, in <module>
udata_1          |     sys.exit(console_script())
udata_1          |   File "/usr/local/lib/python2.7/dist-packages/udata/commands/__init__.py", line 93, in console_script
udata_1          |     run_manager()
udata_1          |   File "/usr/local/lib/python2.7/dist-packages/udata/commands/__init__.py", line 82, in run_manager
udata_1          |     app = standalone(app)
udata_1          |   File "/usr/local/lib/python2.7/dist-packages/udata/app.py", line 181, in standalone
udata_1          |     plugin = import_module(name)
udata_1          |   File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
udata_1          |     __import__(name)
udata_1          | ImportError: No module named udata_gouvlu
mongodb_1        | 2018-02-21T16:14:03.590+0000 I NETWORK  [conn1] end connection 172.24.0.5:41158 (0 connections now open)
gouvlu_udata_1 exited with code 1

@noirbizarre noirbizarre force-pushed the extra-pages branch 2 times, most recently from 757888d to c971e25 Compare February 21, 2018 16:12
@noirbizarre
Copy link
Contributor Author

This requires udata 1.3.0.dev to run because of the udata.views entrypoint.

The 1.3 versions is breaking some cards design too but a PR is coming with fixes.

@noirbizarre
Copy link
Contributor Author

Yes, you can with the development version of udata.
Udata developement version are published here: https://pypi.python.org/pypi/udata
Successful build use latest one

@petzlux
Copy link
Contributor

petzlux commented Feb 23, 2018

I have problems with the design of the cards, which seems slightly broken ?

Left old from demoprod, right this PR

screen shot 2018-02-23 at 09 37 29

Copy link
Contributor

@petzlux petzlux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the card design is broken, because these changes werent taken into account:

opendatateam/udata#1383

Copy link
Contributor

@petzlux petzlux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cant be merged at the moment, need to address these two issues

gouvlu/views.py Outdated

@blueprint.route('/strategy/')
def strategy():
return theme.render('usage.html')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should load the strategy.html

@@ -1,2 +1,2 @@
udata>=1.2.6
udata>=1.3.0.dev6747
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Managed to fix the card design by specifying the build just before the card redesign PR was merged udata==1.3.0.dev6411

@noirbizarre
Copy link
Contributor Author

The 1.3 versions is breaking some cards design too but a PR is coming with fixes.

I know, we are currently working on it. opendatateam/udata#1383 was the first pass, and opendatateam/udata#1460 is making some changes too. I already have fixed it, but I'm waiting for opendatateam/udata#1460 to be merged to submit the fix so it can be tested.

This current PR is only about the extra pages, there is no changes on cards which will break with or without.

@petzlux
Copy link
Contributor

petzlux commented Feb 23, 2018

Okay, but can we fix to udata==1.3.0.dev6411 to be able to merge ?

@noirbizarre
Copy link
Contributor Author

noirbizarre commented Feb 23, 2018

No I can't, this is really this required version to make this PR works. Tests won't pass with an earlier version and not everything is functionnal.
See #61 for the cards fixes (I try to keeps PR coherents). Once merged, I can rebase this branch if you want. (This PR doesn't touch or use cards, so reviewing the extra pages won't changes with #61 )

@petzlux
Copy link
Contributor

petzlux commented Feb 26, 2018

Okay I understand. Lets get #61 merged then before.

@petzlux
Copy link
Contributor

petzlux commented Feb 26, 2018

The FAQ System Integrator doesnt seem to work:

Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/contrib/fixers.py", line 152, in __call__
    return self.app(environ, start_response)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask_restplus/api.py", line 557, in error_router
    return original_handler(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask_restplus/api.py", line 557, in error_router
    return original_handler(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/src/gouvlu/gouvlu/views.py", line 23, in faq
    url_pattern=FAQ_URL_PATTERN)
  File "/usr/local/lib/python2.7/dist-packages/udata/theme/__init__.py", line 132, in render
    return render_theme_template(get_theme(theme), template, **context)
  File "/usr/local/lib/python2.7/dist-packages/flask_themes2/__init__.py", line 141, in render_theme_template
    return render_template(template_name, **context)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 134, in render_template
    context, ctx.app)
  File "/usr/local/lib/python2.7/dist-packages/flask/templating.py", line 116, in _render
    rv = template.render(context)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 1008, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/dist-packages/jinja2/environment.py", line 780, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/src/gouvlu/gouvlu/templates/faq/system-integrator.html", line 3, in top-level template code
    {% set meta = {
  File "/src/gouvlu/gouvlu/templates/faq/base.html", line 1, in top-level template code
    {% extends theme('layouts/1-column.html') %}
  File "/usr/local/lib/python2.7/dist-packages/udata/templates/layouts/1-column.html", line 4, in top-level template code
    {% set toolbar_class = toolbar_class|default('') %}
  File "/src/gouvlu/gouvlu/theme/templates/base.html", line 1, in top-level template code
    {% extends "base.html" %}
  File "/usr/local/lib/python2.7/dist-packages/udata/templates/base.html", line 1, in top-level template code
    {% extends theme('raw.html') %}
  File "/src/gouvlu/gouvlu/theme/templates/raw.html", line 2, in top-level template code
    {% extends "raw.html" %}
  File "/usr/local/lib/python2.7/dist-packages/udata/templates/raw.html", line 29, in top-level template code
    {% block body %}{% endblock %}
  File "/src/gouvlu/gouvlu/theme/templates/base.html", line 9, in block "body"
    {{ super() }}
  File "/usr/local/lib/python2.7/dist-packages/udata/templates/base.html", line 19, in block "body"
    {% block content %}{% endblock %}
  File "/usr/local/lib/python2.7/dist-packages/udata/templates/layouts/1-column.html", line 14, in block "content"
    {% block main_content %}{% endblock %}
  File "/src/gouvlu/gouvlu/templates/faq/base.html", line 9, in block "main_content"
    {% block faq_content %}{% endblock %}
  File "/src/gouvlu/gouvlu/templates/faq/system-integrator.html", line 43, in block "faq_content"
    <img src="{{ url_for('gouvfr.static', filename='faq/integration/exemple-integration-blog-etalab.png') }}" alt="Exemple d’intégration sur le blog d’Etalab">
  File "/usr/local/lib/python2.7/dist-packages/flask/helpers.py", line 333, in url_for
    return appctx.app.handle_url_build_error(error, endpoint, values)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1805, in handle_url_build_error
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/dist-packages/flask/helpers.py", line 323, in url_for
    force_external=external)
  File "/usr/local/lib/python2.7/dist-packages/werkzeug/routing.py", line 1776, in build
    raise BuildError(endpoint, values, method, self)
BuildError: Could not build url for endpoint 'gouvfr.static' with values ['filename']. Did you mean u'gouvlu.static' instead?

@noirbizarre
Copy link
Contributor Author

Fixed
BTW, I think we face the same problem than before: udata-gouvlu repository is not up to date and so are the extracted pages

@petzlux petzlux merged commit b0a0aa1 into opendatalu:master Feb 26, 2018
Road to udata 1.X automation moved this from In progress to Done Feb 26, 2018
@noirbizarre noirbizarre deleted the extra-pages branch February 26, 2018 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

2 participants