From 11696d7fe1ec697e4be34b0e31b1f453ab4244af Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Tue, 16 Feb 2016 11:58:41 -0500 Subject: [PATCH 01/17] removed donate button from nav --- home/templates/tags/top_menu.html | 7 ------- 1 file changed, 7 deletions(-) diff --git a/home/templates/tags/top_menu.html b/home/templates/tags/top_menu.html index 0106256c9..7734875da 100644 --- a/home/templates/tags/top_menu.html +++ b/home/templates/tags/top_menu.html @@ -44,9 +44,6 @@

New America

  • {% include 'ui_elements/svg/award.html' %}
  • -
  • - {% include 'ui_elements/svg/heart.html' %} -
  • {% include 'ui_elements/svg/magnifying-glass.html' %}
  • @@ -163,10 +160,6 @@

    By Location

    -
  • - Donate -
  • - From da96af640862f1cf98e65521c039b28259aeb0bf Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Tue, 16 Feb 2016 14:30:59 -0500 Subject: [PATCH 02/17] added simple sidebar --- fixture.json | 6 +-- home/templates/tags/side_menu.html | 18 ++++++++ home/templatetags/side_menu.py | 51 ++++++++++++++++++++++ home/templatetags/top_menu.py | 2 + mysite/assets/scss/vendor/_foundation.scss | 2 +- mysite/templates/base.html | 19 +++++++- programs/templates/programs/program.html | 2 - 7 files changed, 91 insertions(+), 9 deletions(-) create mode 100644 home/templates/tags/side_menu.html create mode 100644 home/templatetags/side_menu.py diff --git a/fixture.json b/fixture.json index ceacf1829..ef66f3e48 100644 --- a/fixture.json +++ b/fixture.json @@ -1146,7 +1146,7 @@ "user": [ "admin" ], - "content_json": "{\"photo\": \"[]\", \"search_description\": \"\", \"owner\": 1, \"position_at_new_america\": \"President and CEO\", \"long_bio\": \"Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York. She is also the Bert G. Kerstetter '66 University Professor Emerita of Politics and International Affairs at Princeton University. From 2009\\u20132011 she served as director of Policy Planning for the United States Department of State, the first woman to hold that position. Upon leaving the State Department she received the Secretary\\u2019s Distinguished Service Award for her work leading the Quadrennial Diplomacy and Development Review, as well as meritorious service awards from USAID and the Supreme Allied Commander for Europe. Prior to her government service, Dr. Slaughter was the Dean of Princeton\\u2019s Woodrow Wilson School of Public and International Affairs from 2002\\u20132009 and the J. Sinclair Armstrong Professor of International, Foreign, and Comparative Law at Harvard Law School from 1994-2002.\\r\\n\\r\\nDr. Slaughter has written or edited seven books, including Unfinished Business: Women, Men, Work, Family (2015), A New World Order (2004), and The Idea That Is America: Keeping Faith with Our Values in a Dangerous World (2007), and over 100 scholarly articles. She was the convener and academic co-chair, with Professor John Ikenberry, of the Princeton Project on National Security, a multi-year research project aimed at developing a new, bipartisan national security strategy for the United States. In 2012 she published the article \\u201cWhy Women Still Can\\u2019t Have It All,\\u201d in The Atlantic, which quickly became the most read article in the history of the magazine and helped spawn a renewed national debate on the continued obstacles to genuine full male-female equality.\\r\\n\\r\\nDr. Slaughter writes a monthly column for Project Syndicate. She provides frequent commentary for both mainstream and new media and curates foreign policy news for over 80,000 followers on Twitter. Foreign Policy magazine named her to their annual list of the Top 100 Global Thinkers in 2009, 2010, 2011, and 2012. She received a B.A. from Princeton, an M.Phil and D.Phil in international relations from Oxford, where she was a Daniel M. Sachs Scholar, and a J.D. from Harvard. She is married to Professor Andrew Moravcsik; they live in Princeton with their two sons.\", \"latest_revision_created_at\": null, \"go_live_at\": null, \"social_media\": \"[]\", \"expert\": true, \"title\": \"Anne-Marie Slaughter\", \"seo_title\": \"\", \"slug\": \"anne-marie-slaughter\", \"live\": true, \"belongs_to_program\": null, \"role\": \"Board Member\", \"location\": \"\", \"has_unpublished_changes\": false, \"email\": \"anne@newamerica.org\", \"numchild\": 0, \"content_type\": 14, \"show_in_menus\": false, \"path\": \"0001000100050001\", \"url_path\": \"/new-america/our-people/anne-marie-slaughter/\", \"expired\": false, \"pk\": 38, \"locked\": false, \"name\": \"Anne-Marie Slaughter\", \"depth\": 4, \"short_bio\": \"Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York.\", \"first_published_at\": null, \"expire_at\": null}", + "content_json": "{\"photo\": \"[]\", \"search_description\": \"\", \"owner\": 1, \"position_at_new_america\": \"President and CEO\", \"long_bio\": \"Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York. She is also the Bert G. Kerstetter '66 University Professor Emerita of Politics and International Affairs at Princeton University. From 2009\\u20132011 she served as director of Policy Planning for the United States Department of State, the first woman to hold that position. Upon leaving the State Department she received the Secretary\\u2019s Distinguished Service Award for her work leading the Quadrennial Diplomacy and Development Review, as well as meritorious service awards from USAID and the Supreme Allied Commander for Europe. Prior to her government service, Dr. Slaughter was the Dean of Princeton\\u2019s Woodrow Wilson School of Public and International Affairs from 2002\\u20132009 and the J. Sinclair Armstrong Professor of International, Foreign, and Comparative Law at Harvard Law School from 1994-2002.\\r\\n\\r\\nDr. Slaughter has written or edited seven books, including Unfinished Business: Women, Men, Work, Family (2015), A New World Order (2004), and The Idea That Is America: Keeping Faith with Our Values in a Dangerous World (2007), and over 100 scholarly articles. She was the convener and academic co-chair, with Professor John Ikenberry, of the Princeton Project on National Security, a multi-year research project aimed at developing a new, bipartisan national security strategy for the United States. In 2012 she published the article \\u201cWhy Women Still Can\\u2019t Have It All,\\u201d in The Atlantic, which quickly became the most read article in the history of the magazine and helped spawn a renewed national debate on the continued obstacles to genuine full male-female equality.\\r\\n\\r\\nDr. Slaughter writes a monthly column for Project Syndicate. She provides frequent commentary for both mainstream and new media and curates foreign policy news for over 80,000 followers on Twitter. Foreign Policy magazine named her to their annual list of the Top 100 Global Thinkers in 2009, 2010, 2011, and 2012. She received a B.A. from Princeton, an M.Phil and D.Phil in international relations from Oxford, where she was a Daniel M. Sachs Scholar, and a J.D. from Harvard. She is married to Professor Andrew Moravcsik; they live in Princeton with their two sons.\", \"latest_revision_created_at\": null, \"go_live_at\": null, \"social_media\": \"[]\", \"expert\": true, \"title\": \"Anne-Marie Slaughter\", \"seo_title\": \"\", \"slug\": \"anne-marie-slaughter\", \"live\": true, \"role\": \"Board Member\", \"location\": \"\", \"has_unpublished_changes\": false, \"email\": \"anne@newamerica.org\", \"numchild\": 0, \"content_type\": 14, \"show_in_menus\": false, \"path\": \"0001000100050001\", \"url_path\": \"/new-america/our-people/anne-marie-slaughter/\", \"expired\": false, \"pk\": 38, \"locked\": false, \"name\": \"Anne-Marie Slaughter\", \"depth\": 4, \"short_bio\": \"Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York.\", \"first_published_at\": null, \"expire_at\": null}", "approved_go_live_at": null } }, @@ -9266,7 +9266,7 @@ "user": [ "admin" ], - "content_json": "{\"photo\": \"[]\", \"search_description\": \"\", \"owner\": 1, \"position_at_new_america\": \"President and CEO\", \"long_bio\": \"Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York. She is also the Bert G. Kerstetter '66 University Professor Emerita of Politics and International Affairs at Princeton University. From 2009\\u20132011 she served as director of Policy Planning for the United States Department of State, the first woman to hold that position. Upon leaving the State Department she received the Secretary\\u2019s Distinguished Service Award for her work leading the Quadrennial Diplomacy and Development Review, as well as meritorious service awards from USAID and the Supreme Allied Commander for Europe. Prior to her government service, Dr. Slaughter was the Dean of Princeton\\u2019s Woodrow Wilson School of Public and International Affairs from 2002\\u20132009 and the J. Sinclair Armstrong Professor of International, Foreign, and Comparative Law at Harvard Law School from 1994-2002.\\r\\n\\r\\nDr. Slaughter has written or edited seven books, including Unfinished Business: Women, Men, Work, Family (2015), A New World Order (2004), and The Idea That Is America: Keeping Faith with Our Values in a Dangerous World (2007), and over 100 scholarly articles. She was the convener and academic co-chair, with Professor John Ikenberry, of the Princeton Project on National Security, a multi-year research project aimed at developing a new, bipartisan national security strategy for the United States. In 2012 she published the article \\u201cWhy Women Still Can\\u2019t Have It All,\\u201d in The Atlantic, which quickly became the most read article in the history of the magazine and helped spawn a renewed national debate on the continued obstacles to genuine full male-female equality.\\r\\n\\r\\nDr. Slaughter writes a monthly column for Project Syndicate. She provides frequent commentary for both mainstream and new media and curates foreign policy news for over 80,000 followers on Twitter. Foreign Policy magazine named her to their annual list of the Top 100 Global Thinkers in 2009, 2010, 2011, and 2012. She received a B.A. from Princeton, an M.Phil and D.Phil in international relations from Oxford, where she was a Daniel M. Sachs Scholar, and a J.D. from Harvard. She is married to Professor Andrew Moravcsik; they live in Princeton with their two sons.\", \"latest_revision_created_at\": \"2016-01-12T19:09:16.775Z\", \"go_live_at\": null, \"social_media\": \"[]\", \"expert\": true, \"title\": \"Anne-Marie Slaughter\", \"seo_title\": \"\", \"slug\": \"anne-marie-slaughter\", \"live\": true, \"belongs_to_program\": null, \"role\": \"Board Member\", \"location\": \"\", \"has_unpublished_changes\": false, \"email\": \"anne@anne.com\", \"numchild\": 0, \"content_type\": 14, \"show_in_menus\": false, \"path\": \"0001000100050001\", \"url_path\": \"/new-america/our-people/anne-marie-slaughter/\", \"expired\": false, \"pk\": 38, \"locked\": false, \"name\": \"Anne-Marie Slaughter\", \"depth\": 4, \"short_bio\": \"Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York.\", \"first_published_at\": \"2016-01-12T19:09:16.786Z\", \"expire_at\": null}", + "content_json": "{\"photo\": \"[]\", \"search_description\": \"\", \"owner\": 1, \"position_at_new_america\": \"President and CEO\", \"long_bio\": \"Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York. She is also the Bert G. Kerstetter '66 University Professor Emerita of Politics and International Affairs at Princeton University. From 2009\\u20132011 she served as director of Policy Planning for the United States Department of State, the first woman to hold that position. Upon leaving the State Department she received the Secretary\\u2019s Distinguished Service Award for her work leading the Quadrennial Diplomacy and Development Review, as well as meritorious service awards from USAID and the Supreme Allied Commander for Europe. Prior to her government service, Dr. Slaughter was the Dean of Princeton\\u2019s Woodrow Wilson School of Public and International Affairs from 2002\\u20132009 and the J. Sinclair Armstrong Professor of International, Foreign, and Comparative Law at Harvard Law School from 1994-2002.\\r\\n\\r\\nDr. Slaughter has written or edited seven books, including Unfinished Business: Women, Men, Work, Family (2015), A New World Order (2004), and The Idea That Is America: Keeping Faith with Our Values in a Dangerous World (2007), and over 100 scholarly articles. She was the convener and academic co-chair, with Professor John Ikenberry, of the Princeton Project on National Security, a multi-year research project aimed at developing a new, bipartisan national security strategy for the United States. In 2012 she published the article \\u201cWhy Women Still Can\\u2019t Have It All,\\u201d in The Atlantic, which quickly became the most read article in the history of the magazine and helped spawn a renewed national debate on the continued obstacles to genuine full male-female equality.\\r\\n\\r\\nDr. Slaughter writes a monthly column for Project Syndicate. She provides frequent commentary for both mainstream and new media and curates foreign policy news for over 80,000 followers on Twitter. Foreign Policy magazine named her to their annual list of the Top 100 Global Thinkers in 2009, 2010, 2011, and 2012. She received a B.A. from Princeton, an M.Phil and D.Phil in international relations from Oxford, where she was a Daniel M. Sachs Scholar, and a J.D. from Harvard. She is married to Professor Andrew Moravcsik; they live in Princeton with their two sons.\", \"latest_revision_created_at\": \"2016-01-12T19:09:16.775Z\", \"go_live_at\": null, \"social_media\": \"[]\", \"expert\": true, \"title\": \"Anne-Marie Slaughter\", \"seo_title\": \"\", \"slug\": \"anne-marie-slaughter\", \"live\": true, \"role\": \"Board Member\", \"location\": \"\", \"has_unpublished_changes\": false, \"email\": \"anne@anne.com\", \"numchild\": 0, \"content_type\": 14, \"show_in_menus\": false, \"path\": \"0001000100050001\", \"url_path\": \"/new-america/our-people/anne-marie-slaughter/\", \"expired\": false, \"pk\": 38, \"locked\": false, \"name\": \"Anne-Marie Slaughter\", \"depth\": 4, \"short_bio\": \"Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York.\", \"first_published_at\": \"2016-01-12T19:09:16.786Z\", \"expire_at\": null}", "approved_go_live_at": null } }, @@ -15794,7 +15794,6 @@ "email": "anne@anne.com", "short_bio": "Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York.", "long_bio": "Anne-Marie Slaughter is currently the President and CEO of New America, a think tank and civic enterprise with offices in Washington and New York. She is also the Bert G. Kerstetter '66 University Professor Emerita of Politics and International Affairs at Princeton University. From 2009\u20132011 she served as director of Policy Planning for the United States Department of State, the first woman to hold that position. Upon leaving the State Department she received the Secretary\u2019s Distinguished Service Award for her work leading the Quadrennial Diplomacy and Development Review, as well as meritorious service awards from USAID and the Supreme Allied Commander for Europe. Prior to her government service, Dr. Slaughter was the Dean of Princeton\u2019s Woodrow Wilson School of Public and International Affairs from 2002\u20132009 and the J. Sinclair Armstrong Professor of International, Foreign, and Comparative Law at Harvard Law School from 1994-2002.\r\n\r\nDr. Slaughter has written or edited seven books, including Unfinished Business: Women, Men, Work, Family (2015), A New World Order (2004), and The Idea That Is America: Keeping Faith with Our Values in a Dangerous World (2007), and over 100 scholarly articles. She was the convener and academic co-chair, with Professor John Ikenberry, of the Princeton Project on National Security, a multi-year research project aimed at developing a new, bipartisan national security strategy for the United States. In 2012 she published the article \u201cWhy Women Still Can\u2019t Have It All,\u201d in The Atlantic, which quickly became the most read article in the history of the magazine and helped spawn a renewed national debate on the continued obstacles to genuine full male-female equality.\r\n\r\nDr. Slaughter writes a monthly column for Project Syndicate. She provides frequent commentary for both mainstream and new media and curates foreign policy news for over 80,000 followers on Twitter. Foreign Policy magazine named her to their annual list of the Top 100 Global Thinkers in 2009, 2010, 2011, and 2012. She received a B.A. from Princeton, an M.Phil and D.Phil in international relations from Oxford, where she was a Daniel M. Sachs Scholar, and a J.D. from Harvard. She is married to Professor Andrew Moravcsik; they live in Princeton with their two sons.", - "belongs_to_program": null, "expert": true, "location": "", "photo": "[]", @@ -15811,7 +15810,6 @@ "email": "kevin@kevin.com", "short_bio": "Kevin Bankston is the Director of New America\u2019s Open Technology Institute, where he works in the public interest to promote policy and regulatory reforms to strengthen communities by supporting open communications networks, platforms, and technologies. He previously served as OTI's Policy Director.", "long_bio": "Kevin Bankston is the Director of New America\u2019s Open Technology Institute, where he works in the public interest to promote policy and regulatory reforms to strengthen communities by supporting open communications networks, platforms, and technologies. He previously served as OTI's Policy Director.\r\n\r\nPrior to leading OTI\u2019s policy team, Kevin was a Senior Counsel and the Director of the Free Expression Project at the Center for Democracy & Technology, a Washington, DC-based non-profit organization dedicated to promoting democratic values and constitutional liberties in the digital age. From that position, he spent two years advocating on a wide range of Internet and technology policy issues both international and domestic, most recently organizing a broad coalition of companies and civil society organizations to demand greater transparency around the US government\u2019s surveillance practices. He also has served since 2005 on the board of the First Amendment Coalition, a non-profit public interest organization dedicated to advancing free speech and a more open and accountable government, and previously was a nonresidential fellow at the Stanford Law School\u2019s Center for Internet & Society.\r\n\r\nPrior to joining CDT, he worked for nearly a decade at the Electronic Frontier Foundation, specializing in free speech and privacy law with a focus on government surveillance, Internet privacy, and location privacy. As a Senior Staff Attorney at EFF, he regularly litigated issues surrounding free expression and electronic surveillance, and was a lead counsel in EFF\u2019s lawsuits against the National Security Agency and AT&T, challenging the legality of the NSA warrantless wiretapping program first revealed in 2005. He originally joined EFF as an Equal Justice Works/Bruce J. Ennis First Amendment Fellow, studying the impact of post-9/11 anti-terrorism surveillance initiatives on online privacy and free expression. Before joining EFF, he litigated Internet-related free speech cases at the national office of the American Civil Liberties Union in New York City as a Justice William Brennan First Amendment Fellow. He received his JD at the University of Southern California Law School after receiving his BA at the University of Texas at Austin.", - "belongs_to_program": 87, "expert": true, "location": "", "photo": "[]", diff --git a/home/templates/tags/side_menu.html b/home/templates/tags/side_menu.html new file mode 100644 index 000000000..074aef6b5 --- /dev/null +++ b/home/templates/tags/side_menu.html @@ -0,0 +1,18 @@ +{% load side_menu wagtailcore_tags static %} +{% get_site_root as site_root %} + + \ No newline at end of file diff --git a/home/templatetags/side_menu.py b/home/templatetags/side_menu.py new file mode 100644 index 000000000..4cd514b6d --- /dev/null +++ b/home/templatetags/side_menu.py @@ -0,0 +1,51 @@ +from datetime import date +from django import template +from django.conf import settings + +from programs.models import Program + +register = template.Library() + +@register.assignment_tag(takes_context=True) +def get_site_root(context): + # NB this returns a core.Page, not the implementation-specific model used + # so object-comparison to self will return false as objects would differ + return context['request'].site.root_page + + +# def has_menu_children(page): +# return page.get_children().live().in_menu().exists() + + +# Retrieves the top menu items - the immediate children of the parent page +@register.inclusion_tag('tags/side_menu.html', takes_context=True) +def side_menu(context, parent, calling_page=None): + # # programs = Program.objects.in_menu().order_by("title").exclude(location=True) + # programs = [] + # location_programs = [] + # all_programs = Program.objects.in_menu().order_by("title") + # for program in all_programs: + # if program.location == True: + # location_programs.append(program) + # else: + # programs.append(program) + return { + 'calling_page': calling_page, + # 'programs': programs, + # 'location_programs': location_programs, + # required by the pageurl tag that we want to use within this template + 'request': context['request'], + } + + +# Retrieves the children of the top menu items for the drop downs +# @register.inclusion_tag('tags/top_menu_children.html', takes_context=True) +# def top_menu_children(context, parent): +# subprograms = parent.subprogram_set.all() + +# return { +# 'parent': parent, +# 'subprograms': subprograms, +# # required by the pageurl tag that we want to use within this template +# 'request': context['request'], +# } diff --git a/home/templatetags/top_menu.py b/home/templatetags/top_menu.py index 51d4d8707..99959031d 100644 --- a/home/templatetags/top_menu.py +++ b/home/templatetags/top_menu.py @@ -23,6 +23,8 @@ def top_menu(context, parent, calling_page=None): # programs = Program.objects.in_menu().order_by("title").exclude(location=True) programs = [] location_programs = [] + print parent + print calling_page all_programs = Program.objects.in_menu().order_by("title") for program in all_programs: if program.location == True: diff --git a/mysite/assets/scss/vendor/_foundation.scss b/mysite/assets/scss/vendor/_foundation.scss index 2b5979002..0bb462557 100644 --- a/mysite/assets/scss/vendor/_foundation.scss +++ b/mysite/assets/scss/vendor/_foundation.scss @@ -26,7 +26,7 @@ // @include foundation-flex-video; // @include foundation-label; // @include foundation-media-object; -// @include foundation-menu; +@include foundation-menu; // @include foundation-off-canvas; // @include foundation-orbit; // @include foundation-pagination; diff --git a/mysite/templates/base.html b/mysite/templates/base.html index 150d1f851..873179cb3 100644 --- a/mysite/templates/base.html +++ b/mysite/templates/base.html @@ -1,5 +1,6 @@ {% load static wagtailuserbar %} {% load top_menu %} +{% load side_menu %} {% load wagtailcore_tags %} @@ -48,8 +49,22 @@ {% endif %} - {% block content %} - {% endblock %} +
    +
    +
    + {% if self.name != 'New America' %} + {% block side_menu %} + {% get_site_root as site_root %} + {% side_menu parent=site_root calling_page=self %} + {% endblock %} + {% endif %} +
    +
    + {% block content %} + {% endblock %} +
    +
    +
    {% include 'ui_elements/footer.html' %} diff --git a/programs/templates/programs/program.html b/programs/templates/programs/program.html index 78c8a145a..d3c1fe0dc 100644 --- a/programs/templates/programs/program.html +++ b/programs/templates/programs/program.html @@ -6,8 +6,6 @@ {% block body_class %}template-homepage{% endblock %} {% block content %} -
    -
    From d4021e66e5ee6ec4836bf50a27f1f25dbe71d18c Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Tue, 16 Feb 2016 16:45:05 -0500 Subject: [PATCH 03/17] added sidebar menu styling --- home/templates/tags/side_menu.html | 39 +++++++++----- mysite/assets/scss/modules/_manifest.scss | 1 + mysite/assets/scss/modules/header/_main.scss | 2 +- .../scss/modules/sidemenu/_manifest.scss | 1 + mysite/assets/scss/modules/sidemenu/main.scss | 51 +++++++++++++++++++ mysite/assets/scss/variables/_base.scss | 3 +- mysite/assets/scss/variables/_foundation.scss | 5 +- mysite/assets/scss/vendor/_foundation.scss | 6 +-- mysite/templates/base.html | 4 +- 9 files changed, 91 insertions(+), 21 deletions(-) create mode 100644 mysite/assets/scss/modules/sidemenu/_manifest.scss create mode 100644 mysite/assets/scss/modules/sidemenu/main.scss diff --git a/home/templates/tags/side_menu.html b/home/templates/tags/side_menu.html index 074aef6b5..2254c03e9 100644 --- a/home/templates/tags/side_menu.html +++ b/home/templates/tags/side_menu.html @@ -1,18 +1,31 @@ {% load side_menu wagtailcore_tags static %} {% get_site_root as site_root %} - +
    +
    \ No newline at end of file diff --git a/mysite/assets/scss/modules/_manifest.scss b/mysite/assets/scss/modules/_manifest.scss index ec94debcc..4e3c10554 100644 --- a/mysite/assets/scss/modules/_manifest.scss +++ b/mysite/assets/scss/modules/_manifest.scss @@ -11,3 +11,4 @@ @import 'hero-grid/manifest'; @import 'page-header/manifest'; @import 'subscribe/main'; +@import 'sidemenu/manifest'; diff --git a/mysite/assets/scss/modules/header/_main.scss b/mysite/assets/scss/modules/header/_main.scss index dcd1743af..85079faab 100644 --- a/mysite/assets/scss/modules/header/_main.scss +++ b/mysite/assets/scss/modules/header/_main.scss @@ -8,7 +8,7 @@ position: fixed; @include desktop-header { position: fixed; - border-bottom: $thick-border-width solid palette-get(na-black-10); + border-bottom: $thick-border-width solid palette-get(na-turquoise); } @include expanded-header { padding-top: 8px; diff --git a/mysite/assets/scss/modules/sidemenu/_manifest.scss b/mysite/assets/scss/modules/sidemenu/_manifest.scss new file mode 100644 index 000000000..5b4f1be14 --- /dev/null +++ b/mysite/assets/scss/modules/sidemenu/_manifest.scss @@ -0,0 +1 @@ +@import 'main'; \ No newline at end of file diff --git a/mysite/assets/scss/modules/sidemenu/main.scss b/mysite/assets/scss/modules/sidemenu/main.scss new file mode 100644 index 000000000..20ffd48de --- /dev/null +++ b/mysite/assets/scss/modules/sidemenu/main.scss @@ -0,0 +1,51 @@ +$left-pad: 20px; + +.sidemenu { + top: 0; + background-color: palette-get(na-black); + width: $max-sidemenu-width; + z-index: 1000; + font-color:palette-get(na-white); + padding-top: 20px; + /*padding-left: 20px;*/ + + &__program-title { + margin-left: $left-pad; + width: $max-sidemenu-width / 2; + background-color: palette-get(na-white); + padding: 7px 7px 1.5px 7px; + + &__title { + font-size:15px; + font-color:palette-get(na-black); + /*padding-left: $left-pad;*/ + } + } + + &__link-group { + color: white; + + &__title { + padding-left: $left-pad; + font-size:20px; + } + + &__link { + padding-left: $left-pad; + + &:hover { + background-color: palette-get(na-turquoise); + } + + & > a { + color: grey; + + &:hover { + color: white; + } + } + } + + } + +} \ No newline at end of file diff --git a/mysite/assets/scss/variables/_base.scss b/mysite/assets/scss/variables/_base.scss index 3977957ce..d025f9037 100644 --- a/mysite/assets/scss/variables/_base.scss +++ b/mysite/assets/scss/variables/_base.scss @@ -1,5 +1,6 @@ -$max-site-width: 1150px; +$max-site-width: 1350px; $max-body-width: 650px; +$max-sidemenu-width: 300px; $thick-border-width: 4px; diff --git a/mysite/assets/scss/variables/_foundation.scss b/mysite/assets/scss/variables/_foundation.scss index 93418be1b..4bc4eb180 100644 --- a/mysite/assets/scss/variables/_foundation.scss +++ b/mysite/assets/scss/variables/_foundation.scss @@ -71,4 +71,7 @@ $blockquote-color: palette-get(na-black); $blockquote-border: 4px solid palette-get(na-black); $primary-color: palette-get(na-black); -$secondary-color: palette-get(na-turquoise); \ No newline at end of file +$secondary-color: palette-get(na-turquoise); + +$menu-margin: 0px; +$menu-item-padding: 14px 0px; \ No newline at end of file diff --git a/mysite/assets/scss/vendor/_foundation.scss b/mysite/assets/scss/vendor/_foundation.scss index 0bb462557..2f46cff31 100644 --- a/mysite/assets/scss/vendor/_foundation.scss +++ b/mysite/assets/scss/vendor/_foundation.scss @@ -11,7 +11,7 @@ @include foundation-typography; @include foundation-button; @include foundation-forms; -// @include foundation-visibility-classes; +@include foundation-visibility-classes; @include foundation-float-classes; // @include foundation-accordion; // @include foundation-accordion-menu; @@ -33,14 +33,14 @@ // @include foundation-progress-bar; // @include foundation-slider; // @include foundation-sticky; -// @include foundation-reveal; +@include foundation-reveal; // @include foundation-switch; // @include foundation-table; // @include foundation-tabs; // @include foundation-thumbnail; // @include foundation-title-bar; // @include foundation-tooltip; -// @include foundation-top-bar; +@include foundation-top-bar; // Overrides. Use very sparingly - modify Foundation variables instead. .button { font-weight: bold; diff --git a/mysite/templates/base.html b/mysite/templates/base.html index 873179cb3..4ec6e96c2 100644 --- a/mysite/templates/base.html +++ b/mysite/templates/base.html @@ -51,7 +51,7 @@
    -
    +
    {% if self.name != 'New America' %} {% block side_menu %} {% get_site_root as site_root %} @@ -59,7 +59,7 @@ {% endblock %} {% endif %}
    -
    +
    {% block content %} {% endblock %}
    From cda1a8551fc57e8787703869e33d94da7e78d79e Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Wed, 17 Feb 2016 17:17:25 -0500 Subject: [PATCH 04/17] fixed sidebar/content layout --- .../assets/scss/base/layout/_containers.scss | 18 ++++++++++++++++++ mysite/assets/scss/base/layout/_manifest.scss | 1 + mysite/assets/scss/mixins/_breakpoints.scss | 5 +++++ .../modules/sidemenu/{main.scss => _main.scss} | 0 mysite/templates/base.html | 4 ++-- programs/templates/programs/program.html | 1 + 6 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 mysite/assets/scss/base/layout/_containers.scss rename mysite/assets/scss/modules/sidemenu/{main.scss => _main.scss} (100%) diff --git a/mysite/assets/scss/base/layout/_containers.scss b/mysite/assets/scss/base/layout/_containers.scss new file mode 100644 index 000000000..20f9ae205 --- /dev/null +++ b/mysite/assets/scss/base/layout/_containers.scss @@ -0,0 +1,18 @@ + +.sidebar-container { + width: $max-sidemenu-width; + position:absolute; + float:left; + + +} + + + +.content-container { + width: 100%; + height: 100%; + padding-left: $max-sidemenu-width; + + +} \ No newline at end of file diff --git a/mysite/assets/scss/base/layout/_manifest.scss b/mysite/assets/scss/base/layout/_manifest.scss index 12a260d5a..5f52d37eb 100644 --- a/mysite/assets/scss/base/layout/_manifest.scss +++ b/mysite/assets/scss/base/layout/_manifest.scss @@ -1,2 +1,3 @@ @import 'wrapper'; @import 'section'; +@import 'containers'; diff --git a/mysite/assets/scss/mixins/_breakpoints.scss b/mysite/assets/scss/mixins/_breakpoints.scss index 57a980d3d..7297fdfac 100644 --- a/mysite/assets/scss/mixins/_breakpoints.scss +++ b/mysite/assets/scss/mixins/_breakpoints.scss @@ -16,3 +16,8 @@ @content; } } +@mixin desktop-sidemenu() { + @include breakpoint(medium) { + @content; + } +} diff --git a/mysite/assets/scss/modules/sidemenu/main.scss b/mysite/assets/scss/modules/sidemenu/_main.scss similarity index 100% rename from mysite/assets/scss/modules/sidemenu/main.scss rename to mysite/assets/scss/modules/sidemenu/_main.scss diff --git a/mysite/templates/base.html b/mysite/templates/base.html index 4ec6e96c2..c984de6a1 100644 --- a/mysite/templates/base.html +++ b/mysite/templates/base.html @@ -51,7 +51,7 @@
    -
    + -
    +
    {% block content %} {% endblock %}
    diff --git a/programs/templates/programs/program.html b/programs/templates/programs/program.html index d3c1fe0dc..8f8a2b814 100644 --- a/programs/templates/programs/program.html +++ b/programs/templates/programs/program.html @@ -6,6 +6,7 @@ {% block body_class %}template-homepage{% endblock %} {% block content %} +
    From c6cef4025c2318822a9882f7ad74f878fef9b922 Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Wed, 17 Feb 2016 17:30:12 -0500 Subject: [PATCH 05/17] added mobile sidebar dummy --- home/templates/tags/side_menu.html | 6 ++++++ .../assets/scss/base/layout/_containers.scss | 13 +++++++++---- mysite/assets/scss/modules/sidemenu/_main.scss | 18 ++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/home/templates/tags/side_menu.html b/home/templates/tags/side_menu.html index 2254c03e9..89be2fb34 100644 --- a/home/templates/tags/side_menu.html +++ b/home/templates/tags/side_menu.html @@ -1,6 +1,12 @@ {% load side_menu wagtailcore_tags static %} {% get_site_root as site_root %} +
    + + +
    + +
    diff --git a/mysite/assets/scss/base/layout/_containers.scss b/mysite/assets/scss/base/layout/_containers.scss index 20f9ae205..36d9eb2f1 100644 --- a/mysite/assets/scss/base/layout/_containers.scss +++ b/mysite/assets/scss/base/layout/_containers.scss @@ -1,10 +1,12 @@ .sidebar-container { - width: $max-sidemenu-width; + width:100%; position:absolute; float:left; - + @include desktop-sidemenu { + width: $max-sidemenu-width; + } } @@ -12,7 +14,10 @@ .content-container { width: 100%; height: 100%; - padding-left: $max-sidemenu-width; - + padding-top:$mobile-header-height; + @include desktop-sidemenu { + padding-left: $max-sidemenu-width; + padding-top:0px; + } } \ No newline at end of file diff --git a/mysite/assets/scss/modules/sidemenu/_main.scss b/mysite/assets/scss/modules/sidemenu/_main.scss index 20ffd48de..ea28a29c4 100644 --- a/mysite/assets/scss/modules/sidemenu/_main.scss +++ b/mysite/assets/scss/modules/sidemenu/_main.scss @@ -1,5 +1,18 @@ $left-pad: 20px; +.mobile-sidemenu { + background-color: palette-get(na-black); + width: 100%; + height:$mobile-header-height; + z-index: 1000; + font-color:palette-get(na-white); + + @include desktop-sidemenu { + display:none; + } +} + + .sidemenu { top: 0; background-color: palette-get(na-black); @@ -7,8 +20,13 @@ $left-pad: 20px; z-index: 1000; font-color:palette-get(na-white); padding-top: 20px; + display:none; /*padding-left: 20px;*/ + @include desktop-sidemenu { + display:block; + } + &__program-title { margin-left: $left-pad; width: $max-sidemenu-width / 2; From cb1b366d13ff7532fbe52796f0222addac8234a7 Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Wed, 17 Feb 2016 17:43:53 -0500 Subject: [PATCH 06/17] added basic toggling of mobile sidebar menu --- home/templates/tags/side_menu.html | 2 +- mysite/assets/js/modules/index.js | 1 + mysite/assets/js/modules/sidemenu/index.js | 16 ++++++++++++++++ mysite/assets/scss/modules/sidemenu/_main.scss | 7 ++++++- mysite/assets/scss/variables/_base.scss | 2 +- 5 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 mysite/assets/js/modules/sidemenu/index.js diff --git a/home/templates/tags/side_menu.html b/home/templates/tags/side_menu.html index 89be2fb34..27d1386cc 100644 --- a/home/templates/tags/side_menu.html +++ b/home/templates/tags/side_menu.html @@ -2,7 +2,7 @@ {% get_site_root as site_root %}
    - +
    diff --git a/mysite/assets/js/modules/index.js b/mysite/assets/js/modules/index.js index f7b0688a8..4b7ba5b21 100644 --- a/mysite/assets/js/modules/index.js +++ b/mysite/assets/js/modules/index.js @@ -1,2 +1,3 @@ import './border-panel/index.js' import './header/index.js' +import './sidemenu/index.js' diff --git a/mysite/assets/js/modules/sidemenu/index.js b/mysite/assets/js/modules/sidemenu/index.js new file mode 100644 index 000000000..9197abbd7 --- /dev/null +++ b/mysite/assets/js/modules/sidemenu/index.js @@ -0,0 +1,16 @@ +import $ from 'jquery' + +import getJQueryObjects from './../../utilities/get_jquery_objects.js' + +function addSidemenuInteractivity() { + $(".mobile-sidemenu__toggle").on("click", function() { + console.log("clicked!"); + $(".sidemenu").toggle(); + $(".content-container").toggle(); + $("footer").toggle(); + }) + + +} + +$(addSidemenuInteractivity) diff --git a/mysite/assets/scss/modules/sidemenu/_main.scss b/mysite/assets/scss/modules/sidemenu/_main.scss index ea28a29c4..574de70af 100644 --- a/mysite/assets/scss/modules/sidemenu/_main.scss +++ b/mysite/assets/scss/modules/sidemenu/_main.scss @@ -10,13 +10,18 @@ $left-pad: 20px; @include desktop-sidemenu { display:none; } + + &__toggle { + color:white; + font-weight:bold; + } } .sidemenu { top: 0; background-color: palette-get(na-black); - width: $max-sidemenu-width; + width: 100%; z-index: 1000; font-color:palette-get(na-white); padding-top: 20px; diff --git a/mysite/assets/scss/variables/_base.scss b/mysite/assets/scss/variables/_base.scss index d025f9037..af8e13e1d 100644 --- a/mysite/assets/scss/variables/_base.scss +++ b/mysite/assets/scss/variables/_base.scss @@ -4,6 +4,6 @@ $max-sidemenu-width: 300px; $thick-border-width: 4px; -$mobile-header-height: 60px; +$mobile-header-height: 70px; $mobile-padding: 10px; From 03dad1abdf24a5098d77933262ecf564d6eb182c Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Wed, 17 Feb 2016 18:12:19 -0500 Subject: [PATCH 07/17] added program logo to mobile sidebar --- home/templates/tags/side_menu.html | 6 ++++- .../assets/scss/base/layout/_containers.scss | 1 + .../assets/scss/modules/sidemenu/_main.scss | 27 ++++++++++++++++++- 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/home/templates/tags/side_menu.html b/home/templates/tags/side_menu.html index 27d1386cc..75337fee6 100644 --- a/home/templates/tags/side_menu.html +++ b/home/templates/tags/side_menu.html @@ -3,7 +3,11 @@
    diff --git a/mysite/assets/scss/base/layout/_containers.scss b/mysite/assets/scss/base/layout/_containers.scss index 36d9eb2f1..42af30fb7 100644 --- a/mysite/assets/scss/base/layout/_containers.scss +++ b/mysite/assets/scss/base/layout/_containers.scss @@ -1,6 +1,7 @@ .sidebar-container { width:100%; + height:100%; position:absolute; float:left; diff --git a/mysite/assets/scss/modules/sidemenu/_main.scss b/mysite/assets/scss/modules/sidemenu/_main.scss index 574de70af..4ab608a9a 100644 --- a/mysite/assets/scss/modules/sidemenu/_main.scss +++ b/mysite/assets/scss/modules/sidemenu/_main.scss @@ -11,7 +11,25 @@ $left-pad: 20px; display:none; } + &__program-title { + position:absolute; + margin-top: 10px; + margin-left: $left-pad; + width: $max-sidemenu-width / 2; + background-color: palette-get(na-white); + padding: 7px 7px 1.5px 7px; + + &__title { + font-size:13px; + font-color:palette-get(na-black); + /*padding-left: $left-pad;*/ + } + } + &__toggle { + position:absolute; + top:10px; + left: 300px; color:white; font-weight:bold; } @@ -22,14 +40,16 @@ $left-pad: 20px; top: 0; background-color: palette-get(na-black); width: 100%; + height:100%; z-index: 1000; font-color:palette-get(na-white); - padding-top: 20px; + display:none; /*padding-left: 20px;*/ @include desktop-sidemenu { display:block; + padding-top: 20px; } &__program-title { @@ -37,6 +57,11 @@ $left-pad: 20px; width: $max-sidemenu-width / 2; background-color: palette-get(na-white); padding: 7px 7px 1.5px 7px; + display:none; + + @include desktop-sidemenu { + display:block; + } &__title { font-size:15px; From 11b8b070080b19df0502321e987c7482112b0c60 Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Thu, 18 Feb 2016 09:50:16 -0500 Subject: [PATCH 08/17] fixed sidemenu resizing breakpoints --- mysite/assets/js/modules/sidemenu/index.js | 28 +++++++++++++++++-- .../assets/scss/modules/sidemenu/_main.scss | 5 ++-- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/mysite/assets/js/modules/sidemenu/index.js b/mysite/assets/js/modules/sidemenu/index.js index 9197abbd7..457fe1ee7 100644 --- a/mysite/assets/js/modules/sidemenu/index.js +++ b/mysite/assets/js/modules/sidemenu/index.js @@ -2,15 +2,39 @@ import $ from 'jquery' import getJQueryObjects from './../../utilities/get_jquery_objects.js' +var clicked = false; + function addSidemenuInteractivity() { $(".mobile-sidemenu__toggle").on("click", function() { + clicked = !clicked; console.log("clicked!"); $(".sidemenu").toggle(); $(".content-container").toggle(); $("footer").toggle(); }) - - } $(addSidemenuInteractivity) + +var $window = $( window ); // so you have a "cached" reference +var breakpoint = 640; + +$window.resize ( function () { + console.log("calling resize"); + + + if ($window.width() > breakpoint ) { + // if (clicked == true ) { + console.log("width is greater"); + $(".sidemenu").css("display", "block"); + $(".content-container").css("display", "block"); + $("footer").css("display", "block"); + clicked = false; + + } else { + if (!clicked) { + $(".sidemenu").css("display", "none"); + } + } + +}); \ No newline at end of file diff --git a/mysite/assets/scss/modules/sidemenu/_main.scss b/mysite/assets/scss/modules/sidemenu/_main.scss index 4ab608a9a..5395498bd 100644 --- a/mysite/assets/scss/modules/sidemenu/_main.scss +++ b/mysite/assets/scss/modules/sidemenu/_main.scss @@ -28,8 +28,9 @@ $left-pad: 20px; &__toggle { position:absolute; - top:10px; - left: 300px; + z-index: 1100; + top: 30px; + right: 120px; color:white; font-weight:bold; } From 909d9088d59cb9d2cde36e4a20cb33e33478ed3b Mon Sep 17 00:00:00 2001 From: Sana Javed Date: Thu, 18 Feb 2016 22:25:39 -0500 Subject: [PATCH 09/17] Adding a template tag to check if the page requires a navbar --- home/templatetags/side_menu.py | 41 ++++++++++++++++++++-------------- home/templatetags/top_menu.py | 2 -- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/home/templatetags/side_menu.py b/home/templatetags/side_menu.py index 4cd514b6d..4e8a3b786 100644 --- a/home/templatetags/side_menu.py +++ b/home/templatetags/side_menu.py @@ -2,20 +2,26 @@ from django import template from django.conf import settings -from programs.models import Program +from programs.models import Program, AbstractProgram +from event.models import AllEventsHomePage +from home.models import Post register = template.Library() -@register.assignment_tag(takes_context=True) -def get_site_root(context): - # NB this returns a core.Page, not the implementation-specific model used - # so object-comparison to self will return false as objects would differ - return context['request'].site.root_page - - -# def has_menu_children(page): -# return page.get_children().live().in_menu().exists() +@register.assignment_tag(takes_context=True) +def needs_sidebar(context): + """ Checks if the page is an AbstractProgram descendant """ + # print(dir(context['self'])) + print(context['self'].get_parent()) + use_side_bar = False + if isinstance(context['self'], AbstractProgram): + use_side_bar = True + elif isinstance(context['self'], Post): + use_side_bar = True + elif 'programs.Program' in context['self'].parent_page_types: + use_side_bar = True + return use_side_bar # Retrieves the top menu items - the immediate children of the parent page @register.inclusion_tag('tags/side_menu.html', takes_context=True) @@ -29,13 +35,14 @@ def side_menu(context, parent, calling_page=None): # location_programs.append(program) # else: # programs.append(program) - return { - 'calling_page': calling_page, - # 'programs': programs, - # 'location_programs': location_programs, - # required by the pageurl tag that we want to use within this template - 'request': context['request'], - } + # return { + # 'calling_page': calling_page, + # # 'programs': programs, + # # 'location_programs': location_programs, + # # required by the pageurl tag that we want to use within this template + # 'request': context['request'], + # } + return {} # Retrieves the children of the top menu items for the drop downs diff --git a/home/templatetags/top_menu.py b/home/templatetags/top_menu.py index 99959031d..51d4d8707 100644 --- a/home/templatetags/top_menu.py +++ b/home/templatetags/top_menu.py @@ -23,8 +23,6 @@ def top_menu(context, parent, calling_page=None): # programs = Program.objects.in_menu().order_by("title").exclude(location=True) programs = [] location_programs = [] - print parent - print calling_page all_programs = Program.objects.in_menu().order_by("title") for program in all_programs: if program.location == True: From 48b1e778412754ba4b51ccd98df637efb9f12528 Mon Sep 17 00:00:00 2001 From: Sana Javed Date: Thu, 18 Feb 2016 22:26:06 -0500 Subject: [PATCH 10/17] Updated the top and side bar menus --- home/templates/tags/side_menu.html | 3 +-- home/templates/tags/top_menu.html | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/home/templates/tags/side_menu.html b/home/templates/tags/side_menu.html index 75337fee6..94fd378f1 100644 --- a/home/templates/tags/side_menu.html +++ b/home/templates/tags/side_menu.html @@ -1,5 +1,4 @@ {% load side_menu wagtailcore_tags static %} -{% get_site_root as site_root %}
    @@ -38,4 +37,4 @@

    INTERNATIONAL SECURITY

    -
    \ No newline at end of file +
    diff --git a/home/templates/tags/top_menu.html b/home/templates/tags/top_menu.html index 7734875da..81608fe97 100644 --- a/home/templates/tags/top_menu.html +++ b/home/templates/tags/top_menu.html @@ -1,5 +1,4 @@ {% load top_menu wagtailcore_tags static %} -{% get_site_root as site_root %}
    From 14c4c2ab0b582bb7978b48761101f390b0a226c5 Mon Sep 17 00:00:00 2001 From: Sana Javed Date: Thu, 18 Feb 2016 22:26:30 -0500 Subject: [PATCH 11/17] Updated base with template tags --- mysite/templates/base.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/mysite/templates/base.html b/mysite/templates/base.html index c984de6a1..36e18ec6c 100644 --- a/mysite/templates/base.html +++ b/mysite/templates/base.html @@ -1,7 +1,7 @@ {% load static wagtailuserbar %} {% load top_menu %} {% load side_menu %} -{% load wagtailcore_tags %} +{% load wagtailcore_tags %} @@ -48,22 +48,23 @@ {% endif %} - + {% needs_sidebar as use_sidebar %} +
    + {% if use_sidebar %} -
    + {% endif %} +
    {% block content %} {% endblock %}
    +
    {% include 'ui_elements/footer.html' %} From 3f2c903ee78f9b09363c33e9a4ed6daa6eb03ca9 Mon Sep 17 00:00:00 2001 From: Sana Javed Date: Thu, 18 Feb 2016 22:26:44 -0500 Subject: [PATCH 12/17] PEP8 changes --- press_release/models.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/press_release/models.py b/press_release/models.py index c53e5abb6..dbcc368d4 100644 --- a/press_release/models.py +++ b/press_release/models.py @@ -29,13 +29,14 @@ class PressRelease(Post): FieldPanel('headline'), FieldPanel('sub_headline'), StreamFieldPanel('attachment'), - ] + Post.content_panels + ] + Post.content_panels + class AllPressReleasesHomePage(Page): """ A page which inherits from the abstract Page model and returns every Press Release in the PressRelease model - for the organization-wide Press Release Homepage + for the organization-wide Press Release Homepage """ parent_page_types = ['home.Homepage'] subpage_types = [] @@ -49,6 +50,7 @@ def get_context(self, request): class Meta: verbose_name = "Homepage for all Press Releases" + class ProgramPressReleasesPage(Page): """ A page which inherits from the abstract Page model and From 0f5b76fa1aebe1a47b2595c8c8536342503afdf9 Mon Sep 17 00:00:00 2001 From: Sana Javed Date: Thu, 18 Feb 2016 22:33:45 -0500 Subject: [PATCH 13/17] Removing print statements --- home/templatetags/side_menu.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/home/templatetags/side_menu.py b/home/templatetags/side_menu.py index 4e8a3b786..9fae86007 100644 --- a/home/templatetags/side_menu.py +++ b/home/templatetags/side_menu.py @@ -12,8 +12,6 @@ @register.assignment_tag(takes_context=True) def needs_sidebar(context): """ Checks if the page is an AbstractProgram descendant """ - # print(dir(context['self'])) - print(context['self'].get_parent()) use_side_bar = False if isinstance(context['self'], AbstractProgram): use_side_bar = True From a4df8e1d649539149a7d7a9bf1b12b93cdb727f0 Mon Sep 17 00:00:00 2001 From: Kirk Jackson Date: Fri, 19 Feb 2016 14:42:30 -0500 Subject: [PATCH 14/17] fixed sidebar/content container formatting issues --- .../assets/scss/base/layout/_containers.scss | 18 +++++++++--------- mysite/assets/scss/base/layout/_wrapper.scss | 1 + mysite/assets/scss/mixins/_breakpoints.scss | 1 + mysite/templates/base.html | 8 +++++--- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/mysite/assets/scss/base/layout/_containers.scss b/mysite/assets/scss/base/layout/_containers.scss index 42af30fb7..cd4270ad2 100644 --- a/mysite/assets/scss/base/layout/_containers.scss +++ b/mysite/assets/scss/base/layout/_containers.scss @@ -1,5 +1,4 @@ - -.sidebar-container { +.sidemenu-container { width:100%; height:100%; position:absolute; @@ -10,15 +9,16 @@ } } - - .content-container { width: 100%; height: 100%; - padding-top:$mobile-header-height; - @include desktop-sidemenu { - padding-left: $max-sidemenu-width; - padding-top:0px; + &.has-sidemenu { + padding-top:$mobile-header-height; + + @include desktop-sidemenu { + padding-left: $max-sidemenu-width; + padding-top: 0px; + } } -} \ No newline at end of file +} diff --git a/mysite/assets/scss/base/layout/_wrapper.scss b/mysite/assets/scss/base/layout/_wrapper.scss index 20a931bbf..3c052770b 100644 --- a/mysite/assets/scss/base/layout/_wrapper.scss +++ b/mysite/assets/scss/base/layout/_wrapper.scss @@ -1,6 +1,7 @@ .wrapper { display: block; width: 100%; + /*position:absolute;*/ margin: auto; overflow-x: hidden; &__clear-header { diff --git a/mysite/assets/scss/mixins/_breakpoints.scss b/mysite/assets/scss/mixins/_breakpoints.scss index 7297fdfac..5a86f3ecb 100644 --- a/mysite/assets/scss/mixins/_breakpoints.scss +++ b/mysite/assets/scss/mixins/_breakpoints.scss @@ -16,6 +16,7 @@ @content; } } + @mixin desktop-sidemenu() { @include breakpoint(medium) { @content; diff --git a/mysite/templates/base.html b/mysite/templates/base.html index 36e18ec6c..7740a52d4 100644 --- a/mysite/templates/base.html +++ b/mysite/templates/base.html @@ -51,15 +51,17 @@ {% needs_sidebar as use_sidebar %}
    -
    +
    {% if use_sidebar %} -