Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocavalcante committed Mar 23, 2012
1 parent 701d714 commit e3c1a40
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 35 deletions.
20 changes: 16 additions & 4 deletions app/assets/stylesheets/application.css.scss
Expand Up @@ -15,7 +15,7 @@ html body {
font-size: 2.75em;
font-weight: 300;
line-height: 1.5em;
border-bottom: 1px solid #DDD;
border-bottom: 1px solid #EEE;
}

h3 {
Expand All @@ -32,7 +32,7 @@ body .page-header {
font-size: 2.25em;
font-weight: 300;
line-height: 1.75em;
border-bottom: 1px solid #DDD;
border-bottom: 1px solid #EEE;
}
}

Expand Down Expand Up @@ -382,19 +382,26 @@ body .field_with_errors {

h1 {
padding-top: 15px;
border-top: 1px solid #DDD;
text-shadow: 0 1px 0 white;
border-bottom: none;
}
}

/* Breadcrumbs */
body .context-breadcrumb {
background: #EAEAEA;
border-bottom: 1px solid #DDD;
}
body .breadcrumb {
border-width: 0;
background: none;
box-shadow: none;
margin-bottom: 0;
padding: 9px 0;

a {
color: gray;
}
}

/* Pagination */
Expand Down Expand Up @@ -451,4 +458,9 @@ html[xmlns] .clearfix {

* html .clearfix {
height: 1%;
}
}

/* Tables */
table.with-input tr td {
line-height: 28px;
}
2 changes: 0 additions & 2 deletions app/assets/stylesheets/login.css.scss
Expand Up @@ -30,10 +30,8 @@
background-position: 8px 50%;
background-repeat: no-repeat;
padding: 1em 1.5em 1em 2.75em;
background-color: #FBFBFB;
background-position: 1em 50%;
background-repeat: no-repeat;
border: 1px solid #E5E5E5;
width: 23em;
margin-top: 0.5em;
height: auto;
Expand Down
33 changes: 19 additions & 14 deletions app/helpers/application_helper.rb
Expand Up @@ -4,23 +4,28 @@ def get_bread_crumb(url)
breadcrumb = ''
so_far = '/'
elements = url.split('/')
for i in 1...elements.size

so_far += elements[i] + '/'

if elements[i] =~ /^\d+$/
begin
breadcrumb += '<li>' + link_to_if(i != elements.size - 1, eval("#{elements[i - 1].singularize.camelize}.find(#{elements[i]}).name").gsub("_"," ").to_s, so_far) + '</li>'
rescue
breadcrumb += '<li>' + elements[i] + '</li>'

if elements.size > 3
for i in 1...elements.size

so_far += elements[i] + '/'

if elements[i] =~ /^\d+$/
begin
breadcrumb += '<li>' + link_to_if(i != elements.size - 1, eval("#{elements[i - 1].singularize.camelize}.find(#{elements[i]}).name").gsub("_"," ").to_s, so_far) + '</li>'
rescue
breadcrumb += '<li>' + elements[i] + '</li>'
end
else
breadcrumb += '<li>' + link_to_if(i != elements.size - 1, (I18n.t 'url.' + elements[i].gsub("-", "_").gsub(/\?.*/, '')), so_far) + '</li>'
end
else
breadcrumb += '<li>' + link_to_if(i != elements.size - 1, (I18n.t 'url.' + elements[i].gsub("-", "_").gsub(/\?.*/, '')), so_far) + '</li>'

breadcrumb += " <span class='divider'>/</span> " if i != elements.size - 1
end

breadcrumb += " <span class='divider'>/</span> " if i != elements.size - 1
breadcrumb
else
false
end
breadcrumb
rescue
'Not available'
end
Expand Down
6 changes: 3 additions & 3 deletions app/views/files/_form.html.haml
Expand Up @@ -4,15 +4,15 @@
.clearfix
= f.label :title
.input
= f.text_field :title
= f.text_field :title, :class => 'span6'

.clearfix
= f.label :description
.input
= f.text_area :description, :rows => 5
= f.text_area :description, :rows => 5, :class => 'span6'

.clearfix
= label_tag (t 'Upload')
= f.label :file
.input
= file_field :file, :upload

Expand Down
7 changes: 5 additions & 2 deletions app/views/layouts/application.html.haml
Expand Up @@ -48,10 +48,13 @@
%li.divider
%li= link_to (t 'Logout'), logout_path, :class => 'logout'

- if session[:user] && get_bread_crumb(request.fullpath)
.context-breadcrumb
.container-fluid
%ul.breadcrumb= get_bread_crumb(request.fullpath).html_safe

.context-header
.container-fluid
- if session[:user]
%ul.breadcrumb= get_bread_crumb(request.fullpath).html_safe
= yield :title
.container-fluid
- if notice
Expand Down
4 changes: 2 additions & 2 deletions app/views/professor/absences/index.html.haml
Expand Up @@ -10,7 +10,7 @@
%li= link_to (t 'Back'), professor_lecture_lesson_path(@lecture, @lesson), :class => 'back'

= form_tag({:action => :create}) do
%table
%table.with-input
%thead
%tr
%th= t 'activerecord.attributes.lesson_absence.lecture_student_id'
Expand All @@ -22,7 +22,7 @@
= lecture_student.name
= hidden_field_tag 'lecture_student_id[]', lecture_student.id
%td
= text_field_tag 'lecture_student_ammount[]', @absences[lecture_student.id]
= text_field_tag 'lecture_student_ammount[]', @absences[lecture_student.id], :class => 'span2'

.actions
= submit_tag nil, :class => 'btn primary'
Expand Down
2 changes: 1 addition & 1 deletion app/views/professor/test_results/index.html.haml
Expand Up @@ -10,7 +10,7 @@
%li= link_to (t 'Back'), professor_lecture_test_path(@lecture, @test), :class => 'back'

= form_tag({:action => :create}) do
%table
%table.with-input
%thead
%tr
%th= t 'activerecord.attributes.test_result.lecture_student_id'
Expand Down
4 changes: 2 additions & 2 deletions app/views/search/all.html.haml
@@ -1,4 +1,4 @@
%header.page-header
- content_for :title do
%h1= (t 'Search') + ': ' + @query

%h3= t 'Students'
Expand Down Expand Up @@ -27,4 +27,4 @@
%tr
%td= link_to professor.name, @user.is_admin? ? admin_professor_path(professor) : user_path(professor.person)
- else
%p= t 'NoResultsFound'
%p.alert-message.block-message.warning= t 'NoResultsFound'
2 changes: 1 addition & 1 deletion app/views/student/home/index.html.haml
@@ -1,4 +1,4 @@
%header.page-header
- content_for :title do
%h1= t 'Welcome'

%aside{:class => "sidebar aside-clean"}
Expand Down
2 changes: 1 addition & 1 deletion app/views/student/lectures/index.html.haml
@@ -1,4 +1,4 @@
%header.page-header
- content_for :title do
%h1= t 'Lectures'

%table
Expand Down
6 changes: 3 additions & 3 deletions config/database.yml
Expand Up @@ -11,7 +11,7 @@
development:
adapter: postgresql
encoding: unicode
database: uni_development
database: uni_core_development
pool: 5
host: localhost
username: postgres
Expand All @@ -38,7 +38,7 @@ development:
test:
adapter: postgresql
encoding: unicode
database: uni_test
database: uni_core_test
pool: 5
host: localhost
username: postgres
Expand All @@ -47,7 +47,7 @@ test:
production:
adapter: postgresql
encoding: unicode
database: uni
database: uni_core
pool: 5
host: localhost
username: postgres
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Expand Up @@ -102,6 +102,7 @@ en:
title: &title "Title"
description: &description "Description"
name: "File"
file: "File"
lecture_student:
lecture_situation_id: "Final Situation"
grade: "Final Grade"
Expand Down
1 change: 1 addition & 0 deletions config/locales/pt.yml
Expand Up @@ -102,6 +102,7 @@ pt:
title: &title "Título"
description: &description "Descrição"
name: "Arquivo"
file: "Arquivo"
lecture_student:
lecture_situation_id: "Situação Final"
grade: "Nota Final"
Expand Down

0 comments on commit e3c1a40

Please sign in to comment.