Skip to content
This repository was archived by the owner on Apr 12, 2018. It is now read-only.

Content Management System

Simão Belchior edited this page Jul 18, 2017 · 2 revisions

The website includes a custom made Content Management System that can be accessed under the http://www.grida.no/manage URL. Only users with Admin accounts can login to the back-office. A simple to use role based system is in place to ensure some hierarchy in the management of the website’s content:

  • Contributor: can add new content to the website, but can’t make it public;
  • Publisher: can add new content to the website and can publish it;
  • Admin: can add new content, publish it and manage users.

Authorization features are managed with the ruby gem CanCanCan. The back-office is maintained inside a Rails Engine that can be found on the backend folder inside the root of the code repository.

Database

The website uses a PostgreSQL database and has a simple to understand structure. By maintaining foreign keys on the database as well as relationships on the Ruby on Rails models it is possible to generate a database diagram to help understand the relationships between the different models on the application.

Key Entities

Content Type

Content type provide the means to organize Activities and Publications through the use of specific categories that can be easily managed. One key content type is Programme which is available for Activities. Activities of this type represent the thematic programmes of GRID-Arendal and allow grouping of other activities under them.

Activities

Represent GRID Arendal’s past and current activities as well as their thematic Programmes. Are viewable on the public interface under the Activities page. Activities can be related to other types of content: Publications, News, Staff, and Resources. Besides the related staff Activities can also have an assigned Lead Staff.

Publications

Publications refer to the published documents, atlas, ebooks, etc. Like Activities publications can be related to other types of content: Activities, News, Staff and Resources. They can also have a Lead Staff member associated. Content managers can add different files to each publication, making them available on the public interface. Publications are also a core type of content and can be found under the Publications page on the public interface.

Resources (Albums, Photos, Graphics, Collections, Video, VideoCollections)

Albums represent Flickr picture albums, and can include multiple Photo, which represent individual Flickr pictures. Similarly Collection represent Flickr albums that are composed of graphics instead of pictures. Collections include multiple Graphics, which represent the graphics kept in Flickr. VideoCollection allow the grouping of Video when relevant, though are not related to any external entity of that type. Videos represent Youtube or Vimeo videos, but are not automatically fetch, and need to be created individually.

There are some fields of the MediaContent that are not maintainable on the CMS due to their linkage to the original source. This is the case of description, author, and license for Photos and Graphics, and description, and author for Albums and Collections.

These resources are available from the public interface on the Resources page.

About Section

This type of content power GRID-Arendal’s About page. Any new About Section object that is created will be rendered on the about page. Each of the sections is rendered in the order in which they are visible on the back office. The order can be changed by dragging and dropping the sections. Some of the about sections will render dynamic content, for this ones a category needs to be specified. In the current version of the application the available categories are:

  • Annual-reports: renders publications that have the content type Annual Report;
  • Board: renders staff members that are part of the Board of Directors of GRID-Arendal;
  • Contact-us: appends extra information to the hard coded contact us details;
  • Honorary-affiliate: staff members marked as honorary affiliates will be listed on this section. The section will not render if there are no active honorary affiliates;
  • Programmes: renders the Activities that have content type Programme;
  • Staff: renders the list of all the staff members;
  • Vacancies: displays the list of available vacancies. Won’t display if there are no vacancies active.

Site Section

This entity allows managing the title, description, social media picture and social media description of each of the key sections of the public interface. Current available sections are:

  • Home: for the home page;
  • Activities: page with list of activities;
  • Publications: page with the list of publications;
  • News: page with the list of news;
  • Media_library: resources page;
  • About: the about page of the website.

Event

When GRID-Arendal wants to promote any event they can do so by creating an object of this type and marking it as active. When there is an event active there will be a modal window displayed on the home page of the website inviting users to learn more about the event. If the user dismisses this modal window the event will cease to show during their browser session.

Single Table Inheritance

To reduce code duplication and to make the model structure more organized Single Table Inheritance is used in two places on this application.

Activities and Publications

Both inherit from the Content model, as they share most fields. Main differences between these two entities in terms of their attributes are:

  • Publications have content_date;
  • Publications have a cover picture;
  • Activities are directly linked to programme (effectively linking Activities to other Activities of type Programme);
  • Activities have a project number.

Album, Photo, Graphic, Collection, Video, VideoCollection

All of these models inherit from the MediaContent model, as they share most of the basic fields between them, and they are displayed similarly on the public interface under the Resources menu. By keeping them under the same parent model we reduced duplication and allowed for easier querying and handling of their data.