sinatra-hexacta 1.2.6 → 1.3.0
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/lib/sinatra/handlers/reports.rb +47 -1
 - data/lib/sinatra/public/css/lightadmin.css +49 -40
 - data/lib/sinatra/public/css/metronic.css +0 -4
 - data/lib/sinatra/public/img/lightadmin.white.png +0 -0
 - data/lib/sinatra/public/js/view.js +15 -0
 - data/lib/sinatra/views/inputs/select.slim +3 -1
 - metadata +4 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 2f0b5543f96de1b88e37c6eaf7bc8cfcf61a3419fda741a9597f333a49f4ec1b
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 4224a9d29c78106f70fcef411891a9d54efbe62025becd73201d0740198e4d20
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: e22aa655547b0c55ab14163e7043dbf4e4fee7d321d51e99ccc7823dff01cda2139df7fd7fc7b68d51f999453239fc199d7af663109ab32283d5069e1c1ab473
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 885f0a1b6b4d3324217067cee4e976b25a967e7888b8ce5404c9a46c80c3e1faef444462bc409f1b85836f598d877b491633f1443cedca776858a47a3bd26d52
         
     | 
| 
         @@ -5,6 +5,52 @@ module Sinatra 
     | 
|
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
                def enable_reports
         
     | 
| 
       7 
7 
     | 
    
         
             
                  p "Enabling reports..."
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  #In order to enable file streaming
         
     | 
| 
      
 10 
     | 
    
         
            +
                  helpers do
         
     | 
| 
      
 11 
     | 
    
         
            +
                    def slim(template, options = {}, locals = {}, &block)
         
     | 
| 
      
 12 
     | 
    
         
            +
                      # Slim calls the option :streaming, but Sinatra has a #stream method
         
     | 
| 
      
 13 
     | 
    
         
            +
                      # so we also support the :stream option.
         
     | 
| 
      
 14 
     | 
    
         
            +
                      options[:streaming] ||= options.delete(:stream)
         
     | 
| 
      
 15 
     | 
    
         
            +
             
     | 
| 
      
 16 
     | 
    
         
            +
                      # We are not streaming. Call super implementation and
         
     | 
| 
      
 17 
     | 
    
         
            +
                      # just ensure that the @_out_buf is restored afterwards.
         
     | 
| 
      
 18 
     | 
    
         
            +
                      unless options[:streaming]
         
     | 
| 
      
 19 
     | 
    
         
            +
                        old = @_out_buf
         
     | 
| 
      
 20 
     | 
    
         
            +
                        begin
         
     | 
| 
      
 21 
     | 
    
         
            +
                          return super
         
     | 
| 
      
 22 
     | 
    
         
            +
                        ensure
         
     | 
| 
      
 23 
     | 
    
         
            +
                          @_out_buf = old
         
     | 
| 
      
 24 
     | 
    
         
            +
                        end
         
     | 
| 
      
 25 
     | 
    
         
            +
                      end
         
     | 
| 
      
 26 
     | 
    
         
            +
             
     | 
| 
      
 27 
     | 
    
         
            +
                      # We use the Temple generator without preamble and postamble
         
     | 
| 
      
 28 
     | 
    
         
            +
                      # which is suitable for streaming.
         
     | 
| 
      
 29 
     | 
    
         
            +
                      options[:generator] = Temple::Generator
         
     | 
| 
      
 30 
     | 
    
         
            +
             
     | 
| 
      
 31 
     | 
    
         
            +
                      # We are already streaming, continue!
         
     | 
| 
      
 32 
     | 
    
         
            +
                      return super if @_out_buf.is_a? Sinatra::Helpers::Stream
         
     | 
| 
      
 33 
     | 
    
         
            +
             
     | 
| 
      
 34 
     | 
    
         
            +
                      # Create a new stream
         
     | 
| 
      
 35 
     | 
    
         
            +
                      stream do |out|
         
     | 
| 
      
 36 
     | 
    
         
            +
                        @_out_buf = out
         
     | 
| 
      
 37 
     | 
    
         
            +
             
     | 
| 
      
 38 
     | 
    
         
            +
                        if options[:layout] == false
         
     | 
| 
      
 39 
     | 
    
         
            +
                          # No layout given, start rendering template
         
     | 
| 
      
 40 
     | 
    
         
            +
                          super
         
     | 
| 
      
 41 
     | 
    
         
            +
                        else
         
     | 
| 
      
 42 
     | 
    
         
            +
                          # Layout given
         
     | 
| 
      
 43 
     | 
    
         
            +
                          layout = options[:layout] == nil || options[:layout] == true ? :layout : options[:layout]
         
     | 
| 
      
 44 
     | 
    
         
            +
             
     | 
| 
      
 45 
     | 
    
         
            +
                          # Invert layout and template rendering order
         
     | 
| 
      
 46 
     | 
    
         
            +
                          super layout, options.merge(layout: false), locals do
         
     | 
| 
      
 47 
     | 
    
         
            +
                            super(template, options.merge(layout: false), locals, &block)
         
     | 
| 
      
 48 
     | 
    
         
            +
                          end
         
     | 
| 
      
 49 
     | 
    
         
            +
                        end
         
     | 
| 
      
 50 
     | 
    
         
            +
                      end
         
     | 
| 
      
 51 
     | 
    
         
            +
                    end
         
     | 
| 
      
 52 
     | 
    
         
            +
                  end
         
     | 
| 
      
 53 
     | 
    
         
            +
             
     | 
| 
       8 
54 
     | 
    
         
             
                  before '/reports/*' do
         
     | 
| 
       9 
55 
     | 
    
         
             
                    error(403) if authenticated(User).permissions.empty?
         
     | 
| 
       10 
56 
     | 
    
         
             
                  end
         
     | 
| 
         @@ -18,7 +64,7 @@ module Sinatra 
     | 
|
| 
       18 
64 
     | 
    
         
             
                    date ||= Date.today
         
     | 
| 
       19 
65 
     | 
    
         
             
                    headers "Content-Disposition" => "attachment;filename=#{report_name}.#{date}.xls",
         
     | 
| 
       20 
66 
     | 
    
         
             
                      "Content-Type" => "application/octet-stream"
         
     | 
| 
       21 
     | 
    
         
            -
                      slim "reports/#{report_name}".to_sym, locals: { :date => date }, :layout => false
         
     | 
| 
      
 67 
     | 
    
         
            +
                      slim "reports/#{report_name}".to_sym, locals: { :date => date }, :stream => true, :layout => false
         
     | 
| 
       22 
68 
     | 
    
         
             
                  end
         
     | 
| 
       23 
69 
     | 
    
         
             
                end
         
     | 
| 
       24 
70 
     | 
    
         | 
| 
         @@ -11,7 +11,7 @@ body.darkmode #header { 
     | 
|
| 
       11 
11 
     | 
    
         
             
              background-color: rgba(40,40,40,0.9) !important;
         
     | 
| 
       12 
12 
     | 
    
         
             
            }
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
     | 
    
         
            -
            #header .top-menu > li > a {
         
     | 
| 
      
 14 
     | 
    
         
            +
            #header .top-menu > li > a, .actions > li > a > i, .actions > a > i  {
         
     | 
| 
       15 
15 
     | 
    
         
             
              color: #047bf8;
         
     | 
| 
       16 
16 
     | 
    
         
             
            }
         
     | 
| 
       17 
17 
     | 
    
         | 
| 
         @@ -122,13 +122,8 @@ body { 
     | 
|
| 
       122 
122 
     | 
    
         
             
              position: absolute;
         
     | 
| 
       123 
123 
     | 
    
         
             
              top: 0px;
         
     | 
| 
       124 
124 
     | 
    
         
             
              min-height: 700px;
         
     | 
| 
       125 
     | 
    
         
            -
              margin-top:  
     | 
| 
       126 
     | 
    
         
            -
              width:  
     | 
| 
       127 
     | 
    
         
            -
              -webkit-transform: translate3d(0, 0, 0);
         
     | 
| 
       128 
     | 
    
         
            -
              transform: translate3d(0, 0, 0);
         
     | 
| 
       129 
     | 
    
         
            -
              opacity: 1;
         
     | 
| 
       130 
     | 
    
         
            -
              filter: alpha(opacity=100);
         
     | 
| 
       131 
     | 
    
         
            -
              box-shadow: 0 1px 1px rgba(0, 0, 0, 0.15);
         
     | 
| 
      
 125 
     | 
    
         
            +
              margin-top: 75px;
         
     | 
| 
      
 126 
     | 
    
         
            +
              width: 200px;
         
     | 
| 
       132 
127 
     | 
    
         
             
            }
         
     | 
| 
       133 
128 
     | 
    
         | 
| 
       134 
129 
     | 
    
         
             
            .container .block-header h2 {
         
     | 
| 
         @@ -285,7 +280,7 @@ body { 
     | 
|
| 
       285 
280 
     | 
    
         
             
            .footer-text .text, .actions > li > a:before,
         
     | 
| 
       286 
281 
     | 
    
         
             
            .actions > a:before, .pagination > li > a, .pagination > li > span,
         
     | 
| 
       287 
282 
     | 
    
         
             
            #header input[type="text"], #header .results, .dropdown.open .dropdown-menu,
         
     | 
| 
       288 
     | 
    
         
            -
            .modal .modal-content, . 
     | 
| 
      
 283 
     | 
    
         
            +
            .modal .modal-content, .pt-inner .pti-header, .ptih-title,
         
     | 
| 
       289 
284 
     | 
    
         
             
            .card .tab-nav, .dash-widget-item {
         
     | 
| 
       290 
285 
     | 
    
         
             
              border-radius: 6px;
         
     | 
| 
       291 
286 
     | 
    
         
             
            }
         
     | 
| 
         @@ -338,33 +333,6 @@ t-view:after { 
     | 
|
| 
       338 
333 
     | 
    
         
             
              border-bottom: 0px !important;
         
     | 
| 
       339 
334 
     | 
    
         
             
            }
         
     | 
| 
       340 
335 
     | 
    
         | 
| 
       341 
     | 
    
         
            -
            @media (min-width: 1200px) {
         
     | 
| 
       342 
     | 
    
         
            -
              body #content {
         
     | 
| 
       343 
     | 
    
         
            -
                padding-left: 150px;
         
     | 
| 
       344 
     | 
    
         
            -
              }
         
     | 
| 
       345 
     | 
    
         
            -
            }
         
     | 
| 
       346 
     | 
    
         
            -
             
     | 
| 
       347 
     | 
    
         
            -
            @media (min-width: 1200px) {
         
     | 
| 
       348 
     | 
    
         
            -
              body #content > .container {
         
     | 
| 
       349 
     | 
    
         
            -
                width: calc(100% - 30px);
         
     | 
| 
       350 
     | 
    
         
            -
              }
         
     | 
| 
       351 
     | 
    
         
            -
            }
         
     | 
| 
       352 
     | 
    
         
            -
             
     | 
| 
       353 
     | 
    
         
            -
            @media (min-width: 1200px) {
         
     | 
| 
       354 
     | 
    
         
            -
              #header {
         
     | 
| 
       355 
     | 
    
         
            -
                padding-left: 15px;
         
     | 
| 
       356 
     | 
    
         
            -
              }
         
     | 
| 
       357 
     | 
    
         
            -
             
     | 
| 
       358 
     | 
    
         
            -
              #menu-trigger {
         
     | 
| 
       359 
     | 
    
         
            -
                display: none;
         
     | 
| 
       360 
     | 
    
         
            -
              }
         
     | 
| 
       361 
     | 
    
         
            -
            }
         
     | 
| 
       362 
     | 
    
         
            -
             
     | 
| 
       363 
     | 
    
         
            -
            body:not(.sw-toggled) #sidebar {
         
     | 
| 
       364 
     | 
    
         
            -
              box-shadow: none;
         
     | 
| 
       365 
     | 
    
         
            -
            }
         
     | 
| 
       366 
     | 
    
         
            -
             
     | 
| 
       367 
     | 
    
         
            -
             
     | 
| 
       368 
336 
     | 
    
         
             
            .lv-item span, .pt-inner .pti-header > h2 {
         
     | 
| 
       369 
337 
     | 
    
         
             
              color: #334152;
         
     | 
| 
       370 
338 
     | 
    
         
             
              font-weight: 700;
         
     | 
| 
         @@ -395,17 +363,57 @@ body:not(.sw-toggled) #sidebar { 
     | 
|
| 
       395 
363 
     | 
    
         
             
              background-size: 100% 70%;
         
     | 
| 
       396 
364 
     | 
    
         
             
            }
         
     | 
| 
       397 
365 
     | 
    
         | 
| 
      
 366 
     | 
    
         
            +
            .modal .modal-footer .btn-link {
         
     | 
| 
      
 367 
     | 
    
         
            +
              font-weight: 700 !important;
         
     | 
| 
      
 368 
     | 
    
         
            +
              color: #047bf8;
         
     | 
| 
      
 369 
     | 
    
         
            +
            }
         
     | 
| 
      
 370 
     | 
    
         
            +
             
     | 
| 
      
 371 
     | 
    
         
            +
            .modal .modal-header {
         
     | 
| 
      
 372 
     | 
    
         
            +
              padding: 23px 26px;
         
     | 
| 
      
 373 
     | 
    
         
            +
              border-bottom: 0px;
         
     | 
| 
      
 374 
     | 
    
         
            +
              margin-bottom: 0px;
         
     | 
| 
      
 375 
     | 
    
         
            +
            }
         
     | 
| 
      
 376 
     | 
    
         
            +
             
     | 
| 
      
 377 
     | 
    
         
            +
            .modal .modal-footer {
         
     | 
| 
      
 378 
     | 
    
         
            +
              border-top: 1px solid rgba(0,0,0,0.05);
         
     | 
| 
      
 379 
     | 
    
         
            +
            }
         
     | 
| 
      
 380 
     | 
    
         
            +
             
     | 
| 
      
 381 
     | 
    
         
            +
            .modal .modal-content {
         
     | 
| 
      
 382 
     | 
    
         
            +
              box-shadow: 0 25px 65px rgba(15,24,33,0.29);
         
     | 
| 
      
 383 
     | 
    
         
            +
            }
         
     | 
| 
      
 384 
     | 
    
         
            +
             
     | 
| 
      
 385 
     | 
    
         
            +
            .modal-title {
         
     | 
| 
      
 386 
     | 
    
         
            +
              font-weight: 700 !important;
         
     | 
| 
      
 387 
     | 
    
         
            +
            }
         
     | 
| 
      
 388 
     | 
    
         
            +
             
     | 
| 
      
 389 
     | 
    
         
            +
            .modal-backdrop {
         
     | 
| 
      
 390 
     | 
    
         
            +
              background-color:#235a94;
         
     | 
| 
      
 391 
     | 
    
         
            +
            }
         
     | 
| 
      
 392 
     | 
    
         
            +
             
     | 
| 
      
 393 
     | 
    
         
            +
            .modal.fade .modal-dialog 
         
     | 
| 
      
 394 
     | 
    
         
            +
            {
         
     | 
| 
      
 395 
     | 
    
         
            +
              -moz-transition: none !important;
         
     | 
| 
      
 396 
     | 
    
         
            +
              -o-transition: none !important;
         
     | 
| 
      
 397 
     | 
    
         
            +
              -webkit-transition: none !important;
         
     | 
| 
      
 398 
     | 
    
         
            +
              transition: none !important;
         
     | 
| 
      
 399 
     | 
    
         
            +
             
     | 
| 
      
 400 
     | 
    
         
            +
              -moz-transform: none !important;
         
     | 
| 
      
 401 
     | 
    
         
            +
              -ms-transform: none !important;
         
     | 
| 
      
 402 
     | 
    
         
            +
              -o-transform: none !important;
         
     | 
| 
      
 403 
     | 
    
         
            +
              -webkit-transform: none !important;
         
     | 
| 
      
 404 
     | 
    
         
            +
              transform: none !important;
         
     | 
| 
      
 405 
     | 
    
         
            +
            }
         
     | 
| 
      
 406 
     | 
    
         
            +
             
     | 
| 
       398 
407 
     | 
    
         
             
            .form-control {
         
     | 
| 
       399 
408 
     | 
    
         
             
              background: transparent;
         
     | 
| 
       400 
409 
     | 
    
         
             
            }
         
     | 
| 
       401 
410 
     | 
    
         | 
| 
       402 
     | 
    
         
            -
            .preloader {
         
     | 
| 
      
 411 
     | 
    
         
            +
            #loader .preloader { 
         
     | 
| 
       403 
412 
     | 
    
         
             
              background: rgba(255,255,255,0.5);
         
     | 
| 
       404 
413 
     | 
    
         
             
              border-radius: 100px;
         
     | 
| 
       405 
     | 
    
         
            -
              left:  
     | 
| 
      
 414 
     | 
    
         
            +
              left: 67px !important;
         
     | 
| 
       406 
415 
     | 
    
         
             
              top: 6px !important;
         
     | 
| 
       407 
416 
     | 
    
         
             
            }
         
     | 
| 
       408 
     | 
    
         
            -
             
     | 
| 
       409 
417 
     | 
    
         
             
            /* ----- Pegaso related ----- */
         
     | 
| 
       410 
418 
     | 
    
         | 
| 
       411 
419 
     | 
    
         
             
            .idx {
         
     | 
| 
         @@ -421,4 +429,5 @@ body:not(.sw-toggled) #sidebar { 
     | 
|
| 
       421 
429 
     | 
    
         
             
              font-size: 14pt;
         
     | 
| 
       422 
430 
     | 
    
         
             
              height: 38px;
         
     | 
| 
       423 
431 
     | 
    
         
             
              border-radius: 100px;
         
     | 
| 
       424 
     | 
    
         
            -
              padding-top: 9px; 
     | 
| 
      
 432 
     | 
    
         
            +
              padding-top: 9px;
         
     | 
| 
      
 433 
     | 
    
         
            +
            }
         
     | 
| 
         Binary file 
     | 
| 
         @@ -0,0 +1,15 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            class View {
         
     | 
| 
      
 2 
     | 
    
         
            +
             
     | 
| 
      
 3 
     | 
    
         
            +
              static get(url,params,destination){
         
     | 
| 
      
 4 
     | 
    
         
            +
                $(destination).html('<div class="text-center" style="padding:100px;"><div class="preloader pls-teal bgm-none"><svg class="pl-circular" viewBox="25 25 50 50"><circle class="plc-path" cx="50" cy="50" r="20"></circle></svg></div><h5>Cargando...</h5></div>');
         
     | 
| 
      
 5 
     | 
    
         
            +
                $.ajax({
         
     | 
| 
      
 6 
     | 
    
         
            +
                    url: url,
         
     | 
| 
      
 7 
     | 
    
         
            +
                    type: 'GET',
         
     | 
| 
      
 8 
     | 
    
         
            +
                    data: params
         
     | 
| 
      
 9 
     | 
    
         
            +
                }).done(function(result) {
         
     | 
| 
      
 10 
     | 
    
         
            +
                  $(destination).html(result);
         
     | 
| 
      
 11 
     | 
    
         
            +
                }).error(function(result) {
         
     | 
| 
      
 12 
     | 
    
         
            +
                  $(destination).html('<div class="lv-item p-20 bgm-red m-b-5 animated fadeIn"><div class="media"><div class="pull-left"><i class="zmdi zmdi-hc-3x zmdi-alert-octagon c-white"></i></div><div class="media-body"><div class="lv-title c-white">Algo salió mal</div><small class="lv-small c-white">Los administradores acaban de ser informados de este error, ni bien tengan una solución se te notificará. Disculpá las molestias.</small></div></div></div>');
         
     | 
| 
      
 13 
     | 
    
         
            +
                });
         
     | 
| 
      
 14 
     | 
    
         
            +
              }
         
     | 
| 
      
 15 
     | 
    
         
            +
            }
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: sinatra-hexacta
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.3.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Marco Zanger
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date:  
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2021-03-17 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: sucker_punch
         
     | 
| 
         @@ -134,6 +134,7 @@ files: 
     | 
|
| 
       134 
134 
     | 
    
         
             
            - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.ttf
         
     | 
| 
       135 
135 
     | 
    
         
             
            - lib/sinatra/public/fonts/roboto/Roboto-Thin-webfont.woff
         
     | 
| 
       136 
136 
     | 
    
         
             
            - lib/sinatra/public/img/finder.png
         
     | 
| 
      
 137 
     | 
    
         
            +
            - lib/sinatra/public/img/lightadmin.white.png
         
     | 
| 
       137 
138 
     | 
    
         
             
            - lib/sinatra/public/img/metronic.jpg
         
     | 
| 
       138 
139 
     | 
    
         
             
            - lib/sinatra/public/img/noimage.jpg
         
     | 
| 
       139 
140 
     | 
    
         
             
            - lib/sinatra/public/img/select.png
         
     | 
| 
         @@ -142,6 +143,7 @@ files: 
     | 
|
| 
       142 
143 
     | 
    
         
             
            - lib/sinatra/public/js/app.js
         
     | 
| 
       143 
144 
     | 
    
         
             
            - lib/sinatra/public/js/finder.js
         
     | 
| 
       144 
145 
     | 
    
         
             
            - lib/sinatra/public/js/process.js
         
     | 
| 
      
 146 
     | 
    
         
            +
            - lib/sinatra/public/js/view.js
         
     | 
| 
       145 
147 
     | 
    
         
             
            - lib/sinatra/public/vendors/animate.css/animate.min.css
         
     | 
| 
       146 
148 
     | 
    
         
             
            - lib/sinatra/public/vendors/bootstrap-validator/validator.js
         
     | 
| 
       147 
149 
     | 
    
         
             
            - lib/sinatra/public/vendors/bootstrap-year-calendar/bootstrap-year-calendar.es.js
         
     |