diff --git a/pgweb/core/views.py b/pgweb/core/views.py index 6f71ca5e..336b8279 100644 --- a/pgweb/core/views.py +++ b/pgweb/core/views.py @@ -40,19 +40,16 @@ from forms import OrganisationForm, MergeOrgsForm # Front page view @cache(minutes=10) def home(request): - news = NewsArticle.objects.filter(approved=True)[:10] - # get the first seven events and divide each up into a list of community and other events - event_queryset = Event.objects.select_related('country').filter(approved=True, training=False, enddate__gte=date.today()).order_by('enddate', 'startdate') - # display up to the first 4 community events. Then choose the next 7 - |communty_events| - community_events = [event for event in event_queryset.filter(badged=True).all()[:4]] - other_events = [event for event in event_queryset.filter(badged=False).all()[:(7-len(community_events))]] - try: - quote = Quote.objects.filter(approved=True).order_by('?')[0] - except: - # if there is no quote available, just ignore error - quote = None + news = NewsArticle.objects.filter(approved=True)[:5] + # get the first five community events + events = Event.objects.select_related('country').filter( + approved=True, + training=False, + enddate__gte=date.today(), + badged=True, + ).order_by('enddate', 'startdate')[:5] versions = Version.objects.filter(supported=True) - planet = ImportedRSSItem.objects.filter(feed__internalname="planet").order_by("-posttime")[:10] + planet = ImportedRSSItem.objects.filter(feed__internalname="planet").order_by("-posttime")[:9] traininginfo = Event.objects.filter(approved=True, training=True).extra(where=("startdate <= (CURRENT_DATE + '6 Months'::interval) AND enddate >= CURRENT_DATE",)).aggregate(Count('id'), Count('country', distinct=True)) # can't figure out how to make django do this @@ -64,11 +61,9 @@ def home(request): 'title': 'The world\'s most advanced open source database', 'news': news, 'newstags': NewsTag.objects.all(), - 'community_events': community_events, - 'other_events': other_events, + 'events': events, 'traininginfo': traininginfo, 'trainingcompanies': trainingcompanies, - 'quote': quote, 'versions': versions, 'planet': planet, }) diff --git a/templates/index.html b/templates/index.html index 9faacc0e..7b0e417d 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,216 +1,213 @@ {%extends "base/base.html" %} +{% load pgfilters %} {%block title%}The world's most advanced open source database{%endblock%} {%block meta%} {%endblock%} {%block layoutblock%} -
-
-
-
+
+
+

PostgreSQL: The World's Most Advanced open source relational database

+ +
+
+ +
+ -

1st March 2018

+
+ +
+ PostgreSQL Elephant Logo +

New to PostgreSQL?

+
+

+ PostgreSQL is a powerful, open source object-relational database system with over 30 years of active development + that has earned it a strong reputation for reliability, feature robustness, and performance. +

+

+ There is a wealth of information to be found describing how to install and use PostgreSQL through the official documentation. + The PostgreSQL community provides many helpful places to become familiar with the technology, discover how it works, and find + career opportunities. Reach out to the community here. +

+
+ +
+ -

- PostgreSQL 10.3 Released! -

-

- The PostgreSQL Global Development Group has released an update to all supported versions of our database system, including 10.3, 9.6.8, 9.5.12, 9.4.17, and 9.3.22. -

-

- This release centers around added documentation that describes CVE-2018-1058 and how to take steps to mitigate the impact on PostgreSQL databases. There are also several bug fixes included in the release. All users using the affected versions of PostgreSQL should update as soon as possible. -

+ +
+ +

Latest Releases

+
+

+ 2018-03-01 - PostgreSQL 10.3 Released! + The PostgreSQL Global Development Group has released an update to all supported versions of our database system, including 10.3, 9.6.8, 9.5.12, 9.4.17, and 9.3.22. +

+
    + {% for v in versions %} +
  • {{ v.numtree }}.{{ v.latestminor }} · {{ v.reldate|date:"Y-m-d" }} · Notes
  • + {% endfor %} +
+
+ +
+ - +
+ + +
+ +
+ +

Upcoming Community Events

+
+
    + {% for event in events %} +
  • + {% if event.badged %} + PostgreSQL Community Event + {% endif %} + {{ event.displaydate|safe }} · {{ event.title }} +
  • + {% endfor %} +
+

+ PostgreSQL Community Event + indicates that an event is recognised under the community event guidelines and is directly helping the PostgreSQL community. +

+
+ +
+ + +
+ +

Mailing Lists

+
+

+ The PostgreSQL mailing lists enable you to interact with active community participants on subjects related to the development of PostgreSQL, discovering how to use PostgreSQL, or learning about upcoming events and product releases. +

+

+ In order to manage your mailing list subscription, you need a PostgreSQL community account. Signing up is easy and gives you direct access to the global PostgreSQL community. +

+
+ +
+ +
+ +
+ +
+
+
+
+

Learning Opportunities Ahead

+

+ Want to learn more about PostgreSQL and help build the community? Come to one of the many events, local user groups, & training sessions where you can meet experienced PostgreSQL users and enhance your database skills. +

+ + +
+
+
+ + +
+
+
+

Latest News

+ +
+

PostgreSQL 10.3 Released!

+
    +
  •  2018-03-01
  • + +
+
+

+ The PostgreSQL Global Development Group has released an update to all supported versions of our database system, including 10.3, 9.6.8, 9.5.12, 9.4.17, and 9.3.22. +

+

+ This release centers around added documentation that describes CVE-2018-1058 and how to take steps to mitigate the impact on PostgreSQL databases. There are also + several bug fixes included in the release. All users using the affected versions of PostgreSQL should update as soon as possible. +

+ + +
+
+ -
-
-
-
-
-

>  Featured User

-
-
{{quote.quote}}
-
{{quote.who}}, {{quote.org}}
- -
-
-
-
-
-
-
-
-
-

>  Latest Releases

-
- {%for v in versions %} - {{v.numtree}}.{{v.latestminor}} · {{v.reldate}} · Notes -
- {%endfor%} -
- -
-
-

>  Shortcuts

-
-
-
-
-

>  Support Us

-
-
- PostgreSQL is free. Please support our work by making a donation. -
-
-
-
-
-
-

- >  - News -

-
- {% for n in news %} -

- {{n.displaydate}}
- {{n.title}} -

- {% endfor %} -
- - -
-
-
-
-

- >  - Planet PostgreSQL -

-
- {%for post in planet%} -

- {{post.date}}
- {{post.title}} -

- {%endfor%} -
- -
    -
  • - More -
  • -
  • - PlanetPostgreSQL RSS Feed -
  • -
-
-
-
-
- {% if community_events %} -

- >  - Community Events -

-
- {% for e in community_events %} -

- {{e.displaydate|safe}}
- {{e.title}}
({{e.locationstring}}) -

- {% endfor %} -
- {% endif %} -

- >  - {% if community_events %}Other {% endif %}Events -

-
- {% for e in other_events %} -

- {{e.displaydate|safe}}
- {{e.title}}
({{e.locationstring}}) -

- {% endfor %} -
-
- - -
-

- >  - TRAINING -

-
-
- {%if traininginfo.id__count %} - There are {{traininginfo.id__count}} training events in {{traininginfo.country__count}} countries - scheduled over the next six months from - {%if trainingcompanies|length_is:"1"%}{{trainingcompanies|first}}. - {%else%} - {%if trainingcompanies|length_is:"2"%}{{trainingcompanies|join:" and "}}. - {%else%} - {{trainingcompanies|slice:":2"|join:", "}} and others. - {%endif%} - {%endif%} -

Take a look at our schedule to find the training that you want.

- {%else%} - There are no training events currently scheduled. - {%endif%} -
-
-
-
+ + {% endfor %} + + +
+
+
+
+ +
+
+
+

PLANET POSTGRESQL

+
+
+
+ +
+ + {%for post in planet %} +
+
+

{{ post|planet_title }}

+
    +
  •  {{ post|planet_author }}
  • +
  •  {{ post.date }}
  • +
+
+
+ {% endfor %} +
+ +
+ +
+
+ +
+
+
+

Seeing unexpected behavior?

+

+ The PostgreSQL community takes pride in releasing software that will reliably store your data. If you believe you've discovered a bug, please click the button below and follow the instructions on how to submit a bug. +

+ +
+
+
+
+ {%endblock%}