Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Paulina Kamińska committed Jan 28, 2023
1 parent 577e215 commit f967042
Show file tree
Hide file tree
Showing 20 changed files with 78 additions and 30 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added app/.DS_Store
Binary file not shown.
Binary file added app/assets/.DS_Store
Binary file not shown.
38 changes: 29 additions & 9 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ hr.white { border-color: #fff; }
.nav-link.active { color: #495057; }
}

// text formatting - colors
.text-alert { color: #dc3545 }

// lists
.no-bullets {
list-style: none;
padding-left: 0;
}

.datepicker { padding: 0.375rem 0.75rem; } // fix
.form-check-input.is-valid ~ .form-check-label { color: #212529; } // fix

Expand Down Expand Up @@ -73,13 +82,13 @@ hr.white { border-color: #fff; }
}
.card-body { padding: 40px; }
.link { display: none; }
}

#new-company-popup .close {
position: absolute;
top: 10px;
right: 15px;
z-index: 10;
.close {
position: absolute;
top: 10px;
right: 15px;
z-index: 10;
}
}

.avatar {
Expand Down Expand Up @@ -138,6 +147,18 @@ a.btn, .btn {
}
}

.btn-md {
display: inline-block;
padding: 0.25rem 0.3rem;
height: 50px;
border-width: 1px;
&:hover {
text-decoration: none !important;
}
}

.btn-centered { margin: auto; }

// contract index
.fixed-btn-width .btn { width: 85%; }

Expand Down Expand Up @@ -198,11 +219,11 @@ form .card {
}

.table .summed { border-bottom-width: 3px; }
// rozjasnienie dla table-striped
// lighter for table-striped
.table-striped tbody tr:nth-of-type(odd) {
background-color: rgba(0, 0, 0, 0.03);
}
// podswietlenie tabeli
// highlighting table
.table-hover tbody tr:hover {
background-color: #fffde7 !important;
}
Expand Down Expand Up @@ -243,7 +264,6 @@ tr.with-inputs {
}

//search-form

.show-search-form-js { display: none; }
.search-form {
padding: 20px 0;
Expand Down
2 changes: 2 additions & 0 deletions app/helpers/account_helper.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

module AccountHelper
end
15 changes: 10 additions & 5 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,28 @@ def table_sorting(model, attribute, controller = nil, param = {})
(header_name +
(selected ?
ord == 'DESC' ?
bootstrap_icon('caret-up-fill', width: 12, height: 12, fill: '#ffffff', class: 'sort-svg')
: bootstrap_icon('caret-down-fill', width: 12, height: 12, fill: '#ffffff', class: 'sort-svg')
bootstrap_icon('caret-up-fill', width: 12, height: 12, fill: '#ffffff', class: 'sort-svg', title: t('helpers.order.desc'))
: bootstrap_icon('caret-down-fill', width: 12, height: 12, fill: '#ffffff', class: 'sort-svg', title: t('helpers.order.asc'))
: '')
).html_safe
end
end

# Helper method for assigning numbers on list
def ln(i)
i + 1
end

def yes_no_icon(val)
if val
bootstrap_icon 'check-circle-fill', width: 12, height: 12, class: 'text-success', 'data-toggle': 'tooltip', title: 'Tak'
bootstrap_icon 'check-circle-fill', width: 12, height: 12, class: 'text-success', 'data-toggle': 'tooltip', title: t('booleans.question.true')
else
bootstrap_icon "x-circle-fill", width: 12, height: 12, class: 'text-dark', 'data-toggle': 'tooltip', title: 'Nie'
bootstrap_icon "x-circle-fill", width: 12, height: 12, class: 'text-dark', 'data-toggle': 'tooltip', title: t('booleans.question.true')
end
end

def time_left(time)
"Pozostało: #{distance_of_time_in_words(time, Date.current)}"
t(time.future? ? 'time_left' : 'past_time', scope: 'helpers', time: distance_of_time_in_words(time, Date.current))
end

def link_to_edit(item, controller = nil)
Expand Down
2 changes: 0 additions & 2 deletions app/helpers/registrations_helper.rb

This file was deleted.

2 changes: 0 additions & 2 deletions app/helpers/sessions_helper.rb

This file was deleted.

6 changes: 5 additions & 1 deletion app/javascript/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import "bootstrap-datepicker"

$(document).ready(function () {
$('.datepicker').datepicker({
format: 'dd-mm-yyyy' // TODO: fix for time
format: 'dd/mm/yyyy' // TODO: fix for time
});

$('button.close[data-dismiss="alert"]').click( function() {
$(this).parent().remove();
});
});

Binary file added app/views/.DS_Store
Binary file not shown.
5 changes: 2 additions & 3 deletions app/views/registrations/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
<%= f.label :password_confirmation, t('password_confirmation', scope: 'activemodel.attributes.user') %><br />
<%= f.input :password_confirmation, class: 'form-control', label: false %>
</div>
<div class="actions">
<%= f.submit t(".register"), class: 'btn-sm btn-primary btn-max-width' %>
<%= link_to t('.login'), login_path, type: 'button', class: 'btn-sm btn-primary btn-max-width' %>
<div class="actions text-center">
<%= f.submit t(".register"), class: 'btn btn-md btn-primary btn-max-width mt-4' %>
</div>
<% end %>
7 changes: 7 additions & 0 deletions app/views/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,10 @@
<%= render 'application/flash' %>

<%= render 'form' %>

<ul class="no-bullets text-center h4 mb-4 font-weight-normal">
<li>
<%= t('.login_to_your_account') %>
<%= link_to t('.login'), login_path %>
</li>
</ul>
5 changes: 2 additions & 3 deletions app/views/sessions/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
<%= f.label :password, t('password', scope: 'activemodel.attributes.user') %><br />
<%= f.password_field :password, class: 'form-control' %>
</div>
<div class="actions">
<%= f.submit t(".login"), class: 'btn-sm btn-primary btn-max-width' %>
<%= link_to t('.register'), new_registration_path, class: 'btn-sm btn-primary btn-max-width' %>
<div class="actions text-center">
<%= f.submit t(".login"), class: 'btn btn-md btn-primary btn-max-width mt-4' %>
</div>
<% end %>
9 changes: 8 additions & 1 deletion app/views/sessions/new.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
<h2 class="text-center h3 mb-3 font-weight-normal"><%= t('.title') %></h2>
<%= render 'application/flash' %>

<%= render 'form' %>
<%= render 'form' %>

<ul class="no-bullets text-center h4 mb-4 font-weight-normal">
<li>
<%= t('.register_account') %>
<%= link_to t('.register'), new_registration_path %>
</li>
</ul>
6 changes: 4 additions & 2 deletions app/views/tasks/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
%th{ scope: 'col' }

%tbody
- tasks.each_with_index do |t, index|
- tasks.each_with_index do |t, i|
%tr
%th{ scope: 'row' }= index + 1
%th{ scope: 'row' }= ln(i)
%td= link_to t.title, t
%td.text-center
= l(t.due_time, format: "%d-%m-%Y %l:%M")
%br
- unless t.due_time.future?
= bootstrap_icon 'exclamation-circle-fill', width: 12, height: 12, class: 'text-alert', 'data-toggle': 'tooltip', title: ''
= time_left(t.due_time)
%td.text-center
- if t.done_time.present?
Expand Down
Binary file added config/.DS_Store
Binary file not shown.
11 changes: 9 additions & 2 deletions config/locales/pl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,30 @@ pl:
must_be_in_the_future: Musi być w przyszłości
helpers:
confirm: Czy jesteś pewien?
order:
asc: Sortuj rosnąco
desc: Sortuj malejąco
time_left: 'Pozostało: %{time}'
past_time: 'Po czasie: %{time}'
sessions:
new:
register_account: Nie masz konta?
register: Zarejestruj się
title: Logowanie
form:
legend: Zaloguj się do systemu zarządzania zadaniami
login: Zaloguj się
register: Zarejestruj się
registration:
create:
error: Nie udało się zarejestrować na platformie
success: Dziękujemy za rejestrację
registrations:
new:
login: Zaloguj się
login_to_your_account: Masz juz konto?
title: Rejestracja
form:
legend: Zarejestruj się w systemie zarządzania zadaniami
login: Zaloguj się
register: Zarejestruj się
session:
create:
Expand Down
Binary file added lib/.DS_Store
Binary file not shown.
Binary file modified spec/.DS_Store
Binary file not shown.
Binary file added test/.DS_Store
Binary file not shown.

0 comments on commit f967042

Please sign in to comment.