Show More
Commit Description:
[web] small styling, split out admin's menu, put config into table.info...
Commit Description:
[web] small styling, split out admin's menu, put config into table.info git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@157 6386c4cd-e34a-4fa8-8920-d93eb39b512e
File last commit:
Show/Diff file:
Action:
app/helpers/application_helper.rb | 46 lines | 1.4 KiB | text/x-ruby | RubyLexer |
pramook
initial commit...
r0 # Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
jittat
added user settings...
r13
jittat
small changes, layouts...
r22 def user_header
jittat
test interface upload...
r36 menu_items = ''
jittat
added user settings...
r13 user = User.find(session[:user_id])
jittat
clean up layouts...
r25
jittat
[web] small styling, split out admin's menu, put config into table.info...
r77 if (user!=nil) and (user.admin?)
# admin menu
menu_items << "<b>Administrative task:</b> "
append_to menu_items, '[Problem admin]', 'problems', 'index'
append_to menu_items, '[User admin]', 'user_admin', 'index'
append_to menu_items, '[User stat]', 'user_admin', 'user_stat'
#append_to menu_items, '[Graders]', 'graders', 'list'
append_to menu_items, '[Site config]', 'configurations', 'index'
menu_items << "<br/>"
end
jittat
clean up layouts...
r25 # main page
jittat
test interface upload...
r36 append_to menu_items, '[Main]', 'main', 'list'
jittat
update views -- styling...
r51 append_to menu_items, '[Submissions]', 'main', 'submission'
jittat
moved test interface functionality to test_controller...
r44 append_to menu_items, '[Test]', 'test', 'index'
jittat
test interface upload...
r36 append_to menu_items, '[Settings]', 'users', 'index'
append_to menu_items, '[Log out]', 'main', 'login'
menu_items
end
def append_to(option,label, controller, action)
option << ' ' if option!=''
option << link_to_unless_current(label,
:controller => controller,
:action => action)
jittat
added user settings...
r13 end
jittat
[web] fixing ticket #10...
r65 def format_short_time(time)
now = Time.now
st = ''
if (time.yday != now.yday) or
(time.year != now.year)
st = time.strftime("%x ")
end
st + time.strftime("%X")
end
pramook
initial commit...
r0 end