# HG changeset patch # User souliane # Date 1422379419 -3600 # Node ID d2c45f4ba57e2cc86b2800bc15dd446b07cfdc7e # Parent e501f5ff7191deb9d21fc37b6e801a546dca7fe4 add downloads.html diff -r e501f5ff7191 -r d2c45f4ba57e README --- a/README Tue Jan 27 12:17:09 2015 +0100 +++ b/README Tue Jan 27 18:23:39 2015 +0100 @@ -35,31 +35,30 @@ The following values can be set in site's settings.py: - # this link should point to a SàT archive in the form sat-version.tar.bz2 - SAT_LINK_PATH = '/path/to/sat_link.tar.bz2' + # External URL pointing the projects archives directory + PROJECTS_EXTERNAL_PATH = 'ftp://ftp.goffi.org' + + # Internal path to the projects archives directory + PROJECTS_INTERNAL_PATH = '/var/www/projects' - # this prefix will be joined to the filename pointed by the previous link - SAT_DL_PREFIX = 'ftp://ftp.goffi.org/sat' + # List of couples with the project directory name and the project name (set to None if it's the same) + PROJECTS_NAMES = [('sat', None), ('sat_media', None), ('urwid-satext', 'urwid_satext'), ('sat_pubsub', None), ('libervia', None)] - # if set, this link will be used instead of the joined dl_prefix + filename - SAT_DL_PATH = 'ftp://ftp.goffi.org/sat/sat.tar.bz2' + # Extension used to name the project archives + ARCHIVE_SUFFIX = '.tar.bz2' # URL to Libervia online demo LIBERVIA_DEMO_URL = 'https://www.libervia.org' - # Actual number of members + # Actual and target number of members ASSO_MEMBERS_ACTUAL = 3400 - - # Target number of members ASSO_MEMBERS_TARGET = 6000 - # Available amount to finance the association (in euros) + # Actual and target amount to finance the association (in euros) ASSO_FINANCE_ACTUAL = 40000 - - # Target amount to finance the association (in euros) ASSO_FINANCE_TARGET = 60000 - # Subscription amounts defined in the Rules of Procedure + # Subscription amounts as defined in the Rules of Procedure ASSO_SUBSCR_AMOUNTS = (0, 10, 20, 30, 50, 80, 100) diff -r e501f5ff7191 -r d2c45f4ba57e sat_website/local_settings.py --- a/sat_website/local_settings.py Tue Jan 27 12:17:09 2015 +0100 +++ b/sat_website/local_settings.py Tue Jan 27 18:23:39 2015 +0100 @@ -97,13 +97,28 @@ # Options for SàT website (see README) -SAT_LINK_PATH = '/srv/ftp/sat/sat.tar.bz2' -SAT_DL_PREFIX = 'ftp://ftp.goffi.org/sat' -#SAT_DL_PATH = 'ftp://ftp.goffi.org/sat/sat.tar.bz2' +# External URL pointing the projects archives directory +PROJECTS_EXTERNAL_PATH = 'ftp://ftp.goffi.org' + +# Internal path to the the projects archives directory +PROJECTS_INTERNAL_PATH = '/var/www/projects' + +# List of couples with the project directory name and the project name (set to None if it's the same) +PROJECTS_NAMES = [('sat', None), ('sat_media', None), ('urwid-satext', 'urwid_satext'), ('sat_pubsub', None), ('libervia', None)] + +# Extension used to name the project archives +ARCHIVE_SUFFIX = '.tar.bz2' + +# URL to Libervia online demo LIBERVIA_DEMO_URL = 'https://www.libervia.org' +# Actual and target number of members ASSO_MEMBERS_ACTUAL = 3400 ASSO_MEMBERS_TARGET = 6000 -ASSO_FINANCE_ACTUAL = 34000 + +# Actual and target amount to finance the association (in euros) +ASSO_FINANCE_ACTUAL = 40000 ASSO_FINANCE_TARGET = 60000 + +# Subscription amounts as defined in the Rules of Procedure ASSO_SUBSCR_AMOUNTS = (0, 10, 20, 30, 50, 80, 100) diff -r e501f5ff7191 -r d2c45f4ba57e sat_website/utils.py --- a/sat_website/utils.py Tue Jan 27 12:17:09 2015 +0100 +++ b/sat_website/utils.py Tue Jan 27 18:23:39 2015 +0100 @@ -20,24 +20,33 @@ along with Foobar. If not, see . """ -from os.path import basename,realpath,join +from os.path import basename, realpath, join from django.conf import settings +from collections import OrderedDict + + +def get_projects_infos(infos): + """Return a dict binding project names to a tuple containing: + - the external download path + - the version number + - a short description about the project archive + + @param infos: dict binding project names to a short description -def get_latest_sat(): - """Return a tuple with download path of latest SàT version, and version number""" - try: - path = settings.SAT_LINK_PATH - real_path = realpath(path) - filename = basename(real_path) - version = filename[4:-8] #filename must be in the form of sat-version.tar.bz2 - if hasattr(settings, "SAT_DL_PATH"): - dl_path = settings.SAT_DL_PATH - else: - dl_path = join(settings.SAT_DL_PREFIX, filename) - except AttributeError: - return (None, None) - - return (dl_path, version) + @return: dict {unicode: (unicode, unicode, unicode) + """ + result = OrderedDict() + for dir, name in settings.PROJECTS_NAMES: + if not name: + name = dir + path = join(dir, name) + settings.ARCHIVE_SUFFIX # e.g urwid-satext/urwid_satext.tar.bz2 + int_path = join(settings.PROJECTS_INTERNAL_PATH, path) # this is a symbolic link + # base name of the real path MUST look like: - + version = basename(realpath(int_path))[len(name) + 1:-len(settings.ARCHIVE_SUFFIX)] + ext_path = join(settings.PROJECTS_EXTERNAL_PATH, path) + result[name] = (ext_path, version, infos[name] if name in infos else '') + + return result def get_libervia_demo_url(): """Return the URL to Libervia online demo""" diff -r e501f5ff7191 -r d2c45f4ba57e sat_website/views.py --- a/sat_website/views.py Tue Jan 27 12:17:09 2015 +0100 +++ b/sat_website/views.py Tue Jan 27 18:23:39 2015 +0100 @@ -53,6 +53,12 @@ CATEGORIES_HIDDEN = ('adhesion_form', 'thank_you') +PROJECTS_INFOS = {'sat': _(u'contains the backend, Primitivus and Jp'), + 'sat_media': _(u'Images and other media needed to launch SàT'), + 'urwid_satext': _(u'console display library needed by Primitivus'), + 'sat_pubsub': _(u'PubSub server component needed for SàT experimental blogging features'), + 'libervia': _(u'Libervia frontend (web server and client)'), + } def overview(request): return render_to_response('sat_website/overview.html') @@ -79,9 +85,7 @@ elif category == "social_contract": context["SOCIAL_CONTRACT"] = social_contract.get_social_contract() elif category == "downloads": - latest_dl_path, latest_version = utils.get_latest_sat() - context["latest_dl_path"] = latest_dl_path - context["latest_version"] = latest_version + context["projects_infos"] = utils.get_projects_infos(PROJECTS_INFOS) elif category == "adhesion": context.update(utils.get_asso_finance_status()) elif category == "adhesion_form": diff -r e501f5ff7191 -r d2c45f4ba57e templates/sat_website/downloads.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/sat_website/downloads.html Tue Jan 27 18:23:39 2015 +0100 @@ -0,0 +1,73 @@ +{% extends "sat_website/category.html" %} + +{% comment %} +SàT website: Salut à Toi's presentation website +Copyright (C) 2012 Jérôme Poisson (goffi@goffi.org) + +This file is part of SàT website. + +SàT website is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Foobar is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with Foobar. If not, see . +{% endcomment %} + +{% load i18n %} +{% load staticfiles %} +{% load utils %} + +{% block headline %}{% trans "Downloads" %}{% endblock %} +{% block subtext %}{% trans "The archives containing the source code" %}{% endblock %} +{% block main_container %} + +
+
+ {% trans "Information" %} +
+
+

{% trans "This page allows you to download SàT and its related projects source code. There is not (yet) an installer to double click to make it work out of the box." %}

+

{% trans "We are thinking about a way to allow everybody to easily install SàT at home, but for now it will seem difficult to the persons who are not familiar with GNU/Linux operating systems. For the Windows and MacOS users, the best way to test SàT for now is to visit our demonstration website running Libervia." %}

+

{% trans "Libervia demo" %}

+
+
+
+
+ {% trans "Latest development versions" %} +
+
+ {% for project, infos in projects_infos.items %} + +
+ {{ infos.2 }} +
+ {% endfor %} +
+
+

{% trans "When not trivial (e.g. sat_media just needs to be extracted somewhere), the installation procedure is described in the INSTALL file that you will find in the package." %}

+
+
+
+
+ {% trans "Other sources of installation" %} +
+
+

{% trans "To ease the procedure, you can also install the last SàT packages from PyPI, the Python Package Index." %}

+

{% trans "Visit PyPI" %}

+

{% trans "Thanks to the maintainers of SàT packages, you might even find some really easy to install packages in your distribution repositories!" %}

+

{% trans "Packages in Debian sid" %}

+

{% trans "Some complementary information are given on the wiki." %}

+

{% trans "Visit the wiki" %}

+

+
+
+{% endblock %}