Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixnuty bug pri vytvarani zapisneho listu pre predlzujucich studentov #160

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions fladgejt/webui/studium.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,25 +255,27 @@ def get_roky_studia_noveho_zapisneho_listu(self, studium_key):

return options

def create_zapisny_list(self, studium_key, akademicky_rok, rok_studia):
def create_zapisny_list(self, studium_key, akademicky_rok):
'''Creates enrollment list.

Args:
studium_key: studium identifier
akademicky_rok: Academic year of the time range in the form of
'start/end'. E.g. '2013/2014'. (optional)
rok_studia: year of the study
'''
app = self._open_administracia_studia()

self.__open_novy_zapisny_list_dialog(app, studium_key)

message = None

rok_studia = max(list(map(lambda a : a.id ,app.d.rocnikComboBox.options)))

# V combo boxe vyberieme rok studia.
if rok_studia is not None:
app.d.rocnikComboBox.select(find_option(app.d.rocnikComboBox.options, id=str(rok_studia)))


# Ak je nastaveny akademicky rok, vyberieme ho v combo boxe.
if akademicky_rok is not None:
try:
Expand Down
8 changes: 5 additions & 3 deletions votrfront/js/PrehladStudiaPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export function PridatZapisnyListButton (props) {
var studium = props.studium;
var cache = new CacheRequester();
var zapisne_listy = cache.get('get_zapisne_listy', studium.studium_key);

if (!cache.loadedAll) {
return <Loading requests={cache.missing} />;
}
Expand All @@ -86,10 +87,11 @@ export function PridatZapisnyListButton (props) {
} else { // ak studium prebieha a nemame este zapisny list na tento rok
return <button type="button" onClick={() => {
if (confirm(`Vytvoriť zápisný list pre akademický rok ${currentAcademicYear()}?`)) {
sendRpc('create_zapisny_list', [studium.studium_key, currentAcademicYear(), null],(message) =>
sendRpc('create_zapisny_list', [studium.studium_key, currentAcademicYear()],(message) =>
{if (message !== null) {alert(message);}
else {RequestCache.invalidate('get_zapisne_listy');}})}}}
className='btn btn-xs btn-success'>Vytvoriť</button>
else {RequestCache.invalidate('get_zapisne_listy');}})}
}}
className='btn btn-xs btn-success'>Vytvoriť</button>
}
} else { // ak studium uz skoncilo
return null;
Expand Down