GithubHelp home page GithubHelp logo

acecentre / aacnews Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 3.0 1.81 MB

This is a small nodejs based app that manages public submissions of short news items that then gets published using a mailchimp campaign. An example of this is AACNews Monthly, managed by the Ace Centre.

Home Page: https://aacinfo.email

CSS 43.90% HTML 28.65% JavaScript 27.45%
email email-sender mailchimp-campaign monthlies newsletter

aacnews's People

Contributors

lemol avatar pcocko avatar willwade avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aacnews's Issues

Promoted not working

Not sure the promoted flag is doing anything. Should raise it to top of that section and put a label of "promoted" after author

e.g. something like:

screen shot 2016-11-23 at 10 33 02

flask-flatpages

flask-flatpages is required for non-dynamic pages (e.g. privacy). A general route needs to be defined to first look for a defined route, then look for the template (flat pages) and lastly a 401 error.

regex for twitter needs updating

if space in twitter then break the link.. e.g.:

@willwade (via Ian Hamilton on the games access list)

currently gets a href wrapping the whole line. It needs to break before the space (i.e. after willwade)

headers sent exception

Not sure why this happens:

A new exception has been thrown
Server: lisa
Application: aacinfo
Message:
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:690:11)
at ServerResponse.res.set.res.header (/srv/aacinfo/node_modules/express/lib/response.js:530:10)
at ServerResponse.res.json (/srv/aacinfo/node_modules/express/lib/response.js:190:36)
at /srv/aacinfo/controllers/posts.js:140:13
at /srv/aacinfo/node_modules/mongoose/lib/query.js:2313:18
at tryCatcher (/srv/aacinfo/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:510:31)
at Promise._settlePromise (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:567:18)
at Promise._settlePromise0 (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:612:10)
at Promise._settlePromises (/srv/aacinfo/node_modules/bluebird/js/release/promise.js:691:18)
at Async._drainQueue (/srv/aacinfo/node_modules/bluebird/js/release/async.js:138:16)
at Async._drainQueues (/srv/aacinfo/node_modules/bluebird/js/release/async.js:148:10)
at Async.drainQueues (/srv/aacinfo/node_modules/bluebird/js/release/async.js:17:14)
at process._tickDomainCallback (node.js:492:13)

need an indicator of number of reposts

In admin/posts screen we need a small indicator showing how many times the link and domain has been submitted. E.g.

Title. Short text. Link. (N reposts. X links on domain.com).

A row is coloured in the table. No colour if n = 0. Greater n the deeper colour the shading of the row. (Eg red).

posts dropdown stops appearing

No error log I can find for this.. But occasionally I get a call to say the posts screen doesn't work. (i.e. /posts )
In particular the dropdown isn't populating.

No idea why.. But restarting app fixes it.

Multiple users / Editorial interface

Need to think about this a bit more but putting this down for reference.

Need:

  • A member of staff to edit and choose items to publish (Admin)
  • Prepare the email.
  • A member of staff goes in and proof reads this final prepared email and edits it.

So... Need some, easy to use way of editing this finally edited newsletter.
Ideally final edits from this editor would have a version history

Needs some thought!

Slack integration

So we are starting to play with Slack

We need a /post-slack route. Data would be sent like this:

    token=Some_Long_String
    team_id=T0001
    channel_id=C2147483705
    channel_name=test
    user_id=U2147483697
    user_name=Steve
    command=/weather
    text=94070

So user_name = shared_by
text should be formatted like this:
title: string url: www.com text: adsad type: string
OR
text text text
we should then detect the first URL in the text and make that into the url
and if not present title: title from crawled webpage

text = description
title = take url from link

Respond with a 200 and text string of success or failure.

Weird bug on date

Add a post. The date is not set to today. So just posted one and in the admin its coming up as last friday (16th) when its 19th on the server.

To confirm: Server date/time is correct.

Better /admin/posts screen

Currently:
screen shot 2016-11-02 at 15 43 39

This screen allows an admin to see the latest posts and curate them.

Problem:

  • This posts screen is not the easiest to see latest posts that have been published.

Need :

  • Filters "not published / published", Entered within "1 month, 2 months, 1 week, 2 weeks, 3 weeks"
  • Ordered by Date DESC by default (so latest at top)
  • A way to bulk mark items to "Publish" or "Promote" or "Unpublish"

BuildError: ('postview.index_view', {}, None) error

The site now runs on Postgres - and uses environment variables. This is an attempt to get it running on heroku or a dokku installation. It worked straight off however I had to change 'user' to 'users' due to a conflict with postgres not liking a table called 'user'.

All was looking good until I tried to access /admin - or create a post.
The following occurs when trying to access /admin

2015-02-16T22:36:31.191809+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/jinja2/environment.py", line 742, in handle_exception
2015-02-16T22:36:31.191814+00:00 app[web.1]:     {% extends 'admin/master.html' %}
2015-02-16T22:36:31.191817+00:00 app[web.1]:     {% extends admin_base_template %}
2015-02-16T22:36:31.191812+00:00 app[web.1]:   File "/app/templates/admin/index.html", line 1, in top-level template code
2015-02-16T22:36:31.191816+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/flask_admin/templates/bootstrap2/admin/master.html", line 1, in top-level template code
2015-02-16T22:36:31.191819+00:00 app[web.1]:   File "/app/templates/my_master.html", line 1, in top-level template code
2015-02-16T22:36:31.191821+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/flask_admin/templates/bootstrap2/admin/base.html", line 23, in top-level template code
2015-02-16T22:36:31.191824+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/flask_admin/templates/bootstrap2/admin/base.html", line 30, in block "page_body"
2015-02-16T22:36:31.191827+00:00 app[web.1]:   File "/app/templates/my_master.html", line 30, in block "main_menu"
2015-02-16T22:36:31.191830+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/flask/helpers.py", line 312, in url_for
2015-02-16T22:36:31.191844+00:00 app[web.1]:     return appctx.app.handle_url_build_error(error, endpoint, values)
2015-02-16T22:36:31.191845+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/flask/app.py", line 1641, in handle_url_build_error
2015-02-16T22:36:31.191851+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/werkzeug/routing.py", line 1649, in build
2015-02-16T22:36:31.191850+00:00 app[web.1]:     force_external=external)
2015-02-16T22:36:31.191825+00:00 app[web.1]:     {% block main_menu %}
2015-02-16T22:36:31.191828+00:00 app[web.1]:     {% set postview = url_for('postview.index_view') %}
2015-02-16T22:36:31.191852+00:00 app[web.1]:     raise BuildError(endpoint, values, method)
2015-02-16T22:36:31.191847+00:00 app[web.1]:     reraise(exc_type, exc_value, tb)
2015-02-16T22:36:31.191848+00:00 app[web.1]:   File "/app/.heroku/python/lib/python2.7/site-packages/flask/helpers.py", line 305, in url_for
2015-02-16T22:36:31.191823+00:00 app[web.1]:     {% block page_body %}
2015-02-16T22:36:31.191854+00:00 app[web.1]: BuildError: ('postview.index_view', {}, None)

I can't work out what is going wrong with BuildError. Rather annoyingly I can't see if this is a local problem or something due to the way Heroku requires its files..

Any help much appreciated!

w

Create user route and user management client

Currently site has users and passwords created on the mongodb system only. There is no admin system for adding users. There are no roles.

We require a user management system. To change passwords and add users.

Users should have roles

Editor = Edit and prepare new email
Publisher = Edit and prepare new email and able to send
Admin = Edit and prepare new email and able to send AND edit users.

Pagination

in email preview (/admin/emailview/) you can only send 20 items..

Can we fix the amount of pagination (or actually - just turn it off for this view?)

w

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.