Skip to content

Commit

Permalink
New 2.4.0 version (#44)
Browse files Browse the repository at this point in the history
* updated gem

* added method localization methods

* Added link to switch lang

* added unlocalizated string

* added eng localization

* Added turbo frame for modal and method for close it

* ticket to modal

* redirect to root path when is close a modal opened as page

* ticket link go to user sign in if is not logged

* to 2.4.0 version
  • Loading branch information
MdreW authored Dec 30, 2021
1 parent f1fdd20 commit 4291b03
Show file tree
Hide file tree
Showing 35 changed files with 348 additions and 186 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.4.0]
Partecipo going international!
### Added
- full localized in italian and english
- new ticket edit in modal mode
- tickets editable from tickets page

## [2.3.2]
### Added
- Graphics enchantment
Expand Down
172 changes: 72 additions & 100 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,93 +1,74 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
actioncable (7.0.0)
actionpack (= 7.0.0)
activesupport (= 7.0.0)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.4.1)
actionpack (= 6.1.4.1)
activejob (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
actionmailbox (7.0.0)
actionpack (= 7.0.0)
activejob (= 7.0.0)
activerecord (= 7.0.0)
activestorage (= 7.0.0)
activesupport (= 7.0.0)
mail (>= 2.7.1)
actionmailer (6.1.4.1)
actionpack (= 6.1.4.1)
actionview (= 6.1.4.1)
activejob (= 6.1.4.1)
activesupport (= 6.1.4.1)
actionmailer (7.0.0)
actionpack (= 7.0.0)
actionview (= 7.0.0)
activejob (= 7.0.0)
activesupport (= 7.0.0)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.4.1)
actionview (= 6.1.4.1)
activesupport (= 6.1.4.1)
rack (~> 2.0, >= 2.0.9)
actionpack (7.0.0)
actionview (= 7.0.0)
activesupport (= 7.0.0)
rack (~> 2.0, >= 2.2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.4.1)
actionpack (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
actiontext (7.0.0)
actionpack (= 7.0.0)
activerecord (= 7.0.0)
activestorage (= 7.0.0)
activesupport (= 7.0.0)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (6.1.4.1)
activesupport (= 6.1.4.1)
actionview (7.0.0)
activesupport (= 7.0.0)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.4.1)
activesupport (= 6.1.4.1)
activejob (7.0.0)
activesupport (= 7.0.0)
globalid (>= 0.3.6)
activemodel (6.1.4.1)
activesupport (= 6.1.4.1)
activerecord (6.1.4.1)
activemodel (= 6.1.4.1)
activesupport (= 6.1.4.1)
activestorage (6.1.4.1)
actionpack (= 6.1.4.1)
activejob (= 6.1.4.1)
activerecord (= 6.1.4.1)
activesupport (= 6.1.4.1)
marcel (~> 1.0.0)
activemodel (7.0.0)
activesupport (= 7.0.0)
activerecord (7.0.0)
activemodel (= 7.0.0)
activesupport (= 7.0.0)
activestorage (7.0.0)
actionpack (= 7.0.0)
activejob (= 7.0.0)
activerecord (= 7.0.0)
activesupport (= 7.0.0)
marcel (~> 1.0)
mini_mime (>= 1.1.0)
activesupport (6.1.4.1)
activesupport (7.0.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
airbrussh (1.4.0)
sshkit (>= 1.6.1, != 1.7.0)
ast (2.4.2)
bcrypt (3.1.16)
bindex (0.8.1)
bootsnap (1.9.3)
msgpack (~> 1.0)
builder (3.2.4)
byebug (11.1.3)
capistrano (3.16.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
sshkit (>= 1.9.0)
capistrano-bundler (2.0.1)
capistrano (~> 3.1)
capistrano-rails (1.6.1)
capistrano (~> 3.1)
capistrano-bundler (>= 1.1, < 3)
capistrano-rvm (0.1.2)
capistrano (~> 3.0)
sshkit (~> 1.2)
capistrano3-puma (5.2.0)
capistrano (~> 3.7)
capistrano-bundler
puma (>= 4.0, < 6.0)
capybara (3.36.0)
addressable
matrix
Expand All @@ -111,7 +92,7 @@ GEM
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
deep_merge (1.2.1)
devise (4.8.0)
devise (4.8.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
Expand Down Expand Up @@ -171,7 +152,8 @@ GEM
image_processing (1.12.1)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
jbuilder (2.11.3)
jbuilder (2.11.5)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
launchy (2.5.0)
addressable (~> 2.7)
Expand All @@ -180,7 +162,7 @@ GEM
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.12.0)
loofah (2.13.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
Expand All @@ -191,19 +173,16 @@ GEM
mini_magick (4.11.0)
mini_mime (1.1.2)
mini_portile2 (2.6.1)
minitest (5.14.4)
minitest (5.15.0)
msgpack (1.4.2)
net-scp (3.0.0)
net-ssh (>= 2.6.5, < 7.0.0)
net-ssh (6.1.0)
nio4r (2.5.8)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
racc (~> 1.4)
orm_adapter (0.5.0)
pagy (5.6.4)
pagy (5.6.6)
parallel (1.21.0)
parser (3.0.3.1)
parser (3.0.3.2)
ast (~> 2.4.1)
pg (1.2.3)
public_suffix (4.0.6)
Expand All @@ -215,32 +194,32 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.1.4.1)
actioncable (= 6.1.4.1)
actionmailbox (= 6.1.4.1)
actionmailer (= 6.1.4.1)
actionpack (= 6.1.4.1)
actiontext (= 6.1.4.1)
actionview (= 6.1.4.1)
activejob (= 6.1.4.1)
activemodel (= 6.1.4.1)
activerecord (= 6.1.4.1)
activestorage (= 6.1.4.1)
activesupport (= 6.1.4.1)
rails (7.0.0)
actioncable (= 7.0.0)
actionmailbox (= 7.0.0)
actionmailer (= 7.0.0)
actionpack (= 7.0.0)
actiontext (= 7.0.0)
actionview (= 7.0.0)
activejob (= 7.0.0)
activemodel (= 7.0.0)
activerecord (= 7.0.0)
activestorage (= 7.0.0)
activesupport (= 7.0.0)
bundler (>= 1.15.0)
railties (= 6.1.4.1)
sprockets-rails (>= 2.0.0)
railties (= 7.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.2)
loofah (~> 2.3)
railties (6.1.4.1)
actionpack (= 6.1.4.1)
activesupport (= 6.1.4.1)
railties (7.0.0)
actionpack (= 7.0.0)
activesupport (= 7.0.0)
method_source
rake (>= 0.13)
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rainbow (3.0.0)
rake (13.0.6)
rb-fsevent (0.11.0)
Expand All @@ -261,7 +240,7 @@ GEM
rubocop-ast (>= 1.12.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.14.0)
rubocop-ast (1.15.0)
parser (>= 3.0.1.1)
rubocop-rails (2.12.4)
activesupport (>= 4.2.0)
Expand Down Expand Up @@ -295,18 +274,16 @@ GEM
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.1)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sshkit (1.21.2)
net-scp (>= 1.1.2)
net-ssh (>= 2.8.0)
temple (0.8.2)
thor (1.1.0)
tilt (2.0.10)
turbo-rails (0.9.0)
rails (>= 6.0.0)
turbo-rails (0.9.1)
actionpack (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (2.1.0)
Expand Down Expand Up @@ -344,11 +321,6 @@ PLATFORMS
DEPENDENCIES
bootsnap (>= 1.4.2)
byebug
capistrano
capistrano-bundler
capistrano-rails
capistrano-rvm
capistrano3-puma
capybara (>= 2.15)
config
database_cleaner
Expand Down Expand Up @@ -380,7 +352,7 @@ DEPENDENCIES
yard

RUBY VERSION
ruby 3.0.2p107
ruby 3.0.3p157

BUNDLED WITH
2.2.22
2.2.32
11 changes: 11 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,24 @@
# This controller contain the methods shared for all controller
class ApplicationController < ActionController::Base
include Pagy::Backend
around_action :switch_locale

def default_url_options
{ locale: I18n.locale }
end

# rescue_from ActiveRecord::RecordNotFound do
# record_not_found!
# end

private


def switch_locale(&action)
locale = params[:locale] || I18n.default_locale
I18n.with_locale(locale, &action)
end

# Render 404 page and stop the work
# @return [nil]
def record_not_found!
Expand Down
7 changes: 6 additions & 1 deletion app/javascript/controllers/page_controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Controller } from "stimulus"

export default class extends Controller {
static targets = [ "container", "menu"]
static targets = [ "container", "menu", "modal"]

goPage(event) {
let [data, status, xhr] = event.detail
Expand All @@ -12,4 +12,9 @@ export default class extends Controller {
this.menuTarget.classList.toggle('is-active')
//document.getElementById(event.target.dataset.id).classList.toggle('is-active')
}

closeModal(event) {
[].forEach.call(document.getElementsByClassName('modal'), (item) => {item.classList.remove('is-active')})
if ( document.getElementById("yield") == null) { window.location.replace("/") }
}
}
4 changes: 4 additions & 0 deletions app/javascript/packs/awesome.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import {
faExclamationTriangle,
faFileCsv,
faFilePdf,
faGlobe,
faHeading,
faHome,
faLink,
faMapMarker,
faPlus,
faRss,
faSave,
faSearch,
faSignature,
Expand Down Expand Up @@ -47,10 +49,12 @@ library.add(
faExclamationTriangle,
faFileCsv,
faFilePdf,
faGlobe,
faHome,
faLink,
faMapMarker,
faPlus,
faRss,
faSave,
faSearch,
faSignature,
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/users/edit.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@

.has-text-centered
= link_to fas_icon('chevron-left', text: 'Indietro'), admin_user_path(@user), class: 'button is-link'
= f.button fas_icon('save', text: 'Salva'), class: 'button is-success'
= f.button fas_icon('save', text: t('site.generic.save')), class: 'button is-success'
Loading

0 comments on commit 4291b03

Please sign in to comment.