Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michal Bugno
committed
Mar 3, 2010
1 parent
8dbfbe5
commit 9475800
Showing
17 changed files
with
256 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
1. Wygodniejszy interfejs przypisywania prowadzących do zajęć, zmieniania liczby | ||
grup przypisanych do prowadzących dane zajęcia itd. Np. przy zmienianiu liczby | ||
grup dla danego prowadzącego powinni być widoczni wszyscy prowadzący dane | ||
zajęcia, wszędzie powinny być informacje o liczbie jeszcze nie przypisanych grup | ||
z danych zajęć lub o tym ile grup zostało przypisanych ponad stan faktyczny - | ||
nie należy jednak blokować możliwości przekraczania faktycznej liczby grup przy | ||
przypisywaniu. | ||
|
||
|
||
2. Wprowadzenie możliwości rozliczania godzinowego, oprócz opartego na grupach. | ||
Czyli np. możliwość przypisywania w rozliczeniu pewnym prowadzącym godzin (np. | ||
10) za dany przedmiot. Ilości grup wyliczałyby się wtedy automatycznie. | ||
|
||
|
||
3. Wydzielić kategorię "Inne" oprócz "semestru zimowego" i "semestru letniego". | ||
Znajdowały by się tam wszelkie dodatkowe godziny za opiekę nad doktorantami, | ||
koła naukowe itp., do których nie można przypisać roku, ani semestru. | ||
|
||
|
||
4. Możliwość wybrania, w trakcie generowania raportu, na podstawie czego | ||
obliczane są godziny: „Grup zajęciowych” lub „Grup rozliczeniowych”. | ||
|
||
|
||
5. Sortowanie terminarza grup u admina po przedmiotach lub po prowadzących. | ||
|
||
|
||
6. Sortowanie po każdej kolumnie w tabelkach ze spisami zajęć, przedmiotów, itd. | ||
|
||
|
||
7. Dodanie linku edycji wszędzie, gdzie pojawiają się tabelki, czyli: "rodzaj | ||
studiów – pokaż wszystkie", "typ zajęć – pokaż wszystkie”, "kierunki – pokaż | ||
wszystkie", "przedmioty - pokaż wszystkie". | ||
|
||
|
||
8. W raportach podsumowania (liczby godzin) powinny pojawiać się po każdym | ||
semestrze oddzielnie, a na końcu jeszcze podsumowanie wszystkich godzin. | ||
|
||
|
||
9. Oprócz powyższych informacji powinna się znaleźć tabelka (patrz Załącznik 1) | ||
zawierająca godziny oddzielnie dla przedmiotów z EAIiE i oddzielnie spoza | ||
EAIiE. W ramach tego podziału powinien być podział na studia stacjonarne i | ||
niestacjonarne, a następnie podział na wykłady i ćw+lab.+proj. Dla każdego | ||
podziału powinny być wyliczone sumy: czyli suma dla stacjonarnych na EAIiE, | ||
dla niestacjonarnych na EAIiE itd. Natomiast godziny za egzamin powinny być w | ||
ogóle wydzielone osobno. Odzielnie powinno się znaleźć również podsumowanie | ||
dla godzin spoza „zajęć”, czyli opieki nad kołem naukowym itd. Dobrze by było | ||
gdyby w ogóle tego rodzaju zestawienia można było sobie konfigurować | ||
samodzielnie, czyli np. admin mógłby pogrupować co ma być zsumowane ponieważ | ||
wzór tabelki może się zmienić. | ||
|
||
|
||
10. Możliwość wygenerowania powyższej tabelki niezależnie od raportu | ||
godzinowego. | ||
|
||
|
||
11. Każdy element raportu można "włączyć" lub "wyłączyć" (przed wygenerowaniem | ||
raportu). | ||
|
||
|
||
12. W raportach "po prowadzących" w tabelce z podsumowaniem godzinowym całego | ||
roku pozycja "Pensum" powinna się nazywać np. "Możliwe do rozliczenia w ramach | ||
pensum" albo coś podobnego (najlepiej krótszego). W tej chwili jest to trochę | ||
mylące bo każdy myśli, że to jest jego pensum, a nie godziny które mogą służyć | ||
do rozliczenia pensum. | ||
|
||
|
||
13. Powinna być możliwość zmiany semestru przy zmianie ustawień dla danych | ||
zajęć. Ogólnie wszystko powinno dać się zmienić bez konieczności uprzedniego | ||
usuwania danego elementu. | ||
|
||
|
||
14. Dla wykładowcy danego przedmiotu raport o całym "jego" przedmiocie | ||
(tzn. kto prowadzi lab., ćw. itd.). | ||
|
||
|
||
15. Raporty powinny być eksportowane do LaTeXa (tak jak jest w tej chwili) | ||
oraz PDFa. | ||
|
||
|
||
16. Błąd w wersji 1.0 systemu: w grupach u prowadzącego pojawiają się już | ||
usunięte grupy jako "do uzupełnienia". | ||
|
||
|
||
17. Przypominanie hasła na maila. | ||
|
||
|
||
18. Dostęp do systemu przez https. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
class Application < Merb::Controller | ||
before :ensure_authenticated | ||
|
||
def display_title | ||
@_title || self.title | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
class Users < Application | ||
def index | ||
@users = [User, User.dataset, "users", [[:login, "Login"]]] | ||
render | ||
end | ||
|
||
def edit | ||
@user = User[params[:id]] | ||
return render if request.get? | ||
@user.update(params[:user]) | ||
redirect(url(:controller => "users"), | ||
:message => {:notice => "Zaktualizowano!"}) | ||
rescue Sequel::ValidationFailed | ||
self.message[:notice] = error_messages(@user) | ||
render | ||
end | ||
|
||
def add | ||
@user = User.new(params[:user] || {}) | ||
self.title = "Dodaj nowego użytkownika" | ||
return render if request.get? | ||
@user.save | ||
redirect(url(:controller => "users"), | ||
:message => {:notice => "Dodano użytkownika"}) | ||
rescue Sequel::ValidationFailed | ||
self.message[:error] = error_messages(@user) | ||
render | ||
end | ||
|
||
def delete | ||
@user = User[params[:id]] | ||
self.title = "Czy na pewno usunąć?" | ||
return render if request.get? | ||
@user.destroy | ||
redirect(url(:controller => "users"), :message => {:notice => "Użytkownik usunięty"}) | ||
end | ||
|
||
def title | ||
"Użytkownicy" | ||
end | ||
|
||
def submenu_items | ||
[ | ||
["dodaj", url(:controller => "users", :action => "add")], | ||
] | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class User < BaseModel | ||
plugin :validation_class_methods | ||
plugin :hook_class_methods | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<%= text_field :login, :label => "Login" %> | ||
<%= password_field :password, :label => "Hasło" %> | ||
<%= password_field :password_confirmation, :label => "Hasło (potwierdzenie)" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<%= form_for @user, :action => url(:action => "add") do %> | ||
<%= partial :form %> | ||
<%= submit "Dodaj" %> | ||
<% end =%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<%= form_for @user, :action => url(:action => "delete", :id => @user.id) do %> | ||
<%= submit "Tak" %> | ||
<% end =%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<%= form_for @user, :action => url(:action => "edit", :id => @user.id) do %> | ||
<%= partial :form, :with => @user %> | ||
<%= submit "Aktualizuj" %> | ||
<% end =%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= tabular(*@users) %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This file is specifically setup for use with the merb-auth plugin. | ||
# This file should be used to setup and configure your authentication stack. | ||
# It is not required and may safely be deleted. | ||
# | ||
# To change the parameter names for the password or login field you may set either of these two options | ||
# | ||
#Merb::Plugins.config[:"merb-auth"][:login_param] = :email | ||
#Merb::Plugins.config[:"merb-auth"][:password_param] = :my_password_field_name | ||
|
||
begin | ||
# Sets the default class ofr authentication. This is primarily used for | ||
# Plugins and the default strategies | ||
Merb::Authentication.user_class = User | ||
|
||
|
||
# Mixin the salted user mixin | ||
require 'merb-auth-more/mixins/salted_user' | ||
Merb::Authentication.user_class.class_eval{ include Merb::Authentication::Mixins::SaltedUser } | ||
|
||
# Setup the session serialization | ||
class Merb::Authentication | ||
|
||
def fetch_user(session_user_id) | ||
Merb::Authentication.user_class.get(session_user_id) | ||
end | ||
|
||
def store_user(user) | ||
user.nil? ? user : user.id | ||
end | ||
end | ||
|
||
rescue Exception => e | ||
puts e.message | ||
Merb.logger.error <<-TEXT | ||
You need to setup some kind of user class with merb-auth. | ||
Merb::Authentication.user_class = User | ||
If you want to fully customize your authentication you should use merb-core directly. | ||
See merb/merb-auth/setup.rb and strategies.rb to customize your setup | ||
TEXT | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# This file is specifically for you to define your strategies | ||
# | ||
# You should declare you strategies directly and/or use | ||
# Merb::Authentication.activate!(:label_of_strategy) | ||
# | ||
# To load and set the order of strategy processing | ||
|
||
Merb::Slices::config[:"merb-auth-slice-password"][:no_default_strategies] = true | ||
|
||
Merb::Authentication.activate!(:default_password_form) | ||
Merb::Authentication.activate!(:default_basic_auth) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Merb | ||
module Session | ||
|
||
# The Merb::Session module gets mixed into Merb::SessionContainer to allow | ||
# app-level functionality; it will be included and methods will be available | ||
# through request.session as instance methods. | ||
|
||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# For details on Sequel migrations see: | ||
# * http://sequel.rubyforge.org/ | ||
# * http://sequel.rubyforge.org/rdoc-plugins/classes/Sequel/Migration.html | ||
|
||
class UserMigration < Sequel::Migration | ||
def up | ||
create_table :users do | ||
primary_key :id | ||
varchar :login, :null => false | ||
varchar :crypted_password | ||
varchar :salt | ||
end | ||
end | ||
|
||
def down | ||
drop_table :users | ||
end | ||
end |