climu / openstudyroom Goto Github PK
View Code? Open in Web Editor NEWWebsite for the Open Study Room online go/baduk/weiqi community.
Home Page: https://openstudyroom.org
License: GNU General Public License v3.0
Website for the Open Study Room online go/baduk/weiqi community.
Home Page: https://openstudyroom.org
License: GNU General Public License v3.0
In this commit I fixed issue #5 creating a unique check_code per sgf.
Now we need to populate the existing sgf in our db with such check_code.
I guess a view that parse all sgfs in db could do it.
In the account view, games are sorted in wrong order.
Strange thing is locally it doesn't happen and we have the proper "order": [[ 0, "desc" ]].
Already happened: players stop their game before it's finish in order to resume it latter and our scraper check one of the player in the meantime.
We end up with a sgf that have no results.
Such a sgf won't pass test and no game will be created but when they finish their game, the scraper won't analyse it again since we will already have a sgf with the same urlto in the db.
https://openstudyroom.org/league/account/
When you page through the league players, for example in the OSR Meijin league, when there are fewer players to display it shrinks the table and causes everything underneath to shift up. This is disorienting to the user. When you are on the final page of pagination, even with fewer players to display, the height should be fixed.
Clicking back and forth should keep the table consistent for easy browsing.
In the game archive view, no games are listed.
Strange thing is I can't reproduce locally. I really don't understand why.
There is have one game view (here) that handle this.
This view can take an optional argument event_id
that, if provided, only show games related to this league event.
When this event_id
argument is provided, everything works well (see here).
When no event_id
is provided (bug case), it calls this archive_game.html template.
When an event_id
(working case), it calls this game.html template.
Both archive_games.html
and games.html
include another includes/games.html template for the game listing.
It seems the bug scenario don't call this include/game.html
template at all in production.
Allow users to set when they are available is already working.
Next step is to display when people are available in a user calendar and allow him to create game request.
Try this for instance.
We got an Internal server error.
We should create a better profile page allowing users to set their biography, usernames on various go servers...
Best would be to regroup the forum profile fields and the others. I tryed onece, but it was tricky.
I think our website could use some css polishing.
I am thinking about our sidebar for instance. I just copy/past css from puput demo.
Feel free to change things in this folder and send pull/request.
I think it's quite selfspeaking.
No clue how to do that.
We should check on puput templates.
The result page is going to be one of the most viewed page on our website.
I think we could improve the looks of this result page.
It's rendered in the results template.
Uploading the sgf ;kiren vs p0tat0 does create a sgf but not a game object.
The save sgf buttons calls this view.
I got the message "Succesfully created a sgf and a league game " and the created sgf is valid.
I think it's here and here: we need to ad _iexact to so the kgs_username check are case insensitive.
Trying tomorow
I might edit directly in the server and pushed from there if we don't manage to deal with the github things soon.
Hi there. I am a ruby coder and just joined OSR. And it surprised me that this is not implemented.
Although Python feels like a ruby a close relative I don't feel so confident as to develop this myself (I'll try though).
Basically I think we could hit http://www.gokgs.com/gameArchives.jsp?user=jacksonh parse the html (obviously there are a lot of libs for this) and get the last rank from there (the rank of the player in it's last game).
I would be glad to pair program on this so I could learn some python/django while doing it.
When viewing games in pages like this one there is a error popup when you reach the end of the sgf.
Such error doesn't happen when is not iframed. See here for instance.
Since wgo js is loaded on every pages of the website (that is not proper I guess) it might be a conflict between the 2 js files.
I see 2 ways to fix it:
1: Remove wgo js from pages that doesn't needs it.
2 :sgf api and no more iframe:
Maybe best would be to apply both since neither using iframe nor loading unneeded js on everypages we want.
Public events title often doesn't fit the calendar day width.
We should show a tooltip on hover with event title and event description.
Hi,
At the moment we are using the urlto field to check if a sgf is not already in the db.
While this work for automatic kgs games added by check_player, there could be conflict when we upload games manually.
Indeed manual upload sgf urlto field is set to the default 'http://'.
I was thinking using the BL[time] WL[time] that record the exact time (milliseconds) left for a player at a move inside a sgf.
I guess we can assume that if in 2 sgf, both 5 first move have been played at the exact same time, those are same sgf;
So creating a new field 'check_code' that would be a list (or the sum?) of those could work better I think.
RIght now, I can't manage to deploy the website locally following this how to.
I am working on already deployed versions.
This is quite a big bug since it means people are not able to help us anymore.
Considering OSR would be happy to host leagues for some other friendly go community, it might be good to have a modular permissions system:
I am thinking creating a 'guest' class that would have:
When an admin would create for instance the guest 'A' we should :
Those 'A admins' users would have acces to restricted league admin pages showing only 'A leagues'.
Historment league profile is not showing.
Maybe it's because he have different username than kgs_username ?
or because his username have a '-' ?
When a logged user browse another user profile, it could be cool if there were a place opponent VS me containing things like:
Just an idea.
It's just the user.user_is_league_admin in the templates to replace by user.is_league_admin.
I write it here so I don't forget.
I think it could be good to have a view that show a game at /league/game/id.
Just some infos with the league, group, players, winner and the game showed with wgo.
That will allow us to easily refer to a game by providing a link to it.
The event function (or method?) event.possible_games is very wrong.
It doesn't take care that some players are not in the same division.
I guess this calculus should belong to division.possible_games and we should change event.possible_games by summing all division.possible_games.
We need to calculate this players results for each divisions and then to filter the users with whom he didn't play the max_number of games.
We are currently not checking the komi setting of the game.
I don't know if I should have a strong 6.5 hardcoded or a setting per event.
We should adapt times and dates to local format.
Specially on calendar, but I guess everywhere.
Either we detect users location or we use timezone setting, or we ask user his country to set format ?
Using fullcalendar select method and json api.
I am thinking of a discord view at /discord that would:
if user is a league member: redirect him to discord invite url (this url shoudln't be in the this github, so probably in a file as secretkey or in a setting)
else: redirect to / with a message as "OSR discord server is only for OSR member"
This would allow us to share the url /discord publicly without any worry.
The current way the results of a player are stored is via a string that stores a serialized dict, that is eval'ed to get the dict back.
As each game has 3 foreign keys to players (black, white and winner) we can generate the very same results dict from the database directly. This means we no-longer have to keep the serialized dicts in sync with the actual played games. (It also closes a security hole where we are eval'ing player names. Those could theoretically contain python code).
Given that we are going to be deleting matches (as per issue #18) this is going to save a lot of time.
A similar thing could be done to LeagePlayer.nb_wins and LeaguePlayer.nb_losses, at which point (I think) we wouldn't need to modify a LeaguePlayer at all when deleting a Game.
The solution would look something like below, this is fully of the cuff, I haven't even checked if it has syntax errors.
from collections import defaultdict
from collections import defaultdict
def get_results(self):
blackGames = self.black.get_queryset()
whiteGames = self.black.get_queryset()
resultsDict = defaultdict(list)
for game in blackGames:
opponent = game.white
won = game.winner == self
record = {
'id': game.pk,
'r' : 1 if won else 0
}
resultsDict[opponent.kgs_username].append(record)
for game in whiteGames:
opponent = game.black
won = game.winner == self
record = {
'id': game.pk,
'r' : 1 if won else 0
}
resultsDict[opponent.kgs_username].append(record)
Should performance ever be an issue, this function could be cached.
Just checked this W3C validator and we have 19 erros and 8 warnings on homepage.
If someone feels likes sanitysing a bit our templates he is more than welcome.
It appear the game class is not needed.
It's just a valid sgf related to an event.
I will add Foreignkeys to link a sgf to black and white users instead of keeping the kgs_usernames.
Then I will create a view that will update all valid sgfs.
I think we should start having a proper event system.
We could have 2 kind of events: public and private.
Public: For lectures, game commentary... Only OSR admins should be able to create such.
Private: To allow our member to shcedule games.
Then each member would have a calendar with all events both public and private related to him.
Best would be to create a new django app for this I guess.
draft model I can think of:
Class Event:
We need to create some views that allow league admins to view/edit/delete games, events, divisions, and players.
It could help find opponents if we knew what players are online on kgs.
See this kgs bot for instance.
Soon we will have a calendar view and event list.
It could be really cool to display all dates on the user timezone.
Django have a way to deal with that (doc).
We could have a timezone field in the user profile to allow user to set them manually.
We could also detect timezone directly.
I think best would be to check if user have a timezone setted and, if not, detect it.
Hi,
During registration, we perform no check on the kgs username.
We don't even check that it's not already in our db.
For the record, we use django allauth plugin for registration process.
Following this idea on our forum, I think it would be good to be able to have linked leagues.
The idea would be for a game to count in mutliple leagues.
I think a way could be to create a new "master league" type that would get all games played in all leagues.
Let say some community (go club) want to host a real life league. Or another one want their users to play anywhere they want.
We could allow one player to upload a sgf and then wait for the opponent to confirm the game is proper.
For now we just use on active event Registry.primary_event.
We think it would be better to support multiple event at the same time. That would allow us to host tournaments for instance, have long term league running along our ladder league system, support OGS leagues latter...
Since all the code rely on this primary_event thing, that's some work. If someone feels like sharing ideas, or starting working on it, he is welcome.
This one I still don't know how to do.
We should get all user one can play with and then get all availability events of those users.
Then the question is how to render such events on fullcalendar.
This have been requested by many users.
Show the users own availability when he is seeing others availability.
I think a check box to toggle this would be best.
I guess a game with only 10 moves can't be counted as a league game.
Right now, results are a dict.
I am thinking it would be cleaner to have a result object.
Such models are quite above my head at the moment.
Allowing users to show a goban with wgo in our forum could be cool.
One needs to write some custom markdown parser.
Know that our forum is powered by django-machina and uses python-markdown2.
Know that machina have a setting to choose the markup language.
Also, we can find this that can help in machina doc.
That's an idea that have been raise multiple times.
I just saw this django package that should help doing so.
It's not urgent but if someone feels like integrating such things, he is welcome
For a system the allows user to register and login with a username and password an HTTPS website is mandatory.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.