GithubHelp home page GithubHelp logo

sheadawson / silverstripe-rateable Goto Github PK

View Code? Open in Web Editor NEW
20.0 20.0 12.0 64 KB

An extension that adds a star rating system + UI to any DataObject type

License: BSD 3-Clause "New" or "Revised" License

PHP 63.93% JavaScript 23.62% Scheme 6.38% CSS 6.07%

silverstripe-rateable's People

Contributors

hdpero avatar sheadawson avatar thunger avatar wernerkrauss avatar xini avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

silverstripe-rateable's Issues

Multiple instances of the same rating on the same page

First of all, great module!

Heres the things:
I've attached Rateable to "StoryPage", and the UI shows up fine when looping these pages out. However, if I loop the same Storypages, multiple places on the same pages, it breaks. This is because of the ID used in the injected JavaScript.

My hacky fix was to modify getRatingHTMLID() function to add a random number to the ID:

    public function getRatingHTMLID(){
        return $this->owner->ClassName . '-' . $this->owner->ID . '-' . 'rating-' . rand();
    }

Might need to figure out a better way to fix this

Can keep on rating an item after each page refresh

Hi again, and thanks for fixing the last issue so fast!

It seems the userHasRated() function in the RateableService class is broken. I can rate an item, refresh the page, and rate again.

Any ideas why this happens?

Usage of minified .js components?

Hi,
why is there no minified versions of js components?
I'll try to minify and test them to see if they work, and get back to you with results.

Best,
Petar

I18N

there are untranslated strings:

php: updateCMSFields
javascript: the "thanks" and "already rated" message.

I'm happy to create a PR for this

use git tags for releases

Could you please use git tags for releases? including dev-master in my config.json feels a bit bad. And releases will be cached locally so installing / updating is way faster.

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.