ditty 0.10.1 → 0.10.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e785b1b4a84258a46e98753a5de394897bc6d002b88d2fc6629b30b33b52614e
4
- data.tar.gz: '094a55847cc4ec09bf1dc9307c9efcffa5b59b498fd407de5950e656e5a5e516'
3
+ metadata.gz: 0ef6903491ad20b85916f196652705811820c13f3ed14552fc9b35687dbe7309
4
+ data.tar.gz: 1431f00aee5e7093757936e5b12231d091d41bcfb798dda53e534d289f43c5dc
5
5
  SHA512:
6
- metadata.gz: fa7d54c43ac02d1f04a690f2bca5a529b3c65eefa0f287ab44594910bca2b8022656b58e2aef805a52307364481c35be2ba1b1e4b3a97b3450cab1b9acb27d1f
7
- data.tar.gz: 847143f0f0d20c67b3451a86e780ec44b914210ceec4498c9218ebc05f7f7277107b1998ca5f273aad0ad1ad45ceb051b81204fe87e6cb91e88ee2ef6af7b49c
6
+ metadata.gz: b8383f78d50a4b1a2379b34f5ea81969fc019130dd953e7218d499a7596217ea12eef13d804de7b888da7145fc865bb3e798453f664597951f953df5a06eec00
7
+ data.tar.gz: c36d004df0b9ce15aba2fbf99f376fef6fa5f70a2cc4338163cd360c730f2398ab4a5b3b0c29362ba20a90502397475aa4b4a1769b3acb9f50965eae371b680a
data/lib/ditty/cli.rb CHANGED
@@ -31,6 +31,7 @@ module Ditty
31
31
  require './application' if File.exist?('application.rb')
32
32
  require 'ditty/db' unless defined?(DB)
33
33
  ::Ditty::Components.tasks
34
+
34
35
  def server
35
36
  # Ensure the token files are present
36
37
  Rake::Task['ditty:generate_tokens'].invoke
@@ -47,8 +48,14 @@ module Ditty
47
48
  Rake::Task['ditty:seed'].invoke
48
49
 
49
50
  # RackUP!
51
+ rack_opts = {
52
+ environment: ENV['APP_ENV'] || 'development',
53
+ Port: ENV['APP_PORT'] || 9292,
54
+ Host: ENV['APP_HOST'] || '0.0.0.0',
55
+ config: "config.ru"
56
+ }
50
57
  puts 'Starting the Ditty Server'
51
- Rack::Server.start(config: 'config.ru')
58
+ Rack::Server.start(rack_opts)
52
59
  end
53
60
 
54
61
  desc 'migrate', 'Run the Ditty migrations'
@@ -36,7 +36,6 @@ module Ditty
36
36
 
37
37
  register Sinatra::Flash, Sinatra::RespondWith
38
38
 
39
- use Rack::Csrf, raise: ENV['APP_ENV'] == 'development' unless ENV['APP_ENV'] == 'test'
40
39
  use Rack::JSONBodyParser
41
40
  use Rack::MethodOverride
42
41
  use Rack::NestedParams
@@ -7,6 +7,8 @@ require 'sinatra/json'
7
7
 
8
8
  module Ditty
9
9
  class ComponentController < ApplicationController
10
+ use Rack::Csrf, raise: ENV['APP_ENV'] == 'development' unless ENV['APP_ENV'] == 'test'
11
+
10
12
  helpers Helpers::Component, Helpers::Response
11
13
 
12
14
  set base_path: nil
@@ -71,7 +71,7 @@ module Ditty
71
71
  template = File.expand_path("./views/#{file}.haml")
72
72
  return template if File.file? template
73
73
 
74
- template = File.expand_path("./#{file}.haml", App.view_folder)
74
+ template = File.expand_path("./#{file}.haml", ::Ditty::Ditty.view_folder)
75
75
  return template if File.file? template
76
76
 
77
77
  file
@@ -37,6 +37,10 @@ module Ditty
37
37
  }
38
38
  end
39
39
 
40
+ def uid
41
+ user&.id
42
+ end
43
+
40
44
  # Validation
41
45
  def validate
42
46
  super
@@ -7,6 +7,16 @@ logger:
7
7
  class: Logger
8
8
  level: DEBUG
9
9
  options: logs/<%%= ENV['APP_ENV'] %>.log
10
+ # email:
11
+ # from_address: 'no-reply@ditty.io'
12
+ # delivery_method: smtp
13
+ # options:
14
+ # address: smtp.server
15
+ # port: 25
16
+ # user_name: 'SMTPUSERNAME'
17
+ # password: 'SMTPPASSWORD'
18
+ # authentication: login
19
+ # enable_starttls_auto: true
10
20
  # authentication:
11
21
  # google_oauth2:
12
22
  # login_prompt: Log in with Google
data/lib/ditty/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ditty
4
- VERSION = '0.10.1'
4
+ VERSION = '0.10.2'
5
5
  end
@@ -3,11 +3,4 @@
3
3
  .container.my-auto
4
4
  -if ENV['SKIP_BRANDING'].blank?
5
5
  .copyright.text-center.my-auto.text-dark
6
- %p
7
- Copyright &copy;
8
- %a{ href: 'https://hackerpla.net/requestd', target: '_blank' }
9
- HackerPlanet
10
- 2020
11
- %p.mb-0
12
- %a{ href: 'https://hackerpla.net/requestd', target: '_blank' }
13
- %img.rounded{ src: 'http://hackerpla.net/wp-content/uploads/2014/07/HP_1C_128x128.png', height: 60 }
6
+ %span Copyright &copy; Ditty.io 2019
@@ -21,8 +21,8 @@
21
21
  - users = user_options.select { |k, v| entity.users.map(&:id).include?(k) == false }
22
22
  - if users && users.count.positive?
23
23
  = new_form_tag "#{base_path}/#{entity.display_id}/users" do
24
- .input-group
25
- %select.form-control{ name: "#{group}[user_id]", id: 'user_id' }
24
+ .input-group.tall-select2
25
+ %select.form-control.select2{ name: "#{group}[user_id]", id: 'user_id' }
26
26
  %option{ value: '' } Select User
27
27
  - users.each do |key, value|
28
28
  %option{ value: key }= value
@@ -1,4 +1,4 @@
1
1
  = form_control(:name, user)
2
2
  = form_control(:surname, user)
3
3
  - if policy(user).permitted_attributes.include? :role_id
4
- = form_control(:role_id, user, type: 'select', options: Ditty::Role.order(:name).as_hash(:id, :name), name: 'user[role_id][]', value: user.new? ? [] : user.roles_dataset.map(:id), multiple: true)
4
+ = form_control(:role_id, user, type: 'select', options: Ditty::Role.select(:id, :name).order(:name).as_hash(:id, :name), name: 'user[role_id][]', value: user.new? ? [] : user.roles_dataset.map(:id), multiple: true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ditty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jurgens du Toit
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-21 00:00:00.000000000 Z
11
+ date: 2021-09-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -733,7 +733,6 @@ files:
733
733
  - views/partials/search.haml
734
734
  - views/partials/sidebar.haml
735
735
  - views/partials/sort_ui.haml
736
- - views/partials/timespan_selector.haml
737
736
  - views/partials/topbar.haml
738
737
  - views/partials/user_associations.haml
739
738
  - views/quick_start.haml
@@ -1,64 +0,0 @@
1
- - if defined?(context)
2
- - if context.interval
3
- %li.nav-item.dropdown.no-arrow
4
- %a#intervalDropdown.nav-link.dropdown-toggle{ href: '#', role: 'button', 'aria-haspopup': 'true', 'area-expanded': 'false', 'data-toggle': 'dropdown' }
5
- %span.mr-2.d-none.d-lg-inline.text-gray-600
6
- Interval /
7
- %strong
8
- = context.interval
9
- .dropdown-menu.dropdown-menu-right.shadow.animated--grow-in{ 'aria-labelledby': 'intervalDropdown' }
10
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(interval: '1m'))}", class: context.interval == '1m' ? 'active' : '' }
11
- 1 Minute
12
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(interval: '5m'))}", class: context.interval == '5m' ? 'active' : '' }
13
- 5 Minutes
14
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(interval: '15m'))}", class: context.interval == '15m' ? 'active' : '' }
15
- 15 Minutes
16
- .dropdown-divider
17
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(interval: '1h'))}", class: context.interval == '1h' ? 'active' : '' }
18
- 1 Hour
19
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(interval: '3h'))}", class: context.interval == '3h' ? 'active' : '' }
20
- 3 Hours
21
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(interval: '6h'))}", class: context.interval == '6h' ? 'active' : '' }
22
- 6 Hours
23
- .dropdown-divider
24
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(interval: '1d'))}", class: context.interval == '1d' ? 'active' : '' }
25
- 1 Day
26
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(interval: '2d'))}", class: context.interval == '2d' ? 'active' : '' }
27
- 2 Days
28
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(interval: '1w'))}", class: context.interval == '1w' ? 'active' : '' }
29
- 1 Week
30
-
31
- - if context.timespan
32
- %li.nav-item.dropdown.no-arrow
33
- %a#timespanDropdown.nav-link.dropdown-toggle{ href: '#', role: 'button', 'aria-haspopup': 'true', 'area-expanded': 'false', 'data-toggle': 'dropdown' }
34
- %span.mr-2.d-none.d-lg-inline.text-gray-600
35
- Timespan /
36
- %strong
37
- = context.timespan.split('/').first
38
- .dropdown-menu.dropdown-menu-right.shadow.animated--grow-in{ 'aria-labelledby': 'timespanDropdown' }
39
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(timespan: '1h', interval: ''))}", class: context.timespan == '1h' ? 'active' : '' }
40
- %i.fas.fa-chevron-right.fa-sm.fa-fw.mr-2.text-gray-400
41
- 1 Hour
42
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(timespan: '1d', interval: ''))}", class: context.timespan == '1d' ? 'active' : '' }
43
- %i.fas.fa-chevron-right.fa-sm.fa-fw.mr-2.text-gray-400
44
- 1 Day
45
- .dropdown-divider
46
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(timespan: '1w/d', interval: ''))}", class: context.timespan == '1w/d' ? 'active' : '' }
47
- %i.fas.fa-chevron-right.fa-sm.fa-fw.mr-2.text-gray-400
48
- 1 Week
49
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(timespan: '2w/d', interval: ''))}", class: context.timespan == '2w/d' ? 'active' : '' }
50
- %i.fas.fa-chevron-right.fa-sm.fa-fw.mr-2.text-gray-400
51
- 2 Weeks
52
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(timespan: '1M/d', interval: ''))}", class: context.timespan == '1M/d' ? 'active' : '' }
53
- %i.fas.fa-chevron-right.fa-sm.fa-fw.mr-2.text-gray-400
54
- 1 Month
55
- .dropdown-divider
56
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(timespan: '3M/d', interval: ''))}", class: context.timespan == '3M/d' ? 'active' : '' }
57
- %i.fas.fa-chevron-right.fa-sm.fa-fw.mr-2.text-gray-400
58
- 3 Months
59
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(timespan: '6M/d', interval: ''))}", class: context.timespan == '6M/d' ? 'active' : '' }
60
- %i.fas.fa-chevron-right.fa-sm.fa-fw.mr-2.text-gray-400
61
- 6 Months
62
- %a.dropdown-item{ href: "?#{URI.encode_www_form(and_params.merge(timespan: '1y/d', interval: ''))}", class: context.timespan == '1y/d' ? 'active' : '' }
63
- %i.fas.fa-chevron-right.fa-sm.fa-fw.mr-2.text-gray-400
64
- 1 Year