From 71fa54e376228291beab65e8571181fb00a54f6f Mon Sep 17 00:00:00 2001 From: Michael Gallaspy Date: Tue, 16 Feb 2016 10:28:34 -0800 Subject: [PATCH 1/7] Create top-level nav item for docs --- .../user/hbtemplates/navigation.handlebars | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/kalite/distributed/static/js/distributed/user/hbtemplates/navigation.handlebars b/kalite/distributed/static/js/distributed/user/hbtemplates/navigation.handlebars index 0a286ce737..870b65c1ca 100644 --- a/kalite/distributed/static/js/distributed/user/hbtemplates/navigation.handlebars +++ b/kalite/distributed/static/js/distributed/user/hbtemplates/navigation.handlebars @@ -10,6 +10,14 @@
  • {{_ "Sign Up" }}
  • {{/unless}} +{{#if docs_exist}} + +{{/if}} + {{#if is_admin}} @@ -41,13 +49,6 @@ {{_ "Logout" }} - {{#if docs_exist}} - - {{/if}} {{/if}} \ No newline at end of file From 581bb7db5200ed6ddaa349fb3b77426ae5df538e Mon Sep 17 00:00:00 2001 From: Michael Gallaspy Date: Wed, 17 Feb 2016 12:32:06 -0800 Subject: [PATCH 2/7] Add regression test for docs links --- .../features/steps/ui_regression.py | 20 ++++++++++++++++--- .../features/ui_regression.feature | 17 +++++++++++++++- .../user/hbtemplates/navigation.handlebars | 2 +- kalite/testing/behave_helpers.py | 9 +++++++++ 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/kalite/distributed/features/steps/ui_regression.py b/kalite/distributed/features/steps/ui_regression.py index 1cc97dd5ac..68bf47e668 100644 --- a/kalite/distributed/features/steps/ui_regression.py +++ b/kalite/distributed/features/steps/ui_regression.py @@ -1,11 +1,13 @@ -from behave import * +from behave import given, then, when from django.core.urlresolvers import reverse -from kalite.testing.behave_helpers import * +from kalite.testing.behave_helpers import find_id_with_wait, assert_no_element_by_id, \ + elem_is_visible_with_wait, build_url, login_as_coach DROPDOWN_MENU_ID = "username" NAVBAR_TOGGLE_ID = "navbar_toggle" LOGOUT_LINK_ID = "nav_logout" +DOCS_LINK_ID = "nav_documentation" @given("I'm logged in as a coach") @@ -13,7 +15,7 @@ def step_impl(context): login_as_coach(context) -@given("I can see the username dropdown menu") +@given(u"I can see the username dropdown menu") def step_impl(context): go_to_homepage(context) context.dropdown_menu = dropdown_menu = find_id_with_wait(context, DROPDOWN_MENU_ID) @@ -36,5 +38,17 @@ def step_impl(context): assert elem_is_visible_with_wait(context, logout_link), "Logout link is not visible!" +@then(u"I see the documentation link") +def step_impl(context): + docs_link = find_id_with_wait(context, DOCS_LINK_ID) + assert elem_is_visible_with_wait(context, docs_link), "Documentation link is not visible!" + + +@then(u"I do not see the documentation link") +def step_impl(context): + find_id_with_wait(context, 'user-name') # Ensure the menu has loaded at all + assert_no_element_by_id(context, '#' + DOCS_LINK_ID) + + def go_to_homepage(context): context.browser.get(build_url(context, reverse("homepage"))) \ No newline at end of file diff --git a/kalite/distributed/features/ui_regression.feature b/kalite/distributed/features/ui_regression.feature index f29b8c376e..66e0eb9425 100644 --- a/kalite/distributed/features/ui_regression.feature +++ b/kalite/distributed/features/ui_regression.feature @@ -11,4 +11,19 @@ Feature: UI regression tests Given superuser is deleted Given I'm on update_videos page Then I'm redirected to the homepage - Then I see only superusercreate modal \ No newline at end of file + Then I see only superusercreate modal + + @as_coach + Scenario: Documentation link shown to coaches + Given I am on the homepage + Then I see the documentation link + + @as_admin + Scenario: Documentation link shown to admins + Given I am on the homepage + Then I see the documentation link + + @as_learner + Scenario: Documentation link not shown to learners + Given I am on the homepage + Then I do not see the documentation link diff --git a/kalite/distributed/static/js/distributed/user/hbtemplates/navigation.handlebars b/kalite/distributed/static/js/distributed/user/hbtemplates/navigation.handlebars index 870b65c1ca..e781b3717c 100644 --- a/kalite/distributed/static/js/distributed/user/hbtemplates/navigation.handlebars +++ b/kalite/distributed/static/js/distributed/user/hbtemplates/navigation.handlebars @@ -11,7 +11,7 @@ {{/unless}} {{#if docs_exist}} - + {{#if is_admin}} + + {{/if}} {{/if}} From 61928c1d81eef8abf85a6dbafb957fb0d110d02b Mon Sep 17 00:00:00 2001 From: Michael Gallaspy Date: Thu, 18 Feb 2016 10:14:50 -0800 Subject: [PATCH 4/7] Make docs on circle At least one test in kalite.distributed.features.ui_regression depends on documentation being built. --- Makefile | 2 +- circle.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 558d0b260d..af375b6a1a 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ lint: test: bin/kalite manage test --bdd-only -test-bdd: +test-bdd: docs bin/kalite manage test --bdd-only test-nobdd: diff --git a/circle.yml b/circle.yml index 19c09bbbb3..6588cb8970 100644 --- a/circle.yml +++ b/circle.yml @@ -8,7 +8,7 @@ dependencies: - "data" - "sc-latest-linux" override: - - pip install -r requirements_test.txt + - pip install -r requirements_sphinx.txt - pip install -e . # This cannot be done because pip on Circle doesn't understand our sdist # - make sdist From 6b5e366298fb3c1c71cc0acc83d05091a8aeba91 Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Wed, 14 Oct 2015 01:39:51 +0200 Subject: [PATCH 5/7] add missing entry for generated manpages --- MANIFEST.in.dist | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MANIFEST.in.dist b/MANIFEST.in.dist index 74dc65b5ec..dfdc1e4e8a 100644 --- a/MANIFEST.in.dist +++ b/MANIFEST.in.dist @@ -33,3 +33,5 @@ recursive-exclude python-packages *pyc # Docs recursive-include docs/_build/html * +include docs/kalite.1.gz + From a8019f7a77671166329900239727dc30123d96ab Mon Sep 17 00:00:00 2001 From: Benjamin Bach Date: Tue, 8 Dec 2015 13:30:13 +0100 Subject: [PATCH 6/7] add binary manpage file to repo because it doesnt generate on windows --- .gitignore | 1 - docs/kalite.1.gz | Bin 0 -> 1132 bytes 2 files changed, 1 deletion(-) create mode 100644 docs/kalite.1.gz diff --git a/.gitignore b/.gitignore index ebca76d62f..2521489883 100644 --- a/.gitignore +++ b/.gitignore @@ -60,7 +60,6 @@ secretkey.txt # Documentation docs/_build docs/images/* -docs/kalite.1.gz # oh-my-zsh convention for automatically # switching on a venv diff --git a/docs/kalite.1.gz b/docs/kalite.1.gz new file mode 100644 index 0000000000000000000000000000000000000000..935053e677b0151fa59f7c65b83e28ec78f65b82 GIT binary patch literal 1132 zcmV-y1e5z8iwFpr9bZ-g|7&4vX>?^SF#x4k+m72d5PjEIO!MMRuu_`$UoCHL zriT&Phr>Mhpnbyb*yb#Q~7h&%wqtR!` zi-Mr+V2x1oM=Gst50y5^Q3gvX8W2jBX`u0G9CuY*Owx3)o;;5mw_XP{zx2>bG6}I4LFaWk!@pCeUODvIrzUJ zV3Bq2SST9YZ~NA2|LnX9kE4>}xo~GR<5mks#OQF{of`-9Jv#3lda$={mji9V2Resy znoy>_Rm4Ku?}nCl8_mYOUP(dfRv%6O~s?sQLodz<2=Rr;AOu~6bL2lEeBW> zDnf#abn2uIw^zZirV@z9n2poMUxu!DbU^enrqNBna=R2t&nxN&sTsZOT9Z?>7N7CF y|9|;I^?!v>L0_~{#Jw2FAW=heg2h`x2 Date: Mon, 22 Feb 2016 00:22:06 +0100 Subject: [PATCH 7/7] create manfile when doing release [ci skip] --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 558d0b260d..6f15c48b49 100644 --- a/Makefile +++ b/Makefile @@ -92,7 +92,7 @@ assets: bin/kalite manage syncdb --noinput bin/kalite manage migrate -release: clean docs assets +release: clean docs assets man python setup.py sdist --formats=gztar,zip upload --sign python setup.py sdist --formats=gztar,zip upload --sign --static ls -l dist