Add Quantities tab

This commit is contained in:
cryptogopher 2025-01-05 03:18:39 +01:00
parent 141d67ad21
commit b3aea97087
11 changed files with 30 additions and 5 deletions

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" id="icon" viewBox="0 0 24 24"><path d="M12,2L16,6H13V13.85L19.53,17.61L21,15.03L22.5,20.5L17,21.96L18.53,19.35L12,15.58L5.47,19.35L7,21.96L1.5,20.5L3,15.03L4.47,17.61L11,13.85V6H8L12,2Z" /></svg>

After

Width:  |  Height:  |  Size: 236 B

View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" id="icon" viewBox="0 0 24 24"><path d="M19.95,10.56C19.75,9.67 18.95,9 18,9H15.46C15.81,8.41 16,7.73 16,7A4,4 0 0,0 12,3A4,4 0 0,0 8,7C8,7.73 8.19,8.41 8.54,9H6C5.05,9 4.25,9.67 4.05,10.56C2.04,18.57 2,18.78 2,19A2,2 0 0,0 4,21H20A2,2 0 0,0 22,19C22,18.78 21.96,18.57 19.95,10.56M12,5A2,2 0 0,1 14,7A2,2 0 0,1 12,9A2,2 0 0,1 10,7A2,2 0 0,1 12,5M15,13H11V17H13V14H15V19H11C9.89,19 9,18.11 9,17V13C9,11.89 9.89,11 11,11H15V13Z" /></svg>

After

Width:  |  Height:  |  Size: 475 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" id="icon" viewBox="0 0 24 24"><path d="M12,3A4,4 0 0,1 16,7C16,7.73 15.81,8.41 15.46,9H18C18.95,9 19.75,9.67 19.95,10.56C21.96,18.57 22,18.78 22,19A2,2 0 0,1 20,21H4A2,2 0 0,1 2,19C2,18.78 2.04,18.57 4.05,10.56C4.25,9.67 5.05,9 6,9H8.54C8.19,8.41 8,7.73 8,7A4,4 0 0,1 12,3M12,5A2,2 0 0,0 10,7A2,2 0 0,0 12,9A2,2 0 0,0 14,7A2,2 0 0,0 12,5M6,11V19H8V16.5L9,17.5V19H11V17L9,15L11,13V11H9V12.5L8,13.5V11H6M15,11C13.89,11 13,11.89 13,13V17C13,18.11 13.89,19 15,19H18V14H16V17H15V13H18V11H15Z" /></svg>

Before

Width:  |  Height:  |  Size: 537 B

View File

@ -0,0 +1,2 @@
class QuantitiesController < ApplicationController
end

View File

@ -125,8 +125,9 @@ module ApplicationHelper
def navigation_menu def navigation_menu
menu_tabs = [ menu_tabs = [
['units', "weight-kilogram", :restricted, 'right'], ['quantities', 'axis-arrow', :restricted, 'right'],
['users', "account-multiple-outline", :admin], ['units', 'weight-gram', :restricted],
['users', 'account-multiple-outline', :admin],
] ]
menu_tabs.map do |name, image, status, css_class| menu_tabs.map do |name, image, status, css_class|

View File

@ -0,0 +1,2 @@
module QuantitiesHelper
end

View File

@ -0,0 +1,2 @@
module UnitsHelper
end

View File

@ -53,6 +53,8 @@ en:
revert: Revert revert: Revert
sign_out: Sign out sign_out: Sign out
source_code: Get code source_code: Get code
quantities:
navigation: Quantities
units: units:
navigation: Units navigation: Units
no_items: There are no configured units. You can Add some or Import from defaults. no_items: There are no configured units. You can Add some or Import from defaults.

View File

@ -1,6 +1,5 @@
Rails.application.routes.draw do Rails.application.routes.draw do
devise_for :users, path: '', path_names: {registration: 'profile'}, resources :quantities
controllers: {registrations: :registrations}
resources :units, except: [:show], path_names: {new: '(/:id)/new'} do resources :units, except: [:show], path_names: {new: '(/:id)/new'} do
member { post :rebase } member { post :rebase }
@ -13,6 +12,8 @@ Rails.application.routes.draw do
end end
end end
devise_for :users, path: '', path_names: {registration: 'profile'},
controllers: {registrations: :registrations}
resources :users, only: [:index, :show, :update] do resources :users, only: [:index, :show, :update] do
member { get :disguise } member { get :disguise }
collection { get :revert } collection { get :revert }

View File

@ -0,0 +1,7 @@
require "test_helper"
class QuantitiesControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require "test_helper"
class UnitsControllerTest < ActionDispatch::IntegrationTest
# test "the truth" do
# assert true
# end
end