Coder Social home page Coder Social logo

cshc / cshc-web Goto Github PK

View Code? Open in Web Editor NEW
2.0 7.0 1.0 74.41 MB

The 3rd version of the Cambridge South Hockey Club website

Home Page: http://cshc.readthedocs.io/en/latest/index.html

JavaScript 25.63% Python 43.16% HTML 26.33% CSS 4.27% Shell 0.02% SCSS 0.59%

cshc-web's Introduction

Cambridge South Hockey Club

This repository contains the source code for the Cambridge South Hockey Club website.

Full documentation (work-in-progress) can be found here: cshc.readthedocs.io

Migrating Database from Production to Local Env

  1. On the EC2 instance:
mysqldump --skip-extended-insert --compact --default-character-set=utf8 cshc > dump_mysql.sql
  1. Download the dump_mysql.sql file to your local machine.

  2. Download the mysql2sqlite script from here

  3. Run the script to create a new sqlite database file from the MySQL export:

./mysql2sqlite dump_mysql.sql | sqlite3 db.sqlite3
  1. Replace the existing src/db.sqlite3 file with the one created in the previous step.

  2. Copy the media files from production to the local dev environment. Note this also copies them to the (unused) staging bucket.

python manage.py media_copy --local

cshc-web's People

Contributors

cshc-webmaster avatar drrobbarton avatar grahammcculloch avatar taproot-xx avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

wahello

cshc-web's Issues

JSON contains a quote or escape sequence that was unable to be stripped

Happens in multiple pages where we pass the match report body in the window.props.

E.g. found in /matches/2625/edit/


Template error:
In template C:\cshcV3\cshc-web\src\cshc\templates\react\react_js.html, error at line 23
   JSON contains a quote or escape sequence that was unable to be stripped
   13 :     clubteam_detail: "{% url 'clubteam_detail' 'slug' %}",
   14 :     opposition_club_detail: "{% url 'opposition_club_detail' 'slug' %}",
   15 :     match_list: "{% url 'match_list' %}",
   16 :     about_committee: "{% url 'about_committee' %}",
   17 :     about_committee_season: "{% url 'about_committee_season' 'slug' %}",
   18 :     eos_award_winners: "{% url 'end_of_season_award_winners_list' %}",
   19 :   };
   20 :   
   21 :   window.CSHC_VERSION = '{{ VERSION }}';
   22 :   window.STATIC_URL = '{{ STATIC_URL }}';
   23 :   window.props =  {{ props|json }} ;
   24 :   window.gmapsApiKey = "{{ GMAPS_API_KEY }}";
   25 :   window.react_mount = document.getElementById('react-app');
   26 : </script>
   27 : {% render_bundle 'common' 'js' %}
   28 : {% render_bundle bundle_name 'js' %}


Traceback:

File "C:\cshcV3\cshc-web\src\core\templatetags\cshc_tags.py" in json
  164.         jsonlib.loads(clean)

File "c:\python36\Lib\json\__init__.py" in loads
  354.         return _default_decoder.decode(s)

File "c:\python36\Lib\json\decoder.py" in decode
  339.         obj, end = self.raw_decode(s, idx=_w(s, 0).end())

File "c:\python36\Lib\json\decoder.py" in raw_decode
  355.             obj, end = self.scan_once(s, idx)

During handling of the above exception (Expecting ',' delimiter: line 1 column 6050 (char 6049)),

Don't lose contact form data if submitted and not valid

Currently if you submit the Contact Us form and its missing a field the page is refreshed with error messages - but the form data is reset. This is a poor UX! Need to initialize the form data from the context in the Django template.

Also applies to Juniors contact form.

Mens and Ladies Vets and Indoor teams

Currently we just have a Mens Vets and a Mens Indoor team - and they're not described in the code or UI as particularly gender-specific.

Need to add a Ladies Vets and Ladies Indoor team and make the references to the Mens Vets and Indoor teams male-specific.

Better images for Match Details background image

Need to use:

  • Men's playing image for Men's matches
  • Ladies playing image for Ladies matches
  • Indoor playing image for Indoor matches
  • (Ideally) Mixed playing image for Mixed matches

Also:

  • Smaller image for use on mobile view

Duplicate appearances can be selected on Match Edit page

To reproduce: click twice in quick succession on a player to add them to the list of appearances. This is possible because of the animation which means the component isn't removed immediately.

Need to disable the click action after the first click.

Venues List page filtering is broken

To reproduce: select a division from the Division Select filter. Venues are duplicated and the selected division is not displayed in the Select element.

Add support for browser caching for S3 static files

e.g.

AWS_S3_OBJECT_PARAMETERS = {
    'CacheControl': 'max-age=86400',
}

Note: Ideally we'd add a version number as a URL parameter on the urls (of non-compressed only) static files (e.g. ?version={{ VERSION }}). However, sorl-thumbnail caching ignores the URL parameter so the thumbnail is not regenerated.

The sub-optimal solution for image files therefore is to rename them when they are changed.

Show additional member details if authenticated user has correct permissions

If the authenticated user has the view_personal_data permission set...

  • show member's address in the Google Map InfoWindow?
  • show member's address and other personal details (emergency contact, medical etc) on their Member Details page?

Note: this info is visible on the Admin interface for anyone with permission to view members (e.g. captains, committee members etc). Maybe this should be restricted as well on the admin interface?

GDPR review

Ref: https://westaway.co/gdpr/

Need to provide contact info, explain what we use the info for etc.

Make sure T&Cs checkbox is linked on sign up form (add to Test Plan).

Feature request: Centurions stats page

From Neil:

I see that the new Members’ Playing Records page allows you to sort players by total appearances - helpful for determining who qualifies for the Centurions’ Dinner. However, for the dinner I have a slight variance to the criteria, in that I only count regulation outdoor matches - indoor games, being shorter time and not comparable, are excluded. Could we add a Centurions’ page to the stats section, showing players by outdoor appearances (with a note to explain that only appearances in full-length outdoor fixtures, as at the end of each season, are counted), and maybe also everyone who’s reached 75 caps - potentially within a season of qualifying. If you wanted to be clever, the list could exclude anyone who’s reached 75 appearances but whose status is not ‘current’.

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.