rails_email_preview 0.2.5 → 0.2.6
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/README.md +6 -3
- data/app/assets/stylesheets/rails_email_preview/_layout.css.sass +20 -0
- data/app/assets/stylesheets/rails_email_preview/application.css.sass +2 -22
- data/app/helpers/rails_email_preview/emails_helper.rb +6 -2
- data/app/views/layouts/rails_email_preview/_flash_notices.html.slim +5 -0
- data/app/views/layouts/rails_email_preview/application.html.slim +3 -1
- data/app/views/rails_email_preview/emails/index.html.slim +9 -1
- data/lib/rails_email_preview/version.rb +1 -1
- metadata +3 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: cdd99b26068ba1bed5683224775565b4542a3b82
         | 
| 4 | 
            +
              data.tar.gz: fa1c1a594e220635f6c90cc8127d88f6c4ed86ef
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: d33f26c046cf0ffe23c0cdc040ce2dcb2df2ffe3aad97ce82a4ba96bbf5a2334de544be8581fded6032930d8986174c85b484605379468803aad846eb1e52d6c
         | 
| 7 | 
            +
              data.tar.gz: 565a76ef4e8231d9090e489afa51886b5233ee8f8510e40ec59ac58d090c21a2be07ca8fbbf473d12ead45f954dce2013e559f8a0afe776068a074cb681dc506
         | 
    
        data/README.md
    CHANGED
    
    | @@ -9,8 +9,8 @@ Preview: | |
| 9 9 | 
             
            List:
         | 
| 10 10 | 
             
            ![screenshot][rep-nav-screenshot]
         | 
| 11 11 |  | 
| 12 | 
            -
            REP can use the application styles and comes with simple  | 
| 13 | 
            -
            *These screenshots are from [Zuigo](http://zuigo.com/), a platform to organize & discover events | 
| 12 | 
            +
            REP can use the application styles and comes with a [simple look][rep-show-default-screenshot] by default (default markup for [twbs/bootstrap](twbs/bootstrap) 3).
         | 
| 13 | 
            +
            *These screenshots are from [Zuigo](http://zuigo.com/), a platform to organize & discover events; using REP default markup and app styles*
         | 
| 14 14 |  | 
| 15 15 | 
             
            How to
         | 
| 16 16 | 
             
            -----
         | 
| @@ -123,8 +123,10 @@ You can render all REP views inside your own layout: | |
| 123 123 | 
             
                # # If you are using a custom layout, you will want to make app routes available to REP:
         | 
| 124 124 | 
             
                # Rails.application.config.to_prepare { RailsEmailPreview.inline_main_app_routes! }
         | 
| 125 125 |  | 
| 126 | 
            +
            You can add REP styles (some `.rep-` prefixed classes) with `@import 'rails_email_preview/layout'` in your SASS if you want them (note that they expect to be imported after bootstrap 3 styles).
         | 
| 127 | 
            +
             | 
| 126 128 | 
             
            You can also override any individual view by placing a file with the same path in your project's `app/views`,
         | 
| 127 | 
            -
            e.g. `app/views/rails_email_preview/emails/index.html.slim`. *PRs accepted* if you need hooks.
         | 
| 129 | 
            +
            e.g. `app/views/rails_email_preview/emails/index.html.slim`. *PRs accepted* if you need hooks. 
         | 
| 128 130 |  | 
| 129 131 | 
             
            Authentication & authorization
         | 
| 130 132 | 
             
            ------------------------------
         | 
| @@ -152,3 +154,4 @@ This project rocks and uses MIT-LICENSE. | |
| 152 154 |  | 
| 153 155 | 
             
              [rep-nav-screenshot]: https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-nav.png "Email List Screenshot"
         | 
| 154 156 | 
             
              [rep-show-screenshot]: https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-show.png "Show Email Screenshot"
         | 
| 157 | 
            +
              [rep-show-default-screenshot]: https://raw.github.com/glebm/rails_email_preview/master/doc/img/rep-show-default.png "Show Email Screenshot (default styles)"
         | 
| @@ -0,0 +1,20 @@ | |
| 1 | 
            +
            .rep-headers-list
         | 
| 2 | 
            +
              margin-left: 1em
         | 
| 3 | 
            +
              dt
         | 
| 4 | 
            +
                float: left
         | 
| 5 | 
            +
                clear: left
         | 
| 6 | 
            +
                width: auto
         | 
| 7 | 
            +
                text-align: left
         | 
| 8 | 
            +
                margin-right: 10px
         | 
| 9 | 
            +
                &:after
         | 
| 10 | 
            +
                  content: ':'
         | 
| 11 | 
            +
              dd
         | 
| 12 | 
            +
                width: auto
         | 
| 13 | 
            +
                margin-left: 0
         | 
| 14 | 
            +
             | 
| 15 | 
            +
            .rep-email-options
         | 
| 16 | 
            +
              margin-bottom: 0
         | 
| 17 | 
            +
              li
         | 
| 18 | 
            +
                padding-top: 0.8em
         | 
| 19 | 
            +
                &:first-child
         | 
| 20 | 
            +
                  padding-top: 0
         | 
| @@ -1,22 +1,2 @@ | |
| 1 | 
            -
             | 
| 2 | 
            -
             | 
| 3 | 
            -
            .rep-headers-list
         | 
| 4 | 
            -
              margin-left: 1em
         | 
| 5 | 
            -
              dt
         | 
| 6 | 
            -
                float: left
         | 
| 7 | 
            -
                clear: left
         | 
| 8 | 
            -
                width: auto
         | 
| 9 | 
            -
                text-align: left
         | 
| 10 | 
            -
                margin-right: 10px
         | 
| 11 | 
            -
                &:after
         | 
| 12 | 
            -
                  content: ':'
         | 
| 13 | 
            -
              dd
         | 
| 14 | 
            -
                width: auto
         | 
| 15 | 
            -
                margin-left: 0
         | 
| 16 | 
            -
             | 
| 17 | 
            -
            .rep-email-options
         | 
| 18 | 
            -
              margin-bottom: 0
         | 
| 19 | 
            -
              li
         | 
| 20 | 
            -
                padding-top: 0.8em
         | 
| 21 | 
            -
                &:first-child
         | 
| 22 | 
            -
                  padding-top: 0
         | 
| 1 | 
            +
            @import 'rails_email_preview/bootstrap'
         | 
| 2 | 
            +
            @import 'rails_email_preview/layout'
         | 
| @@ -9,12 +9,12 @@ module RailsEmailPreview::EmailsHelper | |
| 9 9 |  | 
| 10 10 | 
             
              def change_locale_attr(locale)
         | 
| 11 11 | 
             
                {href:  rails_email_preview.rep_email_url(params.merge(part_type: @part_type, email_locale: locale)),
         | 
| 12 | 
            -
                 class: ('active' if @email_locale == locale.to_s)}
         | 
| 12 | 
            +
                 class: ('active btn-primary' if @email_locale == locale.to_s)}
         | 
| 13 13 | 
             
              end
         | 
| 14 14 |  | 
| 15 15 | 
             
              def change_format_attr(mime)
         | 
| 16 16 | 
             
                {href: rails_email_preview.rep_email_url(params.merge(part_type: mime)),
         | 
| 17 | 
            -
                 class: ('active' if @part_type == mime)}
         | 
| 17 | 
            +
                 class: ('active btn-primary' if @part_type == mime)}
         | 
| 18 18 | 
             
              end
         | 
| 19 19 |  | 
| 20 20 | 
             
              def locale_name(locale)
         | 
| @@ -50,6 +50,10 @@ module RailsEmailPreview::EmailsHelper | |
| 50 50 | 
             
                m.constantize.instance_methods(false).map(&:to_s).sort
         | 
| 51 51 | 
             
              end
         | 
| 52 52 |  | 
| 53 | 
            +
              def total_emails
         | 
| 54 | 
            +
                @total_emails ||= @preview_class_names.sum { |p| email_methods(p).length }
         | 
| 55 | 
            +
              end
         | 
| 56 | 
            +
             | 
| 53 57 | 
             
              def split_in_halves(elements, &weight)
         | 
| 54 58 | 
             
                tot_w  = elements.map(&weight).sum
         | 
| 55 59 | 
             
                cols   = [elements.dup, []]
         | 
| @@ -0,0 +1,5 @@ | |
| 1 | 
            +
            - flash.each do |name, msg|
         | 
| 2 | 
            +
              - next unless msg.is_a?(String)
         | 
| 3 | 
            +
              div class='alert alert-#{name.to_s =~ /notice/ ? 'success' : 'error'}'
         | 
| 4 | 
            +
                button.close type='button' data-dismiss='alert': i.icon-remove ×
         | 
| 5 | 
            +
                = content_tag :div, name.to_s.end_with?('_html') ? msg.html_safe : h(msg).gsub("\n", "<br>").html_safe, id: "flash_#{name.to_s.sub(/_html$/, '')}"
         | 
| @@ -1,4 +1,5 @@ | |
| 1 | 
            -
            h1 | 
| 1 | 
            +
            h1
         | 
| 2 | 
            +
              | #{t 'rep.list_title'}
         | 
| 2 3 |  | 
| 3 4 | 
             
            - previews_group = proc do |m|
         | 
| 4 5 | 
             
              - capture do
         | 
| @@ -14,3 +15,10 @@ h1 #{t 'rep.list_title'} | |
| 14 15 | 
             
                .col-sm-6.col-lg-6
         | 
| 15 16 | 
             
                  - classes.each do |class_name|
         | 
| 16 17 | 
             
                    = previews_group.call(class_name)
         | 
| 18 | 
            +
             | 
| 19 | 
            +
            hr
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            p.text-center.text-small.text-info
         | 
| 22 | 
            +
              | #{total_emails} emails in #{@preview_class_names.length} mailers
         | 
| 23 | 
            +
              br
         | 
| 24 | 
            +
              a href="https://github.com/glebm/rails_email_preview" target='_blank' REP #{RailsEmailPreview::VERSION}
         | 
    
        metadata
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rails_email_preview
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 0.2. | 
| 4 | 
            +
              version: 0.2.6
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Gleb Mazovetskiy
         | 
| @@ -116,12 +116,14 @@ executables: [] | |
| 116 116 | 
             
            extensions: []
         | 
| 117 117 | 
             
            extra_rdoc_files: []
         | 
| 118 118 | 
             
            files:
         | 
| 119 | 
            +
            - app/assets/stylesheets/rails_email_preview/_layout.css.sass
         | 
| 119 120 | 
             
            - app/assets/stylesheets/rails_email_preview/application.css.sass
         | 
| 120 121 | 
             
            - app/assets/stylesheets/rails_email_preview/bootstrap.css
         | 
| 121 122 | 
             
            - app/controllers/rails_email_preview/application_controller.rb
         | 
| 122 123 | 
             
            - app/controllers/rails_email_preview/emails_controller.rb
         | 
| 123 124 | 
             
            - app/helpers/rails_email_preview/emails_helper.rb
         | 
| 124 125 | 
             
            - app/views/integrations/cms/_customize_cms_for_rails_email_preview.html.slim
         | 
| 126 | 
            +
            - app/views/layouts/rails_email_preview/_flash_notices.html.slim
         | 
| 125 127 | 
             
            - app/views/layouts/rails_email_preview/application.html.slim
         | 
| 126 128 | 
             
            - app/views/rails_email_preview/emails/_email_iframe.html.slim
         | 
| 127 129 | 
             
            - app/views/rails_email_preview/emails/_format_nav.html.slim
         |