aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/assets/images/favicon.icobin0 -> 1406 bytes
-rw-r--r--app/controllers/referentials_controller.rb1
-rw-r--r--app/inputs/full_time_zone_input.rb21
-rw-r--r--app/models/referential.rb5
-rw-r--r--app/views/companies/edit.html.slim7
-rw-r--r--app/views/companies/new.html.slim3
-rw-r--r--app/views/layouts/application.html.slim2
-rw-r--r--app/views/workbenches/show.html.slim5
8 files changed, 32 insertions, 12 deletions
diff --git a/app/assets/images/favicon.ico b/app/assets/images/favicon.ico
new file mode 100644
index 000000000..ac6bc298d
--- /dev/null
+++ b/app/assets/images/favicon.ico
Binary files differ
diff --git a/app/controllers/referentials_controller.rb b/app/controllers/referentials_controller.rb
index 8addfbc32..80f954cde 100644
--- a/app/controllers/referentials_controller.rb
+++ b/app/controllers/referentials_controller.rb
@@ -136,7 +136,6 @@ class ReferentialsController < ChouetteController
def create_resource(referential)
referential.organisation = current_organisation
- referential.ready = true
super
end
diff --git a/app/inputs/full_time_zone_input.rb b/app/inputs/full_time_zone_input.rb
index f5d8a9ba2..6138d17f5 100644
--- a/app/inputs/full_time_zone_input.rb
+++ b/app/inputs/full_time_zone_input.rb
@@ -1,7 +1,20 @@
class FullTimeZoneInput < SimpleForm::Inputs::CollectionSelectInput
def collection
@collection ||= begin
- collection = options.delete(:collection) || ActiveSupport::TimeZone::MAPPING
+ collection = options.delete(:collection) || begin
+ coll = {}
+
+ TZInfo::Timezone.all_data_zones.map do |tzinfo|
+ # v = ActiveSupport::TimeZone.zones_map[k]
+ # coll.sort_by do |v|
+ # "(#{v.formatted_offset}) #{v.name}"
+ # end
+ next if tzinfo.friendly_identifier =~ /^etc/i
+ tz = ActiveSupport::TimeZone.new tzinfo.name#, nil, tzinfo
+ coll[[tz.utc_offset, tzinfo.friendly_identifier(true)]] = ["(#{tz.formatted_offset}) #{tzinfo.friendly_identifier(true)}", tz.name]
+ end
+ coll.sort.map(&:last)
+ end
collection.respond_to?(:call) ? collection.call : collection.to_a
end
end
@@ -9,12 +22,8 @@ class FullTimeZoneInput < SimpleForm::Inputs::CollectionSelectInput
def detect_collection_methods
label, value = options.delete(:label_method), options.delete(:value_method)
- label ||= ->(tz) do
- tz = ActiveSupport::TimeZone[tz.last]
- "(#{tz.formatted_offset}) #{tz.name}"
- end
+ label ||= :first
value ||= :last
-
[label, value]
end
diff --git a/app/models/referential.rb b/app/models/referential.rb
index 933bc78e3..b4f64fad1 100644
--- a/app/models/referential.rb
+++ b/app/models/referential.rb
@@ -59,7 +59,6 @@ class Referential < ApplicationModel
belongs_to :referential_suite
-
scope :pending, -> { where(ready: false, failed_at: nil, archived_at: nil) }
scope :active, -> { where(ready: true, failed_at: nil, archived_at: nil) }
scope :failed, -> { where.not(failed_at: nil) }
@@ -271,7 +270,8 @@ class Referential < ApplicationModel
stop_area_referential: from.stop_area_referential,
created_from: from,
objectid_format: from.objectid_format,
- metadatas: from.metadatas.map { |m| ReferentialMetadata.new_from(m, organisation) }
+ metadatas: from.metadatas.map { |m| ReferentialMetadata.new_from(m, organisation) },
+ ready: false
)
end
@@ -471,6 +471,7 @@ class Referential < ApplicationModel
end
def destroy_schema
+ return unless ActiveRecord::Base.connection.schema_names.include?(slug)
Apartment::Tenant.drop slug
end
diff --git a/app/views/companies/edit.html.slim b/app/views/companies/edit.html.slim
index faa88f829..c85bef0ec 100644
--- a/app/views/companies/edit.html.slim
+++ b/app/views/companies/edit.html.slim
@@ -1,3 +1,8 @@
- breadcrumb :company, @company
- page_header_content_for @company
-= render 'form' \ No newline at end of file
+
+.page_content
+ .container-fluid
+ .row
+ .col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
+ = render 'form'
diff --git a/app/views/companies/new.html.slim b/app/views/companies/new.html.slim
index 1747b8e10..6cc32130d 100644
--- a/app/views/companies/new.html.slim
+++ b/app/views/companies/new.html.slim
@@ -1,6 +1,7 @@
- breadcrumb :companies, @line_referential
+
.page_content
.container-fluid
.row
.col-lg-8.col-lg-offset-2.col-md-8.col-md-offset-2.col-sm-10.col-sm-offset-1
- = render 'form' \ No newline at end of file
+ = render 'form'
diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim
index abf39c089..596627996 100644
--- a/app/views/layouts/application.html.slim
+++ b/app/views/layouts/application.html.slim
@@ -8,6 +8,8 @@ html lang=I18n.locale
title = t('brandname')
+ = favicon_link_tag
+
= stylesheet_link_tag 'base'
= stylesheet_link_tag 'application'
diff --git a/app/views/workbenches/show.html.slim b/app/views/workbenches/show.html.slim
index b0276c5ce..213c9e5f2 100644
--- a/app/views/workbenches/show.html.slim
+++ b/app/views/workbenches/show.html.slim
@@ -62,7 +62,10 @@
attribute: Proc.new {|w| w.merged_at ? l(w.merged_at, format: :short) : '-'} \
) \
],
- selectable: ->(ref){ @workbench.referentials.include?(ref) },
+ selectable: ->(ref) { \
+ @workbench.referentials.include?(ref) && \
+ !ref.pending? \
+ },
cls: 'table has-filter has-search',
action: :index