diff --git a/app/assets/stylesheets/scaffold.css b/app/assets/stylesheets/scaffold.css deleted file mode 100644 index 3e76e40..0000000 --- a/app/assets/stylesheets/scaffold.css +++ /dev/null @@ -1,73 +0,0 @@ -body { background-color: #fff; color: #333; } - -body, p, ol, ul, td { - font-family: verdana, arial, helvetica, sans-serif; - font-size: 13px; - line-height: 18px; -} - -pre { - background-color: #eee; - padding: 10px; - font-size: 11px; -} - -a { color: #000; } -a:visited { color: #666; } -a:hover { color: #fff; background-color:#000; } - -.fieldWithErrors { - padding: 2px; - background-color: red; - display: table; -} - -#errorExplanation { - width: 400px; - border: 2px solid red; - padding: 7px; - padding-bottom: 12px; - margin-bottom: 20px; - background-color: #f0f0f0; -} - -#errorExplanation h2 { - text-align: left; - font-weight: bold; - padding: 5px 5px 5px 15px; - font-size: 12px; - margin: -7px; - background-color: #c00; - color: #fff; -} - -#errorExplanation p { - color: #333; - margin-bottom: 0; - padding: 5px; -} - -#errorExplanation ul li { - font-size: 12px; - list-style: square; -} - -div.uploadStatus { - margin: 5px; -} - -div.progressBar { - margin: 5px; -} - -div.progressBar div.border { - background-color: #fff; - border: 1px solid grey; - width: 100%; -} - -div.progressBar div.background { - background-color: #333; - height: 18px; - width: 0%; -} diff --git a/app/assets/stylesheets/wiki.css.erb b/app/assets/stylesheets/wiki.css.erb deleted file mode 100644 index 776da04..0000000 --- a/app/assets/stylesheets/wiki.css.erb +++ /dev/null @@ -1,918 +0,0 @@ -* { margin: 0px; padding: 0px; line-height: 18px; } - -a { - text-decoration: none; -} - -a:focus { - -moz-outline: none; -} - -h1 { - margin: 18px 0px; - line-height: 18px; -} - -h2 { - margin: 18px 0px; - line-height: 18px; -} - -h3, h4 { - font-size: 12px; -} - -ol, dl, ul { - line-height: 18px; - margin: 18px 0px; - padding-left: 36px; -} - -ul ul, ol ol { - margin: 0px; -} - -.box ul { - list-style: none; - padding-left: 18px; -} - -.box ul li { - background-image: url(<%= App.base_path %>/assets/bullet.gif); - background-position: 0px 7px; - background-repeat: no-repeat; - padding-left: 15px; -} - - -.content blockquote { - margin-left: 27px; - border-left: 3px solid #ccc; - padding-left: 12px; - font-style: italic; -} - -.content pre { - margin-top: 18px; - padding: 9px 15px; -} - -.content code, .content pre { - background-color: #f4f4f4; -} - -.content p img.insert_image { -} - -dt { - margin-top: 9px; - margin-left: -27px; -} - -table tr td { - line-height: 18px; -} - -table { - border-spacing: 0px; -} - -h1, h2, h3, h4 { - font-weight: normal; - padding: 0px 18px; - margin: 18px 0px; -} - -h1 { - font-size: 24px; -} - -h2 { - font-size: 22px; -} - -h3 { - font-weight: bold; - font-size: 12px; -} - -p { - line-height: 18px; - margin-top: 18px; - margin-bottom: 0px; - font-size: 12px; -} - -p.middle:first-letter { - padding-left: 18px; -} - -p.middle { - margin-top: 0px; -} - -body { - color: #222; - margin: 0px; padding: 0px 9px; - - font-size: 12px; - font-family: verdana, sans-serif; - font-weight: normal; - min-width: 780px; - - background-color: #fff; -} - -#wrapper { - margin: 0em -9px; - padding: 0px 9px; - background-image: url(<%= App.base_path %>/assets/bg_body.png); - background-repeat: repeat-x; - background-color: #f4f4f4; -} - -#header { - background-image: url(<%= App.base_path %>/assets/header_bg.png); - background-position: top; - background-repeat: repeat-x; - color: #eee; - height: 50px; - margin: 0px -9px; -} - -#header h1 { - color: #eee; - font-size: 24px; - margin: 0px 30px; - display: inline; - line-height: 50px; - font-weight: normal; - float: left; -} - -#header_menu { - font-size: 11px; - text-align: right; - height: 22px; - border-bottom: 3px solid #ddd; - margin: 0px -9px; - margin-top: -22px; - color: #eee; - background-color: transparent !important; -} - -#header_menu ul { - margin: 0px 0px; - float: right; - list-style: none; -} - -#header_menu ul li { - float: left; - line-height: 18px; -} - -#header_menu a { - color: #ccc; - display: block; - padding: 0px 1.5em; - line-height: 18px; - border-bottom: 0px; -} - -#header_menu a:hover { - color: #fff; - text-decoration: none; - border-bottom: 0px; -} - -#header_menu ul li.last { - border-right: 0px; -} - -#strip { - display: none; - border-bottom: 3px solid #ddd; -} - -#site { - padding: 0px; - margin-top: 18px; -} - -#footer { - border-top: 3px solid #f0f0f0; - margin: 0px -9px; - padding: 18px 0px; - text-align: center; - color: #aaa; -} - -#footer .fa { - font-size: 175% !important; - vertical-align: middle; -} - -#footer p { - margin-top: 0px; -} - -.float_panel_left { - float: left; - margin: 3px 0px 0px 0px; - padding: 0em; -} - -.float_panel_right { - float: right; - margin: 3px 0px 0px 0px; - padding: 0em; -} - -.menu { - width: 177px; - margin: -3px 0px 15px 0px; - background-color: #fff; -} - -.menu ul { - margin: 0px 0px; padding: 0px; - list-style: none; -} - -.menu li, #shoutbox li { - border-top: 1px solid #eee; - margin-top: -1px; - padding: 9px 10px; -} - - -.menu h1 { - font-size: 12px; - font-weight: bold; - margin: 0px 0em; padding: 9px; -} - -.content { - margin: -3px 0px 0px 0px; - padding: 0em; - background-color: #fff; -} - -.content h1 { - margin: 18px 0px; - line-height: 36px; - font-size: 24px; -} - - -#innerwrapper_2column { - padding: 0em 0px 0em 208px; -} - -#innerwrapper_3column { - padding: 0em 208px 0em 208px; -} - -.calendario { - border-top: 1px solid #eee; - margin-top: -1px; - padding: 9px 0px; -} - -.calendario tr td { - font-size: 11px; - text-align: center; - width: 25px; -} - -.calendario th { - font-weight: normal; - font-size: 11px; -} - -.otherMonth { - color: #ccc; -} - -.specialDay { - background-image: url(<%= App.base_path %>/assets/bg_day.gif); - cursor: pointer; -} - -.specialDay a, .specialDay a:hover { - border-bottom: 0px solid #ccc; -} - -.widget_users li { - font-size: 11px; -} - -#shoutbox textarea { - font-family: sans-serif; - font-size: 11px; - width: 160px; - height: 35px; - border: 1px solid #ccc; - margin: 15px 0px 8px 0px; - padding: 0px 0px 0px 4px; - line-height: 18px; -} - -#shoutbox input { - border-width: 1px; -} - - -.menu h3, .menu h4 { - margin: 0px; padding: 0px; - font-weight: normal; - font-size: 11px; -} - -.menu h4 { - float: right; -} - -#location { - margin: 9px 0px -12px 0px; - padding: 6px 18px; -} - -#location a { - margin: 0em 9px; - line-height: 18px; -} - -#location a:first-child { - margin-left: 0px; -} - -.latex { - text-align: center; - margin-bottom: -5px; -} - -.wikicmd, .cmd { - font-size: 10px; - float: right; -} - -.wikicmd a, .cmd a { - margin: 0px 9px; -} - -.cmd a { - line-height: 32px; -} - -.box .cmd a { - line-height: 30px; -} - -#toc { - display: table; - margin: 16px 18px; - padding: 9px 0px 7px 0px; -} - -#toc h1 { - text-align: center; - margin: 0px 18px 0px 18px; - font-size: 12px; - line-height: 18px; -} - -#toc ol { - margin: 0px; - padding: 0px 36px; -} - -h4.title, h1.title { - margin: 0px 0px -9px 0px; - line-height: 36px; -} - -.box { - margin: 18px 0px; -} - -.box h3 { - line-height: 34px; - margin: 0px; - border-bottom: 1px solid #eee; - font-weight: normal !important; -} - -.box ul { - margin-top: 0px; - margin-bottom: 0px; - padding-left: 0px; -} - -.box li { - background-position: 16px 16px !important; - line-height: 18px; - padding: 9px 0px 8px 32px !important; - border-bottom: 1px solid #f4f4f4; -} - -.div_calendario table, .div_news table { - width: 100%; -} -.div_calendario table tr td, .div_news table tr td { - padding-top: 9px; - padding-bottom: 9px; -} - -.div_calendario table tr td:first-child, .div_news table tr td:first-child { - padding-left: 18px; -} - -.div_calendario .cmd, .div_news .cmd { - margin-top: -9px; - line-weigth: 9px; -} - - -/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - * Repositorio * - * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - -.repositorio h1, .repositorio p { - padding: 0px; - margin: 0px; -} - -.repositorio li h1 { - font-size: 12px; - line-height: 18px; -} - -.repositorio li { - background-repeat: no-repeat; - background-position: 16px !important; - list-style: none; - padding: 9px 0px 8px 43px !important; - border-bottom: 1px solid #eee; - line-height: 18px; -} - -.repositorio .mime_plain_text { background-image: url(<%= App.base_path %>/assets/tango/text-x-generic.png); } -.repositorio .mime_presentation { background-image: url(<%= App.base_path %>/assets/tango/x-office-presentation.png); } -.repositorio .mime_document { background-image: url(<%= App.base_path %>/assets/tango/x-office-document.png); } -.repositorio .mime_binary { background-image: url(<%= App.base_path %>/assets/tango/application-x-executable.png); } -.repositorio .mime_zip { background-image: url(<%= App.base_path %>/assets/tango/package-x-generic.png); } -.repositorio .mime_folder { background-image: url(<%= App.base_path %>/assets/tango/folder.png); } - -.spinner { - float: right; - margin-top: 8px; - margin-right: 5px; -} - -select { - min-width: 5em; -} - -.validation { - float: right; - font-size: 11px; -} - -.message, .notice, .warning { - color: #fff; - padding: 0px 10px; - border-radius: 3px; -} - -.message, .notice { - background-color: #690 -} - -.warning { - background-color: #c00 -} - -.warning a { - color: #fff !important; - border-bottom: 1px dotted #fff !important -} - -.message a, .notice a { - color: #fff !important; - border-bottom: 1px dotted #fff !important -} - - -#errorExplanation { - border-bottom: 2px solid #fdd; - border-right: 2px solid #fdd; - background-color: #fee; - padding: 18px 9px; - color: #422; -} - -#passmeter { - margin-left: 5px; - font-size: 11px; -} - -#errorExplanation * { - margin: 0px; - font-size: 12px; - line-height: 18px; -} - -#errorExplanation h2 { - display: none; - color: #c00; - line-height: 36px; -} - -#errorExplanation p, #errorExplanation h2 { - padding-left: 9px; -} - -#errorExplanation ul { - margin-top: 9px; -} - -.history { - margin-top: 18px; - margin-left: 18px; -} - -.history h4 { - margin-bottom: 0px; -} - -.history pre { - background-color: #e0e0e0; - margin-left: 20px; - padding: 9px; -} - -.tex_block { - text-align: center; - margin: 18px 0px; -} - -img { - vertical-align: middle; -} - -input, button, textarea { - border-width: 1px; - padding: 2px 5px; - xmargin-bottom: 9px; -} - -textarea { - width: 100%; -} - -.no_itens, .see_all { - color: #aaa; -} - -.box .see_all { - font-size: 11px; - background-image: none; - border-bottom-width: 0px; -} - - -.history input { - margin: 0px 10px 0px 0px; -} - -.history td { - line-height: 18px; -} - - -#wiki_preview { - background-image: url(<%= App.base_path %>/assets/rascunho.png); - border: 2px solid #e4e4e4; - padding: 10px; - overflow: auto; - margin: 18px 0px; -} - -.diff { - font-family: monospace; - font-size: small; - width: 100%; -} - -.diff_add, .diff_del, .diff_line { - padding: 0px 9px 0px 18px; -} - -.diff_add { - background-color: #dfd; - border-left: 2px solid #0c0; - border-right: 1px solid #0c0; - color: #050; -} - -.diff_line { - background-color: #f3f3f3; - border-left: 2px solid #bbb; - border-right: 1px solid #bbb; - color: #333; -} - -.diff_del { - background-color: #fdd; - border-left: 2px solid #c00; - border-right: 1px solid #c00; - color: #500; -} - -.diff_space { - height: 18px; - margin-top: 18px; -} - -.diff_border_add { - border-top: 1px solid #0c0; -} - -.diff_border_del { - border-top: 1px solid #c00; -} - -.diff_border_line { - border-top: 1px solid #bbb; -} - -.menu, .content, #location { - box-shadow: 2px 2px 2px #d0d0d0; - background-color: #fff; -} - -.menu { padding: 0px 9px; } -.content { padding: 9px 18px 36px 18px; } -#innerwrapper_2column .content { - padding: 9px 27px 36px 27px; -} - -form dt, form dd { - margin-left: 0px; -} - -form dl { - padding-left: 0px; -} - -#header_menu .grey { - opacity: 0.5; -} - -.content .grey { - color: #aaa; -} - -.avatar { - border: 1px solid #ccc; - padding: 2px; -} - -.card img.avatar { - float: left; - margin: 5px 18px 0px 0px; -} - -.user_list { - list-style: none; -} - -.user_list li { - background-image: none; -} - -.card h1 { margin-bottom: 0px; } -.card p { margin-top: 0px; } - -.color_box { -width: 18px; -height: 18px; -margin: 2px; -} - -.color_theme { -float: left; -border: 1px solid #ccc; -margin: 0px 2px; -text-align: center; -} - -.color_theme { - margin-top: 5px; -} - -.color_theme input { - margin: 3px 0px; -} - -.clear { clear:both; } - -.icon { - margin: 1px 1px !important; -} - -.icon img { - background-color: #bbb; - background-repeat: no-repeat; -} - -.icon:hover { border-bottom: 0px; } -.icon img { border: 0px solid #fff; } -.menu .cmd { - line-height: 12px !important; - margin-top: -1px; -} - -/*.box ul li { - border-top: 1px solid #eee; - padding: 9px 0px 9px 15px; - background-position: 0px 12px; -}*/ - -.box table { - margin-bottom: 2px; - border-collapse: collapse; -} - -.box table td { - border-top: 1px solid #eee; - padding: 4px 12px; -} - -.box table th { - padding: 4px 12px; - border-top: 1px solid #eee; - font-weight: normal; - text-align: left; -} - -.box dl { - margin: 0px 18px; -} - -.top { vertical-align: top; } -.center { text-align: center !important; } -.left { float: left !important; } -.right { float: right !important; } -.aright { text-align: right !important; } - -.pagination { - margin: 18px 0px; - text-align: right; -} - -.fieldWithErrors input, .fieldWithErrors textarea { - border: 2px solid #c00; -} - -.insert_image { - display: block; - margin: 0px auto; -} - -.narrow { - padding: 4px !important; -} - -#wiki_text h2, #wiki_text h3, #wiki_text h4 { - font-weight: bold; -} - -#wiki_text h1 { font-size: 20px; } -#wiki_text h2 { font-size: 14px; } -#wiki_text h3 { font-size: 12px; } -#wiki_text h4, #wiki_text h5, #wiki_text h6 { font-size: 11px; } - -/*.box h3. {*/ - /*margin-bottom: -9px;*/ - /*margin-top: 18px;*/ - /*padding-top: 9px;*/ - /*font-weight: normal;*/ -/*}*/ - -.content ol li { - background-image: none; - padding: 0px; -} - -ul ul, ul ol, ol ul, ol ol { - margin: 0px; -} - -li p, td p { - margin-top: 0px; -} - -.dashboard td:first-child { - padding-left: 27px; -} - -.dashboard table tr td { - padding-right: 9px; -} - -.dashboard .box ul { - margin-bottom: 0px; -} - -form dt p { - margin: 0px; -} - -#markup_help { - background-color: #f4f4f4; - border-bottom: 2px solid #eee; - border-right: 2px solid #eee; - margin: 9px 0px; - padding: 1px; -} - -#markup_help pre { - margin: 0px; - padding: 0px 9px; - margin: 0px 36px; - border: 1px dotted #aaa; -} - -#markup_help h3 { - margin: 18px 0px 9px 0px; -} - -#markup_help ul { - margin: 9px 0px; -} - -.log_entries .date { - float: left; - width: 50px; - margin: 0px 15px 0px -90px; -} - -.log_entries .avatar { - float: left; - margin: 0px 0px 0px -40px; -} - -.log_entries * { - vertical-align: top; - background-image: none !important; -} - -.log_entries li { - padding-left: 110px !important; -} - -ul.nested { - padding-left: 36px; -} - -ul.nested li { - padding-top: 5px !important; - padding-bottom: 4px !important; -} - -#contents { - margin-top: 18px; - padding: 0px 27px 9px 0px; - border: 1px solid #ccc; - width: 300px; -} - - -#contents h1 { - font-size: 12px; - margin: 0px; - text-align: center; - font-weight: bold; -} - -#contents li { - list-style: none; -} - -#contents ol { - margin: 0px; - padding: 0px 0px 0px 18px; -} - -.box li.show_all { - background-image: none; - font-size: 11px; -} - - - -/*body { background-image: url(<%= App.base_path %>/prototype/line.png); background-repeat: repeat; } -html * { background-color: transparent !important; }*/ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9000f00..b24b2ac 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -42,7 +42,7 @@ module ApplicationHelper output << "" end end - output + output.html_safe end def logged_in? @@ -71,18 +71,19 @@ module ApplicationHelper end def markup_enabled_field - "
Este campo aceita as linguagens Markdown, Latex e HTML. " + - link_to('Saiba mais.', '#', id: 'show_markup_help') + spinner('help') + "
" + ("Este campo aceita as linguagens Markdown, Latex e HTML. " + + link_to('Saiba mais.', '#', id: 'show_markup_help') + spinner('help') + + "
").html_safe end def markup_help - " ").html_safe end def gravatar_url_for(email, size = 80) - "http://www.gravatar.com/avatar.php?gravatar_id=#{Digest::MD5.hexdigest(email)}&size=#{size}&default=#{u(App.default_avatar)}_#{size}.png" + "http://www.gravatar.com/avatar.php?gravatar_id=#{Digest::MD5.hexdigest(email)}&size=#{size}&d=retro" end def action_icon(action_name, description, options = {}, html_options = {}) diff --git a/app/models/course.rb b/app/models/course.rb index 58d8ef4..f028ed4 100644 --- a/app/models/course.rb +++ b/app/models/course.rb @@ -87,6 +87,10 @@ class Course < ActiveRecord::Base period == App.current_period ? short_name : id.to_s end + def self.pluck_periods + Course.uniq.pluck(:period).reject!(&:blank?).sort.reverse + end + def self.from_param(param) param.is_numeric? ? Course.find(param) : Course.find_by_short_name!(param) end diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb index 0a90d51..51aa26f 100644 --- a/app/models/wiki_page.rb +++ b/app/models/wiki_page.rb @@ -44,6 +44,8 @@ class WikiPage < ActiveRecord::Base validates_uniqueness_of :title, scope: :course_id validates_uniqueness_of :canonical_title, scope: :course_id validates_format_of :title, with: /^[^0-9]/ + validate :check_wiki_syntax + before_validation :set_canonical_title before_save :set_position @@ -68,11 +70,10 @@ class WikiPage < ActiveRecord::Base end end - def validate + def check_wiki_syntax content.format_wiki rescue - errors.add("content", "possui erro de sintaxe: " + - $ERROR_INFO.to_s.html_escape) + errors.add("content", "possui erro de sintaxe") end def to_param diff --git a/app/views/attachments/index.html.haml b/app/views/attachments/index.html.haml index d0d7aed..3609e0d 100644 --- a/app/views/attachments/index.html.haml +++ b/app/views/attachments/index.html.haml @@ -7,7 +7,7 @@ .box.repositorio - if !@course.attachments.empty? %ul - = nested_attachments_to_html(attachments_to_nested_hash(@course.attachments)) + = raw nested_attachments_to_html(attachments_to_nested_hash(@course.attachments)) - else .box diff --git a/app/views/courses/index.html.haml b/app/views/courses/index.html.haml index 0d73c66..a998e78 100644 --- a/app/views/courses/index.html.haml +++ b/app/views/courses/index.html.haml @@ -33,5 +33,5 @@ %h3 Outros Semestres - %li= link_to "2008.2", period: '2008.2' - %li= link_to "2008.1", period: '2008.1' + - for period in Course.pluck_periods + %li= link_to period.to_s, period: period diff --git a/app/views/courses/show.html.haml b/app/views/courses/show.html.haml index c39eb55..a38cc14 100644 --- a/app/views/courses/show.html.haml +++ b/app/views/courses/show.html.haml @@ -51,7 +51,7 @@ %h3= t(:repository) .repositorio - = nested_attachments_to_html(attachments_to_nested_hash(@course.attachments.find_front_page)) + = raw nested_attachments_to_html(attachments_to_nested_hash(@course.attachments.find_front_page)) - if @course.attachments.empty? %ul.wiki %li.no_itens= t(:no_attachments) diff --git a/app/views/layouts/_base.html.haml b/app/views/layouts/_base.html.haml index 4a5569f..10023d6 100644 --- a/app/views/layouts/_base.html.haml +++ b/app/views/layouts/_base.html.haml @@ -6,6 +6,7 @@ %title= @title || App.title %meta{'name' => 'robots', :content => 'noindex,nofollow'} %meta{'http-equiv' => 'Content-Type', 'content' => 'text/html; charset=UTF-8'} + %meta{'name' => "viewport", 'content' => "width=device-width" } = stylesheet_link_tag :wiki %link{'href' => "#{App.base_path}/favicon.ico", 'rel' => 'icon', 'type' => 'image/vnd.microsoft.icon'} @@ -26,44 +27,48 @@ = csrf_meta_tag %body{'onload' => 'javascript: startup()'} - #wrapper - #header - %h1= "Wiki UFC" - - #header_menu + #header + .wrapper2 + %h1 + %strong Wiki + UFC + #header_menu + .wrapper2 %ul - if logged_in? - %li.grey= t(:logged_in_as, :u => h(@current_user.display_name)) + %li.grey= h(@current_user.display_name) %li.last= link_to 'Logout', logout_path, :accesskey => 'l' - else %li= link_to 'Cadastrar', signup_path %li.last= link_to 'Login', login_path, :accesskey => 'l' + #wrapper + .wrapper2 + #strip - #strip - - #location - = flash_div - = @location + #flash + = flash_div + #location + = @location - #site - %div - - if @right_panel.nil? - .float_panel_left= @left_panel - #innerwrapper_2column - .content= @content - - else - .float_panel_left= @left_panel - .float_panel_right= @right_panel - #innerwrapper_3column - .content= @content - %br{'style' => 'clear:both'} + #site + %div + - if @right_panel.nil? + .float_panel_left= @left_panel + #innerwrapper_2column + .content= @content + - else + .float_panel_left= @left_panel + .float_panel_right= @right_panel + #innerwrapper_3column + .content= @content + %br{'style' => 'clear:both'} #footer %p %b Wiki UFC %p - Powered by Ruby on Rails, PostgreSQL & Linux + Desenvolvido em Ruby on Rails %p Distribuido livremente sob a %a{href: 'https://www.gnu.org/licenses/agpl-3.0.en.html'} diff --git a/app/views/layouts/attachments.html.haml b/app/views/layouts/attachments.html.haml index 2d8a713..faaa215 100644 --- a/app/views/layouts/attachments.html.haml +++ b/app/views/layouts/attachments.html.haml @@ -1,15 +1,16 @@ - @title = "#{App.title} - #{h(@course.full_name)}" -- @location = capture do +- @location = capture do = link_to(App.title, index_url, :accesskey => 'z') + "›" = link_to("Disciplinas", courses_url) + "›" = link_to(h(@course.full_name), course_url(@course)) + "›" = link_to("Arquivos", course_attachments_url(@course)) - if @attachment.id - = "›" + link_to(truncate(h(@attachment.file_name)), course_attachment_url) + = "›" + =link_to(truncate(h(@attachment.file_name)), course_attachment_url) - @title = @title + " - #{truncate(h(@attachment.file_name))}" - @left_panel = render 'courses/left_panel' - @right_panel = render 'courses/right_panel' - @content = yield -= render 'layouts/base' += render 'layouts/base' diff --git a/app/views/layouts/courses.html.haml b/app/views/layouts/courses.html.haml index 75996f9..3fd2752 100644 --- a/app/views/layouts/courses.html.haml +++ b/app/views/layouts/courses.html.haml @@ -3,7 +3,8 @@ = link_to(App.title, index_url, :accesskey => 'z') + "›"; = link_to("Disciplinas", courses_url) - if @course and @course.id - = "› " + link_to(h(@course.full_name), course_url) + = "› " + =link_to(h(@course.full_name), course_url) - @title = @title + " - #{h(@course.full_name)}" - else - @title = @title + " - Disciplinas" diff --git a/app/views/layouts/users.html.haml b/app/views/layouts/users.html.haml index 11b6a4e..ef4a9ea 100644 --- a/app/views/layouts/users.html.haml +++ b/app/views/layouts/users.html.haml @@ -3,7 +3,8 @@ = link_to(App.title, index_url, :accesskey => 'z') + "›"; = link_to("Usuários", users_path) - if @user and @user.id - = "› " + link_to(h(@user.name), user_url(@user)) + = "› " + =link_to(h(@user.name), user_url(@user)) - @title = @title + " - #{h(@user.display_name)}" - @left_panel = render('widgets/menu_navigation') + render('widgets/menu_user') diff --git a/app/views/layouts/wiki.html.haml b/app/views/layouts/wiki.html.haml index 03288d7..c19aca0 100644 --- a/app/views/layouts/wiki.html.haml +++ b/app/views/layouts/wiki.html.haml @@ -1,14 +1,15 @@ - @title = "#{App.title} - #{h(@course.full_name)}" -- @location = capture do +- @location = capture do = link_to(App.title, index_url, :accesskey => 'z') + "›" = link_to("Disciplinas", courses_url) + "›" = link_to(h(@course.full_name), course_url(@course)) + "›" = link_to("Wiki", course_wiki_url(@course)) - if @wiki_page.title? - = "›" + link_to(h(@wiki_page.title), course_wiki_instance_url(@course.to_param, @wiki_page)) + = "›" + =link_to(h(@wiki_page.title), course_wiki_instance_url(@course.to_param, @wiki_page)) - @title = @title + " - #{h(@wiki_page.title)}" - @left_panel = render 'courses/left_panel' - @content = yield -= render 'layouts/base' += render 'layouts/base' diff --git a/app/views/log/_attachment_log_entry.html.haml b/app/views/log/_attachment_log_entry.html.haml index 8b9e3b1..5698813 100644 --- a/app/views/log/_attachment_log_entry.html.haml +++ b/app/views/log/_attachment_log_entry.html.haml @@ -3,4 +3,4 @@ = "excluiu " if entry.kind_of?(AttachmentDeleteLogEntry) = "restaurou " if entry.kind_of?(AttachmentRestoreLogEntry) -= "o anexo " + link_to(h(entry.attachment.file_name), course_attachment_url(entry.course, entry.attachment)) += raw "o anexo " + link_to(h(entry.attachment.file_name), course_attachment_url(entry.course, entry.attachment)) diff --git a/app/views/log/_wiki_log_entry.html.haml b/app/views/log/_wiki_log_entry.html.haml index 9728976..e174df0 100644 --- a/app/views/log/_wiki_log_entry.html.haml +++ b/app/views/log/_wiki_log_entry.html.haml @@ -4,9 +4,11 @@ = "restaurou " if entry.kind_of?(WikiRestoreLogEntry) - if entry.version - = "a página " + link_to(h(entry.wiki_page.title), course_wiki_instance_url(entry.course, entry.wiki_page.id, :version => entry.version)) + a página + =link_to(h(entry.wiki_page.title), course_wiki_instance_url(entry.course, entry.wiki_page.id, :version => entry.version)) - else - = "a página " + link_to(h(entry.wiki_page.title), course_wiki_instance_url(entry.course, entry.wiki_page.id)) + a página + =link_to(h(entry.wiki_page.title), course_wiki_instance_url(entry.course, entry.wiki_page.id)) - current_version = entry.wiki_page.versions.find_by_version(entry.version) @@ -15,12 +17,12 @@ - if entry.kind_of?(WikiEditLogEntry) - unless current_version.nil? - if current_version.description and !current_version.description.empty? - = "(#{h(current_version.description)})" + = raw "(#{h(current_version.description)})" - unless previous_version.nil? - = "(" + link_to("diff", diff_course_wiki_instance_url(entry.course, entry.wiki_page.id, :from => previous_version.version, :to => entry.version)) + ")" - - = "(" + link_to("edit", edit_course_wiki_instance_url(entry.course, entry.wiki_page.id, :description => "Revertendo para versão #{entry.version}", :version => entry.version)) + ")" - + = raw "(" + link_to("diff", diff_course_wiki_instance_url(entry.course, entry.wiki_page.id, :from => previous_version.version, :to => entry.version)) + ")" + + = raw "(" + link_to("edit", edit_course_wiki_instance_url(entry.course, entry.wiki_page.id, :description => "Revertendo para versão #{entry.version}", :version => entry.version)) + ")" + - unless previous_version.nil? - = "(" + link_to("undo", edit_course_wiki_instance_url(entry.course, entry.wiki_page.id, :description => "Revertendo para versão #{previous_version.version}", :version => previous_version.version)) + ")" + = raw "(" + link_to("undo", edit_course_wiki_instance_url(entry.course, entry.wiki_page.id, :description => "Revertendo para versão #{previous_version.version}", :version => previous_version.version)) + ")" diff --git a/app/views/log/index.html.haml b/app/views/log/index.html.haml index 7a80eb8..f4cb143 100644 --- a/app/views/log/index.html.haml +++ b/app/views/log/index.html.haml @@ -9,15 +9,15 @@ %ul.log_entries - @log_entries_by_day.each do |day, entries| %h3 - =tz(day).strftime("%d de %B de %Y") + =tz(day).strftime("%d de %B de %Y") - entries.each do |entry| %li .date = tz(entry.created_at).strftime("%H:%M") %img.avatar{:src => gravatar_url_for(entry.user.email, 27)} - =link_to truncate(h(entry.user.display_name), :length => 20), user_url(entry.user.id) - = render(:partial => 'log/log_entry', :locals => { :entry => entry }) + = link_to truncate(h(entry.user.display_name), :length => 20), user_url(entry.user.id) + = render(:partial => 'log/log_entry', :locals => { :entry => entry }) %br - = "Disciplina " + link_to(h(entry.course.full_name), course_url(entry.course)) + = raw "Disciplina " + link_to(h(entry.course.full_name), course_url(entry.course)) = will_paginate @log_entries diff --git a/app/views/users/_form_profile.html.haml b/app/views/users/_form_profile.html.haml index 44c23ed..50302a1 100644 --- a/app/views/users/_form_profile.html.haml +++ b/app/views/users/_form_profile.html.haml @@ -10,15 +10,20 @@ %dd= text_field('user', 'name') %dt - %label{:for => 'user_description'} Descrição + %label{:for => 'user_description'} + Descrição + =markup_enabled_field %dd= preserve(text_area('user', 'description', { :rows => 10 })) %dt %label Dica: %p - = "Para utilizar um avatar, cadastre-se no site Gravatar com o mesmo email utilizado no #{App.title}." + Para utilizar um avatar, cadastre-se no site + %a{href: 'http://gravatar.com'} Gravatar + com o mesmo email utilizado no + =App.title + - if admin? %dt= check_box_tag('user[admin]', 1, @user.admin?) + " Administrador" - diff --git a/app/views/users/_form_settings.html.haml b/app/views/users/_form_settings.html.haml index e111847..cc1698d 100644 --- a/app/views/users/_form_settings.html.haml +++ b/app/views/users/_form_settings.html.haml @@ -27,7 +27,7 @@ %dt %label{:for => 'user_password'} Senha %dd - = password_field('user', 'password', {:value => '', :id => 'password'}) + = password_field('user', 'password', {:value => '', :id => 'password'}) %span#passmeter %dt @@ -40,6 +40,6 @@ %dl %dt %label{:for => 'user_color_pref'} Esquema de cores + %br = render :partial => 'widgets/color', :collection => App.color_schemes %br.clear - diff --git a/app/views/users/dashboard.html.haml b/app/views/users/dashboard.html.haml index 2f85294..472a19f 100644 --- a/app/views/users/dashboard.html.haml +++ b/app/views/users/dashboard.html.haml @@ -17,7 +17,7 @@ - @news.each do |n| %tr %td.top.aright - = n.timestamp.strftime("%d de %B") + = n.timestamp.strftime("%d de %B") %td = link_to(h(n.course.full_name), course_url(n.course)) + " ›" = link_to(h(n.title), course_news_instance_url(n.course, n)) @@ -37,7 +37,7 @@ - @events.each do |n| %tr %td.aright.top - = n.time.strftime("%d de %B") #unless n.time == last_time + = n.time.strftime("%d de %B") #unless n.time == last_time - last_time = n.time %td.top = n.time.strftime("%H:%M") @@ -53,4 +53,3 @@ - @current_user.courses.each do |course| %li= link_to(h(course.full_name), course_url(course)) - diff --git a/app/views/widgets/_menu_disciplina.html.erb b/app/views/widgets/_menu_disciplina.html.erb index 2d996c2..5fd12d7 100644 --- a/app/views/widgets/_menu_disciplina.html.erb +++ b/app/views/widgets/_menu_disciplina.html.erb @@ -3,11 +3,11 @@