Skip to content
Snippets Groups Projects
Commit 63a5a27a authored by tuhe's avatar tuhe
Browse files

updates

parents 6a73f417 3b9ef9d1
No related branches found
No related tags found
No related merge requests found
Showing
with 955 additions and 426 deletions
# Kubusnet
Main development directory (base): `dev/dkbn2`.
Main entry point: `dev/dkbn2/dkbn2/settings.py` (check names of database user, etc.).
Example server (to see what works right now): https://kubusnet.loca.lt/
Deployment is on linux, but I also got it to work on windows.
# Getting started:
- Install python. I am using python 3.9 and 3.8 (development/deployment). I don't think 3.11 has issues
- I use most recent versino of django (4.x)
- I use pycharm, but it is not important. If you use pycharm, start project at another location on your computer, and add the kubusnet directory as a sources location in the project structure (ctrl+alt+s). This will make sure your pycharm config files are not commited to the repository and will cause conflict. Pycharm has a web-development-extension in the professional version, but I am not seeing a ton of benefit, and I have not gotten the debugger to work with Django (but if you can, it will help you a lot).
- Run the django guide for the first webapp using postgresql as backend:
- https://docs.djangoproject.com/en/4.0/intro/tutorial01/
- Then clone this repo using `git clone`. `push`/`pull` very frequently to main branch to avoid conflicts, as I will likely also make changes.
- run `pip install -r requirements.txt` to get most dependencies. Keep this up to date if you spot something that is missing.
- Add a configuration specific to your computer to `settings.py` (check how I have two settings for linux/win right now). This will allow us to use a single branch. Use same user/password for postgresql for simplicity.
- `python manage.py migrate` actually installed all tables in the db for me on the deployment server. I am not familiar with the `makemigrations`/`migrate` stuff beyond this, it is a new thing in Django.
- `python manage.py check` will check install. This should give an ok.
- `python manage.py runserver` should work (as in the guide). Your first (admin) user will not have a profile, but this will be automatically created the first time you try to select a project.
- Use admin panel to add users/project. Do this by first creating a project, then use mass `add user` functionality (bottom link). This will generate passwords, etc. correctly.
## Fixing bugs
- The code used to work, so the root cause of bugs are changes in Django since 0.9.x and libraries changing. Right now all generic views must be changed (from functional to class-based), and many/all urls are broken. These are reasonably easy to fix by using standard guides for upgrading between django versions and naming urls in `urls.py`. Note templates must be updated as well to use the new names (as in the tutorial).
- First goal is to get the main pages working (meetings, communication, tasks, notepads, mindmap). Most will hopefully be very quick individually, but overall it will require a lot of work.
- I had to re-order the code into many web-apps to get it to work which is not optimal; the code layout is pretty wonky, as is the location of templates, etc. We just have to live with that.
- Note the code was written for an old version of python and some of it is pretty bad because I was learning python at the time. UTF8 encoding also used to be a problem in older versions. Most strange things are not clever, they are just strange.
- I think the biggest problems will be in changes to Djangos models, and changes in javascript libraries. I had to update `jquery` to get the datapicker to work, and there are a few places where I use `jquery` for dynamical stuff. The file upload may also cause problems.
- Once the main things work, we need to fix some of the UI issues that has cropped up (help pages spill into html, forms that are organized poorly)
- Then remove functionality that is not necesary anymore/simplify. Probably a good idea to print out all pages and pin them to a bulletin board to get an overview of current functionality.
## Notes:
postgres (win)
postgres / gummiand
port: 5432
Postgres user for kubusnet: kubusnet/gummiand. Database name: kubusnet.
kubusnet_media is user uploaded files
kubusnet_static is (development) static files
kubusnet_static_col is automatically generated using
Use this to create admin login user (tue/gummiand)
```
python manage.py createsuperuser
```
python manage.py collectstatics
python manage.py check
postgres (win)
postgres / gummiand
port: 5432
kubusnet_media is user uploaded files
kubusnet_static is (development) static files
kubusnet_static_col is automatically generated using
Use this to create admin login user (tue/gummiand)
```
python manage.py createsuperuser
```
python manage.py collectstatics
python manage.py check
Commands
local (win) passwords:
postgres / gummiand
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -158,6 +158,7 @@ INSTALLED_APPS = [
'fileshare.apps.FileshareAppConfig',
'dkbn2.graph',
'tinymce',
'jquery', # fingers fucking crossed.
]
......
......@@ -8,17 +8,40 @@
<link href="/static/admin/css/login.css" rel="stylesheet">
<!--
<script type="text/javascript" src="/static/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.form-2.36.js"></script><!-- extra for form handling. -->
-->
<script type="text/javascript" src="/static/admin/js/jquery.js"></script>
<!--
<script type="text/javascript" src="/static/js/jquery.form-2.36.js"></script>
-->
<script type="text/javascript" src="/static/js/flowplayer.js"></script>
<script type="text/javascript" src="/admin/jsi18n/"></script>
<script type="text/javascript" src="/static/admin/js/jquery.init.js"></script>
<script type="text/javascript" src="/static/admin/js/actions.min.js"></script>
<script type="text/javascript" src="/static/admin/js/calendar.js"></script>
<script type="text/javascript" src="/static/admin/js/admin/DateTimeShortcuts.js"></script>
<script type="text/javascript" src="/static/admin/js/core.js"></script>
<script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
<!--
<script>
django = django || {};
django.jQuery = django.jQuery || jQuery;
</script>
pip install django-jquery
-->
-->
<!--
<script type="text/javascript" src="/static/jquery-ui-1.8/js/jquery-ui-1.8.18.custom.min.js"></script>
<link type="text/css" href="/static/jquery-ui-1.8/css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
-->
<!--
<script type="text/javascript" src="/static/admin/js/admin/RelatedObjectLookups.js"></script>
-->
<link rel="stylesheet" type="text/css" href="/static/admin/css/base.css" />
<link rel="stylesheet" type="text/css" href="/static/admin/css/widgets.css" />
......@@ -31,8 +54,7 @@
<link rel="stylesheet" href="/static/css/nicebuttons.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="/static/css/ui.datepicker.css" type="text/css" />
<script type="text/javascript" src="/static/jquery-ui-1.8/js/jquery-ui-1.8.18.custom.min.js"></script>
<link type="text/css" href="/static/jquery-ui-1.8/css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
<!-- end jquery ui datapicker thingy -->
......
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- fuck-all disable internalization. aint got a clue why this is here.-->
<!--<script>function gettext(txt){ return txt}</script>-->
{% load adminmedia %}
<script type="text/javascript">
window.__admin_media_prefix__ = "{% filter escapejs %}{% admin_media_prefix %}{% endfilter %}";
</script>
<script type="text/javascript" src="/media/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="/media/js/jquery.form-2.36.js"></script><!-- extra for form handling. -->
<!-- to make admin calendar picker avaliable -->
<!-- video player script -->
<script type="text/javascript" src="/media/js/flowplayer.js"></script>
<!--<script type="text/javascript" src="/admin/jsi18n/"></script>-->
<script type="text/javascript" src="/media/admin/js/core.js"></script>
<!--<script type="text/javascript" src="/media/admin/js/actions.js"></script>-->
<script type="text/javascript" src="/media/admin/js/admin/RelatedObjectLookups.js"></script>
<!--
<script type="text/javascript"src="/media/admin/js/admin/calendar.js"></script>
-->
<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="/media/admin/css/ie.css" /><![endif]-->
<!--[if IE]><link rel="stylesheet" href="blueprint/ie.css" type="text/css" media="screen, projection" /><![endif]-->
<link rel="stylesheet" type="text/css" href="/media/admin/css/base.css" />
<link rel="stylesheet" type="text/css" href="/media/admin/css/widgets.css" />
<link href="/media/css/base.css" rel="stylesheet" type="text/css"/>
<link rel="stylesheet" href="/media/css/blueprint/screen.css" type="text/css" media="screen, projection" />
<!-- <link rel="stylesheet" href="/media/css/blueprint/typography.css" type="text/css" media="screen, projection" />-->
<link rel="stylesheet" href="/media/css/blueprint/plugins/silksprite/sprite.css" type="text/css" media="screen, projection" />
<script type="text/javascript" src="/media/js/comments.js"></script>
<link rel="stylesheet" href="/media/css/blueprint/print.css" type="text/css" media="print" />
<!--<link rel="stylesheet" href="/media/css/blueprint/src/plugins/fancy-type/screen.css" type="text/css" media="screen, projection" />-->
<!--<link rel="stylesheet" href="/media/blueprint/src/forms.css" type="text/css" media="screen, projection" />-->
<link rel="stylesheet" href="/media/css/nicebuttons.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="/media/css/ui.datepicker.css" type="text/css" />
<!--<link rel="stylesheet" href="/media/comments.css" type="text/css" media="screen, projection" />-->
<!-- FACEBOX RELATED -->
<!--
<link href="/media/facebox/facebox.css" media="screen" rel="stylesheet" type="text/css"/>
<script src="/media/facebox/facebox.js" type="text/javascript"></script>
<script language='javascript'>
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox()
})
</script>
-->
<!-- jquery ui datapicker thingy -->
<script type="text/javascript" src="/media/jquery-ui-1.8/js/jquery-ui-1.8.18.custom.min.js"></script>
<link type="text/css" href="/media/jquery-ui-1.8/css/ui-lightness/jquery-ui-1.8.18.custom.css" rel="stylesheet" />
<!-- end jquery ui datapicker thingy -->
<!-- END FACEBOX -->
{% block extrajs %}{% endblock %}
<title>Kubusnet</title>
</head>
<body>
<div class="container">
{% block base_content %}BASE CONTENT GOES HERE{% endblock %}
</div>
</body>
</html>
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -10,6 +10,7 @@ from django.forms.models import modelformset_factory
from django.contrib.admin.widgets import AdminSplitDateTime
from tinymce.widgets import TinyMCE
#from dkbn2.pages.extra.db import QuerySetChain
from django.contrib.admin.widgets import AdminDateWidget
class MeetingVideoForm(ModelForm):
class Meta:
......@@ -101,9 +102,11 @@ def getUncompletedTasksFormSet(data):
return formset
class MeetingStage1Form(BaseMeetingForm):
# date = forms.DateField(widget=AdminDateWidget())
class Meta:
model = Meeting
fields = ('location', 'arena', 'green_leader', 'red_leader', 'date', 'meeting_focus')
fields = ('location', 'arena', 'green_leader', 'red_leader', 'meeting_focus')
class MeetingStage3Form(BaseMeetingForm):
......@@ -116,6 +119,7 @@ class MeetingStage4Form(BaseMeetingForm):
model = Meeting
fields=('location', 'date', 'green_leader', 'red_leader','meeting_focus', 'arena')
class MeetingStage5Form(BaseMeetingForm):
#social_log = forms.CharField(widget=forms.Textarea)
#tactic_log = forms.CharField(widget=forms.Textarea)
......@@ -124,9 +128,13 @@ class MeetingStage5Form(BaseMeetingForm):
#self.fields['social_log'].widget.attrs['cols'] = 8
#self.fields['tactic_log'].widget.attrs['cols'] = 8
date = forms.DateField(widget=AdminDateWidget())
class Meta:
model = Meeting
fields=('arena', 'location', 'date', 'green_leader', 'red_leader', 'meeting_focus', 'social_log', 'tactic_log')
fields=('arena', 'location', 'green_leader', 'red_leader', 'meeting_focus', 'social_log', 'tactic_log')
class MeetingStage0Form(BaseMeetingForm):
class Meta:
......
......@@ -10,28 +10,14 @@ import os
#from dkbn2.pages.models import get_current_project, UNCOMPLETED
def ucode(self):
print("Making profile...")
# print(self)
# from django.contrib.auth.models
try:
self.profile
except Exception as e:
# from profile.models import BaseProfile
print("Warning: Making profile... this should not occur under normal circumstances")
from profile.models import Profile
profile = Profile.objects.create(user=self)
profile.save()
raise e
# if not hasattr(self, 'profile') or self.profile is None:
# # User has no profile. So let's try to get creative.
# p = Profile(user=self)
# ns = self.name.split()
# # p = Profile(user=u)
# # ns = name.split()
# p.firstname = ns[0]
# if len(ns) > 1: p.surname = ' '.join(ns[1:])
# p.save() # Insert. Let's hope for the best!
first = self.profile.firstname
last = self.profile.surname
if first and last: return first + ' ' + last
......@@ -39,7 +25,7 @@ def ucode(self):
# monkeypatch the user model FTW (required for threaded comments).
User.__str__ = ucode
User.get_absolute_url = lambda self : str('/accounts/profile/'+self.username)
User.get_absolute_url = lambda self: str('/accounts/profile/'+self.username) # mystery meat energy.
ML = 256
UNCOMPLETED = 1; COMPLETED = 2; ABANDONED = 3
......
......@@ -3,7 +3,6 @@ from pages.forms import *
from pages.models import meeting_in_project
# from dkbn2.pages import models
#from dkbn2.decorators import project_required
from django.http import *
from pages.tables import MeetingTable
#from django.urls import reverse
......@@ -14,8 +13,12 @@ from pages.tables import MeetingTable
def meeting_list(request):
initial_queryset = meeting_in_project()
meetings = MeetingTable(initial_queryset, order_by=request.GET.get('sort', 'date'))
<<<<<<< HEAD
return render(request, 'meeting/meeting_list.html', {'table': meetings, "meetings" : initial_queryset, 'user' : request.user} )
=======
return render(request, 'meeting/meeting_list.html', {'table': meetings, "meetings" : initial_queryset, 'user' : request.user})
>>>>>>> 3b9ef9d110aafa30d15f8586d24deefaeeb32c51
def get_meeting_with_id(meeting_id):
return meeting_in_project().get(pk=meeting_id)
......@@ -54,7 +57,6 @@ def meeting_stage4_update(request, meeting_id):
post_save_redirect='/meetings/%s/stage/5/'%meeting_id,
extra_context = {'next_meeting' : next_meeting})
#def meeting_stage5_update(request, meeting_id):
def meeting_update(request, meeting_id):
meeting = meeting_in_project().get(pk=meeting_id)
......
dev/kubusnet_media/avatars/2022/Jun/08/tue_okFJcNP.24.jpg

723 B

select.admin-autocomplete {
width: 20em;
}
.select2-container--admin-autocomplete.select2-container {
min-height: 30px;
}
.select2-container--admin-autocomplete .select2-selection--single,
.select2-container--admin-autocomplete .select2-selection--multiple {
min-height: 30px;
padding: 0;
}
.select2-container--admin-autocomplete.select2-container--focus .select2-selection,
.select2-container--admin-autocomplete.select2-container--open .select2-selection {
border-color: var(--body-quiet-color);
min-height: 30px;
}
.select2-container--admin-autocomplete.select2-container--focus .select2-selection.select2-selection--single,
.select2-container--admin-autocomplete.select2-container--open .select2-selection.select2-selection--single {
padding: 0;
}
.select2-container--admin-autocomplete.select2-container--focus .select2-selection.select2-selection--multiple,
.select2-container--admin-autocomplete.select2-container--open .select2-selection.select2-selection--multiple {
padding: 0;
}
.select2-container--admin-autocomplete .select2-selection--single {
background-color: var(--body-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
}
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__rendered {
color: var(--body-fg);
line-height: 30px;
}
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
}
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__placeholder {
color: var(--body-quiet-color);
}
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow {
height: 26px;
position: absolute;
top: 1px;
right: 1px;
width: 20px;
}
.select2-container--admin-autocomplete .select2-selection--single .select2-selection__arrow b {
border-color: #888 transparent transparent transparent;
border-style: solid;
border-width: 5px 4px 0 4px;
height: 0;
left: 50%;
margin-left: -4px;
margin-top: -2px;
position: absolute;
top: 50%;
width: 0;
}
.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--single .select2-selection__clear {
float: left;
}
.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--single .select2-selection__arrow {
left: 1px;
right: auto;
}
.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--single {
background-color: var(--darkened-bg);
cursor: default;
}
.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--single .select2-selection__clear {
display: none;
}
.select2-container--admin-autocomplete.select2-container--open .select2-selection--single .select2-selection__arrow b {
border-color: transparent transparent #888 transparent;
border-width: 0 4px 5px 4px;
}
.select2-container--admin-autocomplete .select2-selection--multiple {
background-color: var(--body-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
cursor: text;
}
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__rendered {
box-sizing: border-box;
list-style: none;
margin: 0;
padding: 0 10px 5px 5px;
width: 100%;
display: flex;
flex-wrap: wrap;
}
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__rendered li {
list-style: none;
}
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__placeholder {
color: var(--body-quiet-color);
margin-top: 5px;
float: left;
}
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__clear {
cursor: pointer;
float: right;
font-weight: bold;
margin: 5px;
position: absolute;
right: 0;
}
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice {
background-color: var(--darkened-bg);
border: 1px solid var(--border-color);
border-radius: 4px;
cursor: default;
float: left;
margin-right: 5px;
margin-top: 5px;
padding: 0 5px;
}
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice__remove {
color: var(--body-quiet-color);
cursor: pointer;
display: inline-block;
font-weight: bold;
margin-right: 2px;
}
.select2-container--admin-autocomplete .select2-selection--multiple .select2-selection__choice__remove:hover {
color: var(--body-fg);
}
.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-search--inline {
float: right;
}
.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
margin-left: 5px;
margin-right: auto;
}
.select2-container--admin-autocomplete[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
margin-left: 2px;
margin-right: auto;
}
.select2-container--admin-autocomplete.select2-container--focus .select2-selection--multiple {
border: solid var(--body-quiet-color) 1px;
outline: 0;
}
.select2-container--admin-autocomplete.select2-container--disabled .select2-selection--multiple {
background-color: var(--darkened-bg);
cursor: default;
}
.select2-container--admin-autocomplete.select2-container--disabled .select2-selection__choice__remove {
display: none;
}
.select2-container--admin-autocomplete.select2-container--open.select2-container--above .select2-selection--single, .select2-container--admin-autocomplete.select2-container--open.select2-container--above .select2-selection--multiple {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.select2-container--admin-autocomplete.select2-container--open.select2-container--below .select2-selection--single, .select2-container--admin-autocomplete.select2-container--open.select2-container--below .select2-selection--multiple {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
.select2-container--admin-autocomplete .select2-search--dropdown {
background: var(--darkened-bg);
}
.select2-container--admin-autocomplete .select2-search--dropdown .select2-search__field {
background: var(--body-bg);
color: var(--body-fg);
border: 1px solid var(--border-color);
border-radius: 4px;
}
.select2-container--admin-autocomplete .select2-search--inline .select2-search__field {
background: transparent;
color: var(--body-fg);
border: none;
outline: 0;
box-shadow: none;
-webkit-appearance: textfield;
}
.select2-container--admin-autocomplete .select2-results > .select2-results__options {
max-height: 200px;
overflow-y: auto;
color: var(--body-fg);
background: var(--body-bg);
}
.select2-container--admin-autocomplete .select2-results__option[role=group] {
padding: 0;
}
.select2-container--admin-autocomplete .select2-results__option[aria-disabled=true] {
color: var(--body-quiet-color);
}
.select2-container--admin-autocomplete .select2-results__option[aria-selected=true] {
background-color: var(--selected-bg);
color: var(--body-fg);
}
.select2-container--admin-autocomplete .select2-results__option .select2-results__option {
padding-left: 1em;
}
.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__group {
padding-left: 0;
}
.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option {
margin-left: -1em;
padding-left: 2em;
}
.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -2em;
padding-left: 3em;
}
.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -3em;
padding-left: 4em;
}
.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -4em;
padding-left: 5em;
}
.select2-container--admin-autocomplete .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
margin-left: -5em;
padding-left: 6em;
}
.select2-container--admin-autocomplete .select2-results__option--highlighted[aria-selected] {
background-color: var(--primary);
color: var(--primary-fg);
}
.select2-container--admin-autocomplete .select2-results__group {
cursor: default;
display: block;
padding: 6px;
}
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment