edgarj 4.06.09 → 4.06.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/app/controllers/edgarj/edgarj_controller.rb +5 -3
 - data/app/helpers/edgarj/assoc_helper.rb +11 -33
 - data/app/helpers/edgarj/form_drawer.rb +1 -4
 - data/app/models/edgarj/page_info.rb +1 -1
 - data/lib/edgarj/engine.rb +4 -11
 - data/lib/edgarj/version.rb +1 -1
 - metadata +5 -19
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: a903fc5f0f33be670bc43b83e7cf4688733a964ffaa19945f709b20e8e92ced9
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 9546ae4a090b925449e88ce6654bdac0f03232dc40adc38634645084d6d8cdf1
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 8fc02a00e1a6ac4fcd987a322db68718dd33c2aa5759109fba64b1559e70a840dedf38b0d83f3a48d57975e65e08dbe15faf85062b1e120fb4f540d4b50b6f69
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 72824a2d4968d5fd801ad86dc0e7e4e2690f28217496b701c92a91603ffb55e6293f8d9809403ccbf68a399ed516fe6b6f139eb41d49a874824de4faa44abfcf
         
     | 
| 
         @@ -327,10 +327,13 @@ module Edgarj 
     | 
|
| 
       327 
327 
     | 
    
         
             
                # FIXME: file.close(true) deletes files *BEFORE* actually send file
         
     | 
| 
       328 
328 
     | 
    
         
             
                # so that comment it out.  Need to clean these work files.
         
     | 
| 
       329 
329 
     | 
    
         
             
                def csv_download
         
     | 
| 
      
 330 
     | 
    
         
            +
                  dir = '/tmp/edgarj/csv_download'
         
     | 
| 
      
 331 
     | 
    
         
            +
                  FileUtils.mkdir_p(dir)
         
     | 
| 
      
 332 
     | 
    
         
            +
             
     | 
| 
       330 
333 
     | 
    
         
             
                  filename    = sprintf("%s-%s.csv",
         
     | 
| 
       331 
334 
     | 
    
         
             
                                    model_name,
         
     | 
| 
       332 
335 
     | 
    
         
             
                                    Time.now.strftime("%Y%m%d-%H%M%S"))
         
     | 
| 
       333 
     | 
    
         
            -
                  file        = Tempfile.new(filename,  
     | 
| 
      
 336 
     | 
    
         
            +
                  file        = Tempfile.new(filename, dir)
         
     | 
| 
       334 
337 
     | 
    
         
             
                  csv_visitor = EdgarjHelper::CsvVisitor.new(view_context)
         
     | 
| 
       335 
338 
     | 
    
         
             
                  file.write CSV.generate_line(model.columns.map{|c| c.name})
         
     | 
| 
       336 
339 
     | 
    
         
             
                  for rec in user_scoped.where(page_info.record.conditions).
         
     | 
| 
         @@ -344,8 +347,7 @@ module Edgarj 
     | 
|
| 
       344 
347 
     | 
    
         
             
                    end
         
     | 
| 
       345 
348 
     | 
    
         
             
                    file.write CSV.generate_line(array)
         
     | 
| 
       346 
349 
     | 
    
         
             
                  end
         
     | 
| 
       347 
     | 
    
         
            -
                  file.close 
     | 
| 
       348 
     | 
    
         
            -
                  File.chmod(Settings.edgarj.csv_permission, file.path)
         
     | 
| 
      
 350 
     | 
    
         
            +
                  file.close
         
     | 
| 
       349 
351 
     | 
    
         
             
                  send_file(file.path, {
         
     | 
| 
       350 
352 
     | 
    
         
             
                      type:     'text/csv',
         
     | 
| 
       351 
353 
     | 
    
         
             
                      filename: filename})
         
     | 
| 
         @@ -164,7 +164,7 @@ module Edgarj 
     | 
|
| 
       164 
164 
     | 
    
         | 
| 
       165 
165 
     | 
    
         
             
                  link_to(
         
     | 
| 
       166 
166 
     | 
    
         
             
                      draw_belongs_to_label_sub(model, col.name, parent_model).html_safe +
         
     | 
| 
       167 
     | 
    
         
            -
                       
     | 
| 
      
 167 
     | 
    
         
            +
                      '<span class="edgarj_field_belongs_to_button">選択</span>'.html_safe,
         
     | 
| 
       168 
168 
     | 
    
         
             
                      popup_path,
         
     | 
| 
       169 
169 
     | 
    
         
             
                      remote: true)
         
     | 
| 
       170 
170 
     | 
    
         
             
                end
         
     | 
| 
         @@ -177,16 +177,7 @@ module Edgarj 
     | 
|
| 
       177 
177 
     | 
    
         
             
                # popup_field:: Edgarj::PopupHelper::PopupField object
         
     | 
| 
       178 
178 
     | 
    
         
             
                # parent_name:: initial parent name
         
     | 
| 
       179 
179 
     | 
    
         
             
                def draw_belongs_to_clear_link(f, col_name, popup_field, parent_name, default_label)
         
     | 
| 
       180 
     | 
    
         
            -
                   
     | 
| 
       181 
     | 
    
         
            -
                    f.hidden_field(col_name)
         
     | 
| 
       182 
     | 
    
         
            -
                  else
         
     | 
| 
       183 
     | 
    
         
            -
                    ('  ' +
         
     | 
| 
       184 
     | 
    
         
            -
                        link_to("[#{I18n.t('edgarj.default.clear')}]", '#',
         
     | 
| 
       185 
     | 
    
         
            -
                            onClick:  "Edgarj.Popup.clear('#{j(popup_field.id_target)}','#{j(default_label)}'); return false;",
         
     | 
| 
       186 
     | 
    
         
            -
                            id:       popup_field.clear_link,
         
     | 
| 
       187 
     | 
    
         
            -
                            style:    'display:' + (parent_name.blank? ? 'none' : '')) +
         
     | 
| 
       188 
     | 
    
         
            -
                        f.hidden_field(col_name)).html_safe
         
     | 
| 
       189 
     | 
    
         
            -
                  end
         
     | 
| 
      
 180 
     | 
    
         
            +
                  f.hidden_field(col_name)
         
     | 
| 
       190 
181 
     | 
    
         
             
                end
         
     | 
| 
       191 
182 
     | 
    
         | 
| 
       192 
183 
     | 
    
         
             
                # draw 'belongs_to' popup data-entry field
         
     | 
| 
         @@ -211,30 +202,17 @@ module Edgarj 
     | 
|
| 
       211 
202 
     | 
    
         
             
                  label = content_tag(:span,
         
     | 
| 
       212 
203 
     | 
    
         
             
                      parent_obj ? parent_obj.name : default_label.html_safe,
         
     | 
| 
       213 
204 
     | 
    
         
             
                      id: popup_field.label_target)
         
     | 
| 
       214 
     | 
    
         
            -
                  link_tag =  
     | 
| 
      
 205 
     | 
    
         
            +
                  link_tag = '<span class="edgarj_field_belongs_to_button">選択</span>'.html_safe
         
     | 
| 
       215 
206 
     | 
    
         
             
                  if parent_obj
         
     | 
| 
       216 
     | 
    
         
            -
                     
     | 
| 
       217 
     | 
    
         
            -
             
     | 
| 
       218 
     | 
    
         
            -
             
     | 
| 
       219 
     | 
    
         
            -
             
     | 
| 
       220 
     | 
    
         
            -
                          remote: true)
         
     | 
| 
       221 
     | 
    
         
            -
                    else
         
     | 
| 
       222 
     | 
    
         
            -
                      link_to(label,
         
     | 
| 
       223 
     | 
    
         
            -
                          # TODO: Hardcoded 'master' prefix should be fixed
         
     | 
| 
       224 
     | 
    
         
            -
                          controller: url_prefix + parent_obj.class.name.underscore.pluralize,
         
     | 
| 
       225 
     | 
    
         
            -
                          action:     'show',
         
     | 
| 
       226 
     | 
    
         
            -
                          id:         parent_obj,
         
     | 
| 
       227 
     | 
    
         
            -
                          topic_path: 'add')
         
     | 
| 
       228 
     | 
    
         
            -
                    end
         
     | 
| 
      
 207 
     | 
    
         
            +
                    link_to(
         
     | 
| 
      
 208 
     | 
    
         
            +
                        label + link_tag,
         
     | 
| 
      
 209 
     | 
    
         
            +
                        popup_path,
         
     | 
| 
      
 210 
     | 
    
         
            +
                        remote: true)
         
     | 
| 
       229 
211 
     | 
    
         
             
                  else
         
     | 
| 
       230 
     | 
    
         
            -
                     
     | 
| 
       231 
     | 
    
         
            -
             
     | 
| 
       232 
     | 
    
         
            -
             
     | 
| 
       233 
     | 
    
         
            -
             
     | 
| 
       234 
     | 
    
         
            -
                          remote: true)
         
     | 
| 
       235 
     | 
    
         
            -
                    else
         
     | 
| 
       236 
     | 
    
         
            -
                      label
         
     | 
| 
       237 
     | 
    
         
            -
                    end
         
     | 
| 
      
 212 
     | 
    
         
            +
                    link_to(
         
     | 
| 
      
 213 
     | 
    
         
            +
                        label + link_tag,
         
     | 
| 
      
 214 
     | 
    
         
            +
                        popup_path,
         
     | 
| 
      
 215 
     | 
    
         
            +
                        remote: true)
         
     | 
| 
       238 
216 
     | 
    
         
             
                  end +
         
     | 
| 
       239 
217 
     | 
    
         
             
                  draw_belongs_to_clear_link(f, col.name, popup_field,
         
     | 
| 
       240 
218 
     | 
    
         
             
                      parent_obj && parent_obj.name,
         
     | 
| 
         @@ -157,10 +157,7 @@ module Edgarj 
     | 
|
| 
       157 
157 
     | 
    
         | 
| 
       158 
158 
     | 
    
         
             
                  # draw 'belongs_to' field for AR
         
     | 
| 
       159 
159 
     | 
    
         
             
                  def _draw_belongs_to_field(parent_model, col)
         
     | 
| 
       160 
     | 
    
         
            -
                     
     | 
| 
       161 
     | 
    
         
            -
                        nil :
         
     | 
| 
       162 
     | 
    
         
            -
                        @vc.draw_belongs_to_label(@f, @drawer.popup_path(col), col.name)
         
     | 
| 
       163 
     | 
    
         
            -
                    _draw_head(col, label){
         
     | 
| 
      
 160 
     | 
    
         
            +
                    _draw_head(col, nil){
         
     | 
| 
       164 
161 
     | 
    
         
             
                      @vc.draw_belongs_to_field(@f, @drawer.popup_path(col), col.name)
         
     | 
| 
       165 
162 
     | 
    
         
             
                    }
         
     | 
| 
       166 
163 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/edgarj/engine.rb
    CHANGED
    
    | 
         @@ -8,15 +8,6 @@ module Edgarj 
     | 
|
| 
       8 
8 
     | 
    
         
             
                  g.templates.unshift File::expand_path('../templates', __FILE__)
         
     | 
| 
       9 
9 
     | 
    
         
             
                end
         
     | 
| 
       10 
10 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
                # load this engine's config
         
     | 
| 
       12 
     | 
    
         
            -
                # (rails_config default loads from only Rails.root/config/...)
         
     | 
| 
       13 
     | 
    
         
            -
                def self.load_config
         
     | 
| 
       14 
     | 
    
         
            -
                  engine_config_dir = Pathname.new(File.expand_path('../../../config', __FILE__))
         
     | 
| 
       15 
     | 
    
         
            -
                  Settings.prepend_source!((engine_config_dir + 'settings.yml').to_s)
         
     | 
| 
       16 
     | 
    
         
            -
                  Settings.prepend_source!((engine_config_dir + "settings/#{Rails.env}.yml").to_s)
         
     | 
| 
       17 
     | 
    
         
            -
                  Settings.reload!
         
     | 
| 
       18 
     | 
    
         
            -
                end
         
     | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
11 
     | 
    
         
             
                # Require/load application side edgarj config in RAILS_ROOT/config/edgarj/
         
     | 
| 
       21 
12 
     | 
    
         
             
                def self.load_edgarj_conf_in_app
         
     | 
| 
       22 
13 
     | 
    
         
             
                  [
         
     | 
| 
         @@ -45,14 +36,16 @@ module Edgarj 
     | 
|
| 
       45 
36 
     | 
    
         | 
| 
       46 
37 
     | 
    
         
             
                # make edgarj related work directories
         
     | 
| 
       47 
38 
     | 
    
         
             
                def self.make_work_dir
         
     | 
| 
       48 
     | 
    
         
            -
                   
     | 
| 
      
 39 
     | 
    
         
            +
                  work_dirs = [
         
     | 
| 
      
 40 
     | 
    
         
            +
                    Rails.root + 'tmp/edgarj'
         
     | 
| 
      
 41 
     | 
    
         
            +
                  ]
         
     | 
| 
      
 42 
     | 
    
         
            +
                  for dir in work_dirs do
         
     | 
| 
       49 
43 
     | 
    
         
             
                    FileUtils.mkdir_p(dir) if !File.directory?(dir)
         
     | 
| 
       50 
44 
     | 
    
         
             
                  end
         
     | 
| 
       51 
45 
     | 
    
         
             
                end
         
     | 
| 
       52 
46 
     | 
    
         | 
| 
       53 
47 
     | 
    
         
             
                initializer "edgarj" do
         
     | 
| 
       54 
48 
     | 
    
         
             
                  ActiveRecord::SessionStore::Session.table_name = 'edgarj_sssns'
         
     | 
| 
       55 
     | 
    
         
            -
                  Engine::load_config
         
     | 
| 
       56 
49 
     | 
    
         
             
                  Engine::load_edgarj_conf_in_app
         
     | 
| 
       57 
50 
     | 
    
         
             
                  Engine::load_decorators
         
     | 
| 
       58 
51 
     | 
    
         
             
                  for file in Dir.glob(File.join(File.dirname(__FILE__), "../../locale/*.yml")) do
         
     | 
    
        data/lib/edgarj/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: edgarj
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 4.06. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 4.06.10
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Fuminori Ido
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2024-07- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2024-07-31 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rails
         
     | 
| 
         @@ -64,20 +64,6 @@ dependencies: 
     | 
|
| 
       64 
64 
     | 
    
         
             
                - - "<"
         
     | 
| 
       65 
65 
     | 
    
         
             
                  - !ruby/object:Gem::Version
         
     | 
| 
       66 
66 
     | 
    
         
             
                    version: '7'
         
     | 
| 
       67 
     | 
    
         
            -
            - !ruby/object:Gem::Dependency
         
     | 
| 
       68 
     | 
    
         
            -
              name: config
         
     | 
| 
       69 
     | 
    
         
            -
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
       70 
     | 
    
         
            -
                requirements:
         
     | 
| 
       71 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       72 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       73 
     | 
    
         
            -
                    version: '1.0'
         
     | 
| 
       74 
     | 
    
         
            -
              type: :runtime
         
     | 
| 
       75 
     | 
    
         
            -
              prerelease: false
         
     | 
| 
       76 
     | 
    
         
            -
              version_requirements: !ruby/object:Gem::Requirement
         
     | 
| 
       77 
     | 
    
         
            -
                requirements:
         
     | 
| 
       78 
     | 
    
         
            -
                - - "~>"
         
     | 
| 
       79 
     | 
    
         
            -
                  - !ruby/object:Gem::Version
         
     | 
| 
       80 
     | 
    
         
            -
                    version: '1.0'
         
     | 
| 
       81 
67 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       82 
68 
     | 
    
         
             
              name: kaminari
         
     | 
| 
       83 
69 
     | 
    
         
             
              requirement: !ruby/object:Gem::Requirement
         
     | 
| 
         @@ -413,8 +399,8 @@ test_files: 
     | 
|
| 
       413 
399 
     | 
    
         
             
            - test/dummy/config/environments/development.rb
         
     | 
| 
       414 
400 
     | 
    
         
             
            - test/dummy/config/environments/production.rb
         
     | 
| 
       415 
401 
     | 
    
         
             
            - test/dummy/config/environments/test.rb
         
     | 
| 
       416 
     | 
    
         
            -
            - test/dummy/config/initializers/backtrace_silencers.rb
         
     | 
| 
       417 
402 
     | 
    
         
             
            - test/dummy/config/initializers/config.rb
         
     | 
| 
      
 403 
     | 
    
         
            +
            - test/dummy/config/initializers/backtrace_silencers.rb
         
     | 
| 
       418 
404 
     | 
    
         
             
            - test/dummy/config/initializers/filter_parameter_logging.rb
         
     | 
| 
       419 
405 
     | 
    
         
             
            - test/dummy/config/initializers/inflections.rb
         
     | 
| 
       420 
406 
     | 
    
         
             
            - test/dummy/config/initializers/mime_types.rb
         
     | 
| 
         @@ -426,12 +412,12 @@ test_files: 
     | 
|
| 
       426 
412 
     | 
    
         
             
            - test/dummy/config/settings/development.yml
         
     | 
| 
       427 
413 
     | 
    
         
             
            - test/dummy/config/settings/production.yml
         
     | 
| 
       428 
414 
     | 
    
         
             
            - test/dummy/config/settings/test.yml
         
     | 
| 
      
 415 
     | 
    
         
            +
            - test/dummy/config/settings.yml
         
     | 
| 
       429 
416 
     | 
    
         
             
            - test/dummy/config/application.rb
         
     | 
| 
       430 
417 
     | 
    
         
             
            - test/dummy/config/boot.rb
         
     | 
| 
       431 
418 
     | 
    
         
             
            - test/dummy/config/database.yml
         
     | 
| 
       432 
419 
     | 
    
         
             
            - test/dummy/config/environment.rb
         
     | 
| 
       433 
420 
     | 
    
         
             
            - test/dummy/config/routes.rb
         
     | 
| 
       434 
     | 
    
         
            -
            - test/dummy/config/settings.yml
         
     | 
| 
       435 
421 
     | 
    
         
             
            - test/dummy/db/migrate/20131107120635_create_authors.rb
         
     | 
| 
       436 
422 
     | 
    
         
             
            - test/dummy/db/migrate/20131218011851_create_books.rb
         
     | 
| 
       437 
423 
     | 
    
         
             
            - test/dummy/db/migrate/20140201000000_add_user_group_id_to_authors.rb
         
     | 
| 
         @@ -445,9 +431,9 @@ test_files: 
     | 
|
| 
       445 
431 
     | 
    
         
             
            - test/dummy/test/controllers/authors_popup_controller_test.rb
         
     | 
| 
       446 
432 
     | 
    
         
             
            - test/dummy/test/controllers/books_controller_test.rb
         
     | 
| 
       447 
433 
     | 
    
         
             
            - test/dummy/test/helpers/authors_helper_test.rb
         
     | 
| 
      
 434 
     | 
    
         
            +
            - test/dummy/test/models/rails_config_test.rb
         
     | 
| 
       448 
435 
     | 
    
         
             
            - test/dummy/test/models/author_test.rb
         
     | 
| 
       449 
436 
     | 
    
         
             
            - test/dummy/test/models/book_test.rb
         
     | 
| 
       450 
     | 
    
         
            -
            - test/dummy/test/models/rails_config_test.rb
         
     | 
| 
       451 
437 
     | 
    
         
             
            - test/dummy/README.rdoc
         
     | 
| 
       452 
438 
     | 
    
         
             
            - test/dummy/Rakefile
         
     | 
| 
       453 
439 
     | 
    
         
             
            - test/dummy/config.ru
         
     |