Git Product home page Git Product logo

nuancier's Introduction

nuancier

http://shieldkins.elrod.me/fedora/nuancier

Author:Pierre-Yves Chibon <[email protected]>

Nuancier is a web-based voting application for the supplementary wallpapers of Fedora.

Get this project:

On github: https://github.com/fedora-infra/nuancier

Documentation: http://nuancier.rtfd.org

Dependencies:

This project is a Flask application. The calendars and meetings are stored into a relational database using SQLAlchemy as Object Relational Mapper (ORM). The application relies on Pillow to generate thumbnails of the pictures in order to increase the loading speed of the pages.

The dependency list is therefore:

Running a development instance:

You can either set up a development environment manually, or using Ansible with Vagrant.

Vagrant

The best way to set up a development enviroment is to use Vagrant. Vagrant provisions a new virtual machine and then runs the Ansible playbook on it automatically. To get started, install Vagrant:

$ sudo dnf install vagrant libvirt vagrant-libvirt vagrant-sshfs ansible

Next, clone the repository and copy the example Vagrantfile from Vagrantfile.example:

$ git clone https://github.com/fedora-infra/nuancier.git
$ cd nuancier
$ cp Vagrantfile.example Vagrantfile  # Edit Vagrantfile to your heart's content
$ vagrant up
$ vagrant reload
$ vagrant ssh

All done! The VM contains all the required dependencies pre-installed.

Manual

Clone the source:

git clone https://github.com/fedora-infra/nuancier.git

Create the database scheme:

python createdb.py

Run the server:

python runserver.py

You should be able to access the server at http://localhost:5000

Note

To tweak the configuration, you may either change default_config.py in the nuancier module, or copy the file utility/nuancier.cfg.sample into nuancier.cfg and run the application using:

NUANCIER_CONFIG=nuancier.cfg python runserver.py

Testing:

This project contains unit-tests allowing you to check if your server has all the dependencies correctly set.

To run them:

./runtests.sh

Note

To stop the test at the first error or failure you can try:

./runtests.sh -x

License:

This project is licensed GPLv2+.

nuancier's People

Contributors

00willo avatar aavrug avatar abadger avatar cydrobolt avatar farhaanbukhsh avatar grdryn avatar jenneh avatar jeremycline avatar jochemkuijpers avatar miabbott avatar praveenkumar avatar pypingou avatar ralphbean avatar relrod avatar ryanlerch avatar sayanchowdhury avatar shaguftamethwani avatar stickster avatar vatsala avatar vivekanand1101 avatar xsuchy avatar

Stargazers

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

Watchers

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

nuancier's Issues

Can I work on internationalization support?

hi there, can I do the work to bring internationalization support for this app or is there a rewriting of the app in progress?

I feel like the technologies are really close to what is done in noggin (the new FAS), I don't see any technical blocker.

thanks for your help

Update fedmsg

See with @ralphbean about updating fedmsg on the new code

  • send message when someone's submission has been approved
  • send message when someone's submission has been rejected
  • send message when an election has started
  • send message when an election has ended
    (I do not know how to do the last two since we moved to time-base opening/closing).

elections don't show end date

In the list of elections, I see when a vote started, but it's not visible when it ends. So I don't know how much time I have to vote. If I open the election, again there's no information about the duration.

elections and voting for f26 are done, but my picture is missing completely

I don't know how / why it happened (it might be my fault, though I don't see how), but my submission for the F26 wallpaper election didn't show up in the voting and doesn't show up in the results, and is still marked as "new" in the "Your Submissions" tab. I didn't get the badge for submitting a picture, either, if that helps.

Picture title is: Frozen
FAS account name is decathorpe, too

Vagrant devel setup fails during ansible playbook phase

Currently, by following the instructions to setup the dev environment in the README fails when performing from a freshly cloned git repo. It fails with a ansible playbook error as files/alembic.ini is not present in the git repo.

Looking at the commits, I can see that:
02Dec13 - .gitignore had alembic.ini added (969c220)
13Dec13 - Vagrant files adding that would have included alembic.ini (e8ba9d5)

Consequently, alembic.ini from the ansible role wasn't committed.

Working on a quick PR to resolve.

CLA signature error while opening the "my submissions" section.

The "my submissions" tab always gives the "You must sign the CLA (Contributor License Agreement to use nuancier)" error. regardless if the user has signed it or not. even the users who had submissions for the previous elections are given the same error.
It should be changed to "There are no active selections going on at the moment" or simply just show the past history of the user even if no elections are open.
The issues appear to be linked to the Fedora account system revamp that happened before.

@mairin
Thank you

Update the documentation

With the addition of the candidate upload and moderation the documentation needs to be adjusted, most likely the administrate and usage parts.

do not remove image when I pick it as a favorite

Every time I pick an image as favorite and put it into the "to be voted for" right bar, the image disappears from the list. That has these consequences:

  1. It re-shuffles all the remaining images.
  2. I can't display the image again. Which is quite ironic, because when I want to decide between several favorite images, I want to compare them. But I can't, because they're gone from the list.
  3. The only way to see which images I have in my "to be voted for" queue are the tiny tiny microscopic previews at the right bar. It's hard to recognize what the image was.
  4. When I un-favorite an image (e.g. just to be able to look at it properly once again), it's not added to its original place, but often somewhere else (to the end, it seemed).

Please do not remove a favorited image from the list. Just mark it as selected, e.g. with a colored border around it. That will be obvious, and will allow people to still display the full-sized version later. It will also avoid image shuffling issues.

more time fields on creating an election

as we created nuancier, we wanted to make it simple and left out some time fields and opened the elections automatically. Times changed, it becomes harder for me to moderate all until election opens and with the publishing in the Fedora Magazine its also hard to write it fast enough. So we need 2 more times

*submission end
*publishing date

Extra fields for submission

We have some issues with people not submitting their own work and re-license it or give the wrong author, as well we want to do special created wallpaper that are themed as well submitting manipulations without quoting the material wich was used, therefor we need

  • selection list with the kind of submission
    ** photograph
    ** image manipulation
    ** drawing
    if point two is chosen, we need a field with link to the material and a button to add another such field as there can be many things used in such a manipulation.
    For point two and three we need a comment field, that the submitter can explain the idea behind the picture.

make zoom the default action, not tick

This applies when voting for wallpapers.

When I click in the middle of a picture, I expect it to enlarge, not to "vote" for it. Currently when you click anywhere, it votes for the picture, and you have to be really precise for zooming the picture (click exactly on the zoom icon). Please make it the other way round. People are likely to look at many more pictures than they're going to vote for, so zoom functionality is the much more common one and should be much easier. Make zoom the default action, and make voting the precise action.

This will also allow to open the pictures in a new tab easily by middle clicking them. Currently you have to middle click the zoom icon, which is very hard to find out.

Place a button to the deadlines in the instructions page

I think it would be a good idea to add to the contributing instructions also a button to the "elections" schedule. Actually people get a lot of informations on how a wallpaper should look like, but they don't get informations about submission deadlines, voting periods, etc. unless they click on the elections tab in the top navigation bar.
On the bottom of the contributing instructions there is a "Contribute" button for the actual submission process. Maybe beside that button (or below, but near to it) we could add a link to the schedule, just to inform all people about the submissions schedule.

Yes, I know we have them in the wiki and on fedoramagazine.org (thx gnokii), but an additional link in the page people are looking at when starting to submit their wallpaper image, wouldn't hurt IMO.
Thanks.

sorting overview page submissions

the admin overview page sorts the submissions is resorted with generating the cache. Its not sorted by date of submission, so new submissions are hard to find, especially with 50 or more submissions

show, undecided, rejected and accepted submissions would be helpful

Annoying Sign-in pop up on Chromium-based Browsers on windows

This issue is strictly for Chromium-based browsers on Windows. Browsers on Fedora and firefox work perfectly fine and do not show this pop-up.
This pop-up is entirely useless as it appears to have zero connection to the Fedora Account system, any username and password combination as well as email-password combination I tried just made the pop-up to reappear, only canceling the pop-up will bring the user to the intended fedora account system login page.

a few screenshots of the issue:

popup on edge
popup on chrome

closing the pop-up brings the intended page:

FAS login

it's technically not a big deal but it might confuse users. @mairin
Thank you so much

Add a progress bar when uploading images

Uploading images can take a while, so it would be nice to have a progress bar indicating how the upload is doing.

This can be achieved with a little CSS and javascript relying on an event listener.

results page fails with an SQLAlchemy error

The results page was throwing an SQLAlchemy error about more fields being needed in the Group BY clause. I added fields until the error went away but it seems there should be a better way to fix this. Going to paste what I've done below:

diff --git a/roles/nuancier/templates/model.py b/roles/nuancier/templates/model.py
index b829c8d..7ba1a53 100644
--- a/roles/nuancier/templates/model.py
+++ b/roles/nuancier/templates/model.py
@@ -268,7 +268,7 @@ class Candidates(BASE):
         ).filter(
             Candidates.id == Votes.candidate_id
         ).group_by(
-            Candidates.id
+            Candidates.id, Candidates.candidate_file, Candidates.candidate_name, Candidates.candidate_author, Candidates.election_id, Candidates.date_created, Candidates.date_updated
         ).order_by(
             'votes DESC'
         )

received "Wrong input submitted" after voting

I voted for supplemental wallpapers and received a page "Wrong input submitted" red text and a Back button.

I hit Back, again Submit votes, again the same error.

I have opened the same election in a different tab, my votes were empty there. Then I went back to the original tab, hit Submit votes the third time, and miraculously it worked.

admin queue for review changes

divide the filter in the admin overview, make denied one an extra point and if possible stick with the chosen one even the "approve/deny" button gets hit, now it always switches back to all. I always have to choose "pending" again. With that many submissions not moderated as we have now is hard to work that way

adjust view of admin page

the admin panel, becomes to big, when people submit pictures with long URL (what is always the case) so that you have to scroll to the side

Automate generating supplemental wallpapers

Current method of packaging supplemental wallpaper is the use of ruby script file named generate-rile.rb. The following task is:

  • Name the distribution i.e. f24 for Fedora 24
  • Gather the list of theme, authors and licenses in a separate files to generate an attribution
  • Generate an xml, desktop files for the respective desktop environments, Makefiles are automatically created.
  • Prepare the associated images in different resolutions.

The script generates the following files:

  • Attribution-Extras continue the files associated with their authors mainly Fedora contributions and the license
  • Extras folder containing the wallpapers in both png and jpg, their associated desktop files, xml files for both gnome and mate along Fedora release extras i.e. f24-extras
  • Makefile which is automatically created

The idea is to create a tarball for future Fedora backgrounds releases and use the existing spec file to enable both default and extras folder.
Given my time constrain, I will post an illustration of the process soon.

nuancier needs to give an error message if the user is not in cla+1 group

Currently if the user is not in cla +1 nuancier redirects back to fas_openid which redirects immediately back to nuancier (as the user is already logged in) and so on in an infinite loop. I've changed the code to break that cycle and display an error message in the nuancier deployed in fedora infra. Instead of opening up a pull request I'm posting the patch below because the patch isn't very general. We probably need to change fas_login_required() to take a url to go to on error and a msg to display on error.

diff --git a/roles/nuancier/templates/__init__.py b/roles/nuancier/templates/__init__.py
index 2e9806b..3bd5942 100644
--- a/roles/nuancier/templates/__init__.py
+++ b/roles/nuancier/templates/__init__.py
@@ -88,11 +88,14 @@ def fas_login_required(function):
     """
     @wraps(function)
     def decorated_function(*args, **kwargs):
-        if flask.g.fas_user is None \
-                or not flask.g.fas_user.cla_done \
-                or len(flask.g.fas_user.groups) < 1:
+        if flask.g.fas_user is None:
             return flask.redirect(flask.url_for(
                 '.login', next=flask.request.url))
+        if not flask.g.fas_user.cla_done \
+                or len(flask.g.fas_user.groups) < 1:
+           flask.flash('You need to have signed the FPCA and be in one non-CLA'
+                    ' group to vote in this election', 'errors')
+            return flask.redirect(flask.url_for('index'))
         return function(*args, **kwargs)
     return decorated_function

@@ -103,15 +106,13 @@ def nuancier_admin_required(function):
     """
     @wraps(function)
     def decorated_function(*args, **kwargs):
-        if flask.g.fas_user is None or \
-                not flask.g.fas_user.cla_done or \
-                len(flask.g.fas_user.groups) < 1:
+        if flask.g.fas_user is None:
             return flask.redirect(flask.url_for('.login',
                                                 next=flask.request.url))
         elif not is_nuancier_admin():
             flask.flash('You are not an administrator of nuancier-lite',
                         'errors')
-            return flask.redirect(flask.url_for('msg'))
+            return flask.redirect(flask.url_for('index'))
         else:
             return function(*args, **kwargs)
     return decorated_function

Update doc

I was pointed out that the doc isn't up to date, they do not work if you follow them verbatim, we should improve on this :)
#57

Ralph fixed one thing on #59 (see below) but there might be more, we should go through and fix them.

limit of uploads

We have reached this time a stage where we should think of limited amount of upload, there was a guy uploading 20 wallpaper, all with logos and using material of others without proper license

change for maximal submissions

Some complaint that 2 submissions would be not enough, from my perspective it keeps the iterations and to many unusable stuff out.

I have an idea how furthermore improve the quality and give submitters who submitted high quality the chance to submit more. We could raise the amount of maximal submissions with winners of the election, each win brings you one more

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.