Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

Commit

Permalink
Merge pull request #754 from alonisser/master
Browse files Browse the repository at this point in the history
Move home page to be current help page
  • Loading branch information
alonisser authored Nov 15, 2016
2 parents b693d08 + e33b954 commit 28ffc78
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 61 deletions.
14 changes: 11 additions & 3 deletions auxiliary/tests/test_internal_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import datetime
import re

import waffle
from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site
from django.core.urlresolvers import reverse
Expand Down Expand Up @@ -66,11 +67,18 @@ def test_internal_links(self):
translation.activate(settings.LANGUAGE_CODE)
visited_links = set()

test_pages = [reverse('main'), reverse('vote-list'),
reverse('bill-list'),
reverse('parties-members-list', kwargs={'pk': '1'})]
test_pages = [
# reverse('main'),
reverse('vote-list'),
reverse('bill-list'),
reverse('help'),
reverse('parties-members-list', kwargs={'pk': '1'})]

if waffle.switch_is_active('help_as_home_page'):
test_pages.pop(reverse('main'))

redirects = [
'/',
reverse('party-list'), reverse('member-list'),
]

Expand Down
3 changes: 2 additions & 1 deletion knesset/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
planet_views.post_detail = post_details

urlpatterns = patterns('',
url(r'^$', main, name='main'),
url(r'^main/$', main, name='main'),
url(r'^$', RedirectView.as_view(url='/help/')), #For now since main page is broken
(r'^topic/(?P<tail>(.*))', RedirectView.as_view(url='/committee/topic/%(tail)s')),
url(r'^about/$', AboutView.as_view(), name='about'),
(r'^robots\.txt$', RobotsView.as_view()),
Expand Down
136 changes: 81 additions & 55 deletions templates/help_page.he.html
Original file line number Diff line number Diff line change
@@ -1,78 +1,104 @@
{% extends "site_base.html" %}
{% load i18n i18ninclude mks_tags search avatar_tags %}
{% block description %}{% trans 'Open Knesset - Opening the Knesset to the public' %}. {% trans 'Non partisan, non commercial site that brings you relevant, detailed and accurate information about the knesset' %}{% endblock %}
{% load i18n i18ninclude mks_tags search avatar_tags waffle_tags %}
{% block description %}{% trans 'Open Knesset - Opening the Knesset to the public' %}.
{% trans 'Non partisan, non commercial site that brings you relevant, detailed and accurate information about the knesset' %}{% endblock %}
{% block extratitle %}מה אפשר לעשות באתר?{% endblock %}


{% block breadcrumbs %}
<li class="active">מה אפשר לעשות באתר?</li>
<li class="active">מה אפשר לעשות באתר?</li>
{% endblock %}

{% block divcontent %}
<div class="card card-main-party">
<div class="spacer">
<h1>מה אפשר לעשות באתר?</h1>
<p>ואנחנו כל הזמן עובדים על עוד...</p>
{% switch "help_as_home_page" %}
<div></div>
{% else %}
<div class="card card-main-party">
<div class="spacer">
<h1>מה אפשר לעשות באתר?</h1>
<p>ואנחנו כל הזמן עובדים על עוד...</p>
</div>
</div>
</div>
{% endswitch %}

<div class="row cards">
<div class="span6">
<div class="card card-list">
<a name="follow-members"></a>
<header><h2>לעקוב אחרי <a href="{% url 'bill-list' %}">הצעות חוק</a></h2></header>
<div class="row cards">
<div class="span6">
<div class="card card-list">
<a name="follow-members"></a>
<header><h2>לעקוב אחרי <a href="{% url 'bill-list' %}">הצעות חוק</a></h2></header>
<ul>
<li>
<p>וההתקדמות שלהן בתהליך החקיקה.</p>
<p> לדוגמה: <a href="{% url 'bill-detail' bill.id %}">{{ bill }}</a>.</p>
</li>
</ul>
</div>
</div>
{% switch "show_search_by_tags" %}
<div class="card card-list">
<a name="search-bills"></a>
<header><h2>לחפש <a href="{% url 'tags-list' %}">לפי נושא</a>, למשל</h2></header>
<ul>
{% for tag in tags %}
<li><a href="{% url 'tag-detail' tag %}">{{ tag }}</a></li>
{% endfor %}
</ul>
</div>
{% endswitch %}
<div class="card card-list">

<div class="card card-list">
<a name="search-bills"></a>
<header><h2>לחפש <a href="{% url 'tags-list' %}">לפי נושא</a>, למשל</h2></header>
<ul>
{% for tag in tags %}
<li><a href="{% url 'tag-detail' tag %}">{{ tag }}</a></li>
{% endfor %}
</ul>
</div>
{% include 'kikar/_facebook_status_sidbar_update_elem.html' %}
<div>
<header><h2>עדכוני פייסבוק של חברי וחברות הכנסת</h2></header>
<ul id="kikar-facebook-updates-ul">
</ul>
<footer style="text-align: center">
<span id="loading-statuses-symbol"><i class="fa fa-2x fa-spinner fa-spin"></i> </span>
<button id="statuses-more" class="btn btn-mini btn-expand-fb"
data-target="#kikar-facebook-updates-ul"
data-offset="0">{% trans "More Facebook Statuses" %} +
</button>
</footer>
</div>

</div>

<div class="span6">
<div class="card card-list">
<a name="follow-member-votes"></a>
<header><h2>מעקב הצבעות חבר כנסת</h2></header>
<ul>
<li>
<p>בכל אחת מה<a href="{% url 'vote-list' %}">הצבעות במליאת הכנסת</a>.</p>
<p>לדוגמה: <a href="{% url 'vote-detail' vote.id %}">{{ vote }}</a></p>
</li>
</ul>
</div>
</div>

<div class="card card-list">
<a name="members-data"></a>
<header><h2>נתונים על <a href="{% url 'member-list' %}">חברי הכנסת</a></h3></header>
<ul>
<li>
<p>קבלת מרב סטטיסטיקות על הפעילות הפרלמנטרית שלהם.</p>
<div>לדוגמה, הדף של {% mk_card member %}</div>
</li>
</ul>
</div>

<div class="card card-list">
<a name="protocols"></a>
<header><h2>לקרוא את הפרוטוקולים</h2></header>
<ul>
<li>
<p>של כל <a href="{% url 'committee-list' %}">וועדות הכנסת</a></p>
<p>(למעט ועדת חוץ ובטחון שהפרוטוקולים של ישיבותיה לא גלויים לציבור)</p>
</li>
</ul>
<div class="span6">
<div class="card card-list">
<a name="follow-member-votes"></a>
<header><h2>מעקב הצבעות חבר כנסת</h2></header>
<ul>
<li>
<p>בכל אחת מה<a href="{% url 'vote-list' %}">הצבעות במליאת הכנסת</a>.</p>
<p>לדוגמה: <a href="{% url 'vote-detail' vote.id %}">{{ vote }}</a></p>
</li>
</ul>
</div>

<div class="card card-list">
<a name="members-data"></a>
<header><h2>נתונים על <a href="{% url 'member-list' %}">חברי הכנסת</a></h3></header>
<ul>
<li>
<p>קבלת מרב סטטיסטיקות על הפעילות הפרלמנטרית של <a href="{% url 'member-list' %}">חברי הכנסת</a>.
והשוו בין פעילות <a href="{% url 'party-stats' 'seats' %}">הסיעות</a></p>
<div>לדוגמה, הדף של {% mk_card member %}</div>
</li>
</ul>
</div>

<div class="card card-list">
<a name="protocols"></a>
<header><h2>לקרוא את הפרוטוקולים</h2></header>
<ul>
<li>
<p>של כל <a href="{% url 'committee-list' %}">וועדות הכנסת</a></p>
<p>(למעט ועדת חוץ ובטחון שהפרוטוקולים של ישיבותיה לא גלויים לציבור)</p>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
{% endblock %}
4 changes: 3 additions & 1 deletion templates/main.he.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% extends "site_base.html" %}
{% block extrahead %}
<link rel="alternate" type="application/rss+xml" title="RSS" href="{% url 'main-actions-feed' %}"/> {% endblock %}
{% load i18n i18ninclude search %}{% load static from staticfiles %}
{% load i18n i18ninclude search waffle_tags %}{% load static from staticfiles %}
{% block description %}{% trans 'Open Knesset - Opening the Knesset to the public' %}.
{% trans 'Non partisan, non commercial site that brings you relevant, detailed and accurate information about the knesset' %}{% endblock %}
{% block extratitle %}{% trans 'Home' %}{% endblock %}
Expand Down Expand Up @@ -102,9 +102,11 @@ <h2>מה אפשר לעשות באתר?</h2>
<li>
<a href="{% url 'help' %}#follow-members">לעקוב אחרי הצעות חוק</a>
</li>
{% switch "show_search_by_tags" %}
<li>
<a href="{% url 'help' %}#search-bills">לחפש הצעות חוק לפי נושא</a>
</li>
{% endswitch %}
<li>
<a href="{% url 'help' %}#follow-member-votes">מעקב הצבעות חבר כנסת</a>
</li>
Expand Down
10 changes: 9 additions & 1 deletion templates/site_base.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>{% load i18n search avatar_tags feedback %}{% load static from staticfiles %}
<!DOCTYPE html>{% load i18n search avatar_tags feedback waffle_tags %}{% load static from staticfiles %}
<html lang="{{ LANGUAGE_CODE }}" dir="{{ LANGUAGE_BIDI|yesno:"rtl,ltr" }}" class="{{ LANGUAGE_BIDI|yesno:"rtl,ltr" }}">
<head>
<meta charset="utf-8">
Expand Down Expand Up @@ -115,7 +115,11 @@
<section class="container">
{% if not hide_crumbs %}
<ul class="breadcrumb">
{% switch "help_as_home_page" %}
<li><a class="home-icon" href="{% url 'help' %}">{% trans "Homepage" %}</a> <span class="divider">/</span>
{% else %}
<li><a class="home-icon" href="{% url 'main' %}">{% trans "Homepage" %}</a> <span class="divider">/</span>
{% endswitch %}
</li>
{% block breadcrumbs %}{% endblock %}
</ul>
Expand Down Expand Up @@ -171,7 +175,11 @@
<div class="row">
<nav class="span8">
<ul class="nav nav-pills">
{% switch "help_as_home_page" %}
<li><a class="home-icon" href="{% url 'help' %}">{% trans "Homepage" %}</a></li>
{% else %}
<li><a class="home-icon" href="{% url 'main' %}">{% trans "Homepage" %}</a></li>
{% endswitch %}
<li><a href="{% url 'party-list' %}">{% trans "Members and Parties" %}</a></li>
<li><a href="{% url 'bill-list' %}">{% trans "Legislation" %}</a></li>
<li><a href="{% url 'committee-list' %}">{% trans 'Committees' %}</a></li>
Expand Down

0 comments on commit 28ffc78

Please sign in to comment.