Giter Club home page Giter Club logo

digihel's Introduction

Digital Helsinki CMS

Build status codecov Requirements Stories in Ready

This Wagtail-based CMS powers the Digital Helsinki website.

Installation

Set the DEBUG environment variable to 1

export DEBUG=1

Install required Python packages

(sudo) pip install -r requirements.txt

Create the database

sudo -u postgres createuser digihel
sudo -u postgres createdb -O digihel digihel

Install node dependencies

npm install

Install bower components

./manage.py bower install

If you have acquired a database dump, install it this way:

tar xvjf digihel-backup.tar.bz2
pg_restore -d digihel digihel.sql
echo "delete from wagtailimages_rendition;" | ./manage.py dbshell

Requirements

This project uses two files for requirements. The workflow is as follows.

requirements.txt is not edited manually, but is generated with pip-compile.

requirements.txt always contains fully tested, pinned versions of the requirements. requirements.in contains the primary, unpinned requirements of the project without their dependencies.

In production, deployments should always use requirements.txt and the versions pinned therein. In development, new virtualenvs and development environments should also be initialised using requirements.txt. pip-sync will synchronize the active virtualenv to match exactly the packages in requirements.txt.

In development and testing, to update to the latest versions of requirements, use the command pip-compile. You can use requires.io to monitor the pinned versions for updates.

To remove a dependency, remove it from requirements.in, run pip-compile and then pip-sync. If everything works as expected, commit the changes.

Configuration

These settings are recognized in the Django settings.

You can acquire the Twitter keys from the Twitter developer portal (https://apps.twitter.com).

  • TWITTER_CONSUMER_KEY: "Consumer Key (API Key)"
  • TWITTER_CONSUMER_SECRET: "Consumer Secret (API Secret)"
  • TWITTER_ACCESS_TOKEN: A personal (read-only) access token
  • TWITTER_ACCESS_TOKEN_SECRET: The secret for the personal (read-only) access token

Docker

Currently the development environment has been dockerized.

Configurations

Configure the following settings to local_settings.py:

DEBUG = True

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'postgres',
        'USER': 'postgres',
        'PASSWORD': 'postgres',
        'HOST': 'db',
        'PORT': '5432',
    }
}

Daily running

  • Run docker-compose up
  • Run docker-compose exec web python3 manage.py migrate
  • Run docker-compose exec web python3 manage.py compilemessages

digihel's People

Contributors

akx avatar hkotkanen avatar hukka avatar jukvalim avatar jussiarpalahti avatar juyrjola avatar rikuoja avatar terotik avatar tituomin avatar vikoivun avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

digihel's Issues

Create a page for each Glossy category.

Each glossy (issue #39) glossary category should generate a page that lists all its terms. When a term is referred from the content on other pages this referral should link to this category page, to the linked term's anchor.

It should be possible to move category page to any location in the site tree structure.

Add caption field in content images

Markup produced for images placed in content should be as follows:

<figure>
  <img src="imageurlhere.jpg" alt="alt text here">
  <figcaption>Caption text here. Should be able to contain <a href="#">HTML</a>.</figcaption>
</figure>

Two-column blocks fail in some cases

Steps to reproduce:

  1. Tee kaksipalstainen blokki sivulle.
  2. Laita molempien palstojen sisällöksi paragraph.
  3. Laita molempiin otsikko H3:lla, tee rivinvaihdot shift-enterillä ja sitten varsinainen sisältö H5:llä.
  4. Koita tallentaa.

Map view for location aware pages

City guide shows location aware Wagtail pages on a map and displays information about them when selected.

Features include:

  • show a map using configurable center, extent and zoom and map size on page
  • inside pages' markers write a number corresponding to their Wagtail given order (that's set in the admin)
  • when clicked show a modal of page's content
  • in modal these fields are shown:
    • image
    • description
  • modal should close by clicking on its close button and anywhere on the map (if visible)
  • modal should be responsive to browser viewport
    • if space allows open modal beside clicked object and it should be fully visible
    • if space is limited, ex. on mobile, take over the screen but leave map partially visible between screen's and modal's borders

Do not show draft content

Check published-status before displaying content on templates. At least in theme-index-page unpublished content is visible.

Feedback broken since version update

Culprit possibly this DRF change?

("Creating a ModelSerializer without either the 'fields' attribute 
or the 'exclude' attribute has been deprecated since 3.3.0, and 
is now disallowed. Add an explicit fields = '__all__' to the 
FeedbackSerializer serializer.",)

Language versions of the site (SE + EN)

Two options:

  • Separate sites for languages
  • Translatable content

Translatable content would be much better, as we might want to display untranslated content with the original language (toteutukset) on all language versions.

Add a "glossary" system for term management

  • add a model for Term Categories (these group Terms, below)
  • add a model for Term (has a reference to a Category, a name, a rich text (HTML) description, and a "show in lists" boolean field)
  • add admin for the above
  • make it possible to refer to Terms from within HTML content (#7)
  • make it possible to add a Wagtail Block that lists all list-visible terms in a given Category ("definition list") (#37)

TOC crashes if H2-tag has other tags inside

If content has <h2><br/>Tärkeimmät tehtävät</h2> then content/templatetags/content_tags.py throws error:

AttributeError: 'NoneType' object has no attribute 'strip'

139.           if not t.string.strip():

Some user accounts can not publish content

Even though they are given admin rights.
Currently publishing with user account 58 gives 500:
ValidationError: {'author': ['user-tietuetta id-kentällä 58 ei ole olemassa.']}

Hero image scaling

Use cropped image for mobile layout. Use Wagtail focal point feature to enhance cropping.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.