letter_opener_web 2.0.0.pre.alpha1 → 2.0.0.pre.beta

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: '0769c48d5d3d5f4a4353b406d61fc4f38982643c1ceb2a95a2695e1f32e2d299'
4
- data.tar.gz: cae0ee6946cdf39ecf07de402902564c773a3d21182625b3131d89031adaefed
3
+ metadata.gz: 285be7616fcef875c214cf862ce009bad30562c1de5f0cd7ea65348ef9201233
4
+ data.tar.gz: ad8acc2f43564626b87a5950debe40700f3f492f29a397fb5f8d88f6ae516747
5
5
  SHA512:
6
- metadata.gz: b26f6bafa83f0d690ca8ce7d7f01fb343836c258216d43f1c7b12c083f09d4bf60ca7466e6400f33f8cf210fa5fe55bfebd10d4f14f6370d10e4256e01cb5fad
7
- data.tar.gz: 299ebe6fc4b908b7be0ed2af430fc820e85aa9c6903a815d0258692cfbd80888d1fc91795a319157df9097965ea2e5adfcbd21a47b44dddc3f879edc1e301295
6
+ metadata.gz: 7355ec8c5c8ec6dbaa7b459475983a6da804d3f35ca30cdcb15d9b1b206877b2a92af5f0e02adc4850cebd1045c0f9ea57399d45cb883c6d357a3f9cf786cc80
7
+ data.tar.gz: f001b0b9f78aa875f6130bfb0b7443c3647f2b1edff3fc582d44890cbfafb7e0bdc55aa18ae4da30f8e936a6dda5168922414047b984f266fbbaba3a363bc604
data/CHANGELOG.md CHANGED
@@ -3,7 +3,7 @@
3
3
  - Require Rails >= 5.2, run tests against Rails 6.1 [#113](https://github.com/fgrehm/letter_opener_web/pull/113)
4
4
  - Upgrade to Bootstrap 4.2 [#113](https://github.com/fgrehm/letter_opener_web/pull/113)
5
5
  - Inline CSS and Javascript [#113](https://github.com/fgrehm/letter_opener_web/pull/113)
6
- - Add rexml gem into dependency for Ruby 3.0 [#160](https://github.com/fgrehm/letter_opener_web/pull/106)
6
+ - Add rexml gem into dependency for Ruby 3.0 [#106](https://github.com/fgrehm/letter_opener_web/pull/106)
7
7
  - Add routes for Rails API mode [#69](https://github.com/fgrehm/letter_opener_web/pull/69)
8
8
  - Prevent name conflict with `Letter` class [#108](https://github.com/fgrehm/letter_opener_web/pull/108)
9
9
  - Add Rails' built-in CSRF protection [#111](https://github.com/fgrehm/letter_opener_web/pull/111)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module LetterOpenerWeb
4
4
  class ApplicationController < ActionController::Base
5
- protect_from_forgery with: :exception
5
+ protect_from_forgery with: :exception, unless: -> { Rails.configuration.try(:api_only) }
6
6
  end
7
7
  end
@@ -37,7 +37,10 @@ module LetterOpenerWeb
37
37
 
38
38
  def destroy
39
39
  @letter.delete
40
- redirect_to routes.letters_path
40
+ respond_to do |format|
41
+ format.html { redirect_to routes.letters_path }
42
+ format.js { render js: "window.location='#{routes.letters_path}'" }
43
+ end
41
44
  end
42
45
 
43
46
  private
@@ -13,8 +13,8 @@ jQuery(function($) {
13
13
  $('.letter-opener').on('click', 'a', function() {
14
14
  var $this = $(this);
15
15
  $('iframe').attr('src', $this.attr('href'));
16
- $this.parent().find('.active').removeClass('active');
17
- $this.addClass('active');
16
+ $this.parents('.list-group').find('.active').removeClass('active');
17
+ $this.parent().addClass('active');
18
18
  });
19
19
 
20
20
  $('.refresh').click(function(e) {
@@ -33,6 +33,14 @@
33
33
  padding-left: 5px;
34
34
  }
35
35
 
36
+ .message-headers a {
37
+ color: black;
38
+ }
39
+
40
+ .message-headers.active a {
41
+ color: white;
42
+ }
43
+
36
44
  .message-headers dl {
37
45
  float: left;
38
46
  font-size: 0.8rem;
@@ -1,5 +1,10 @@
1
- <% classes = %w(list-group-item list-group-action message-headers p-2) %>
1
+ <% classes = %w(list-group-item list-group-action d-flex justify-content-between align-items-start p-2 message-headers) %>
2
2
  <% classes << 'active' if active %>
3
- <%= link_to(letter_path(letter, style: letter.default_style), class: classes, target: 'mail') do %>
4
- <%= letter.headers %>
3
+ <%= content_tag :li, class: classes do %>
4
+ <%= link_to(letter_path(letter, style: letter.default_style), target: 'mail') do %>
5
+ <%= letter.headers %>
6
+ <% end %>
7
+ <button class="btn btn-danger btn-sm" data-remote="true" data-url="<%= delete_letter_path(letter) %>" data-method="post" data-confirm="Are you sure?">
8
+ <strong><small>X</small></strong>
9
+ </button>
5
10
  <% end %>
@@ -11,12 +11,12 @@
11
11
  </span>
12
12
  </h1>
13
13
  <div class="letter-opener" data-letters-path="<%= letters_path %>">
14
- <div class="list-group pt-2">
14
+ <ul class="list-group rounded-0 pt-2">
15
15
  <% if first_letter = @letters.shift %>
16
16
  <%= render partial: "item", locals: { letter: first_letter, active: true } %>
17
17
  <% end %>
18
18
  <%= render partial: "item", collection: @letters, as: :letter, locals: { active: false } %>
19
- </div>
19
+ </ul>
20
20
  </div>
21
21
  </div>
22
22
  <div class="col right">
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LetterOpenerWeb
4
- VERSION = '2.0.0-alpha1'
4
+ VERSION = '2.0.0-beta'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: letter_opener_web
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.alpha1
4
+ version: 2.0.0.pre.beta
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Rehm
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-10-28 00:00:00.000000000 Z
12
+ date: 2021-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionmailer