promethee 1.4.0 → 1.4.1

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
  SHA1:
3
- metadata.gz: 35f2d03d65902ea14ce74785ec0679b1abb0001e
4
- data.tar.gz: 2cafc49dd5aa09559c9084b233608803c06d5c93
3
+ metadata.gz: 3977c58139169819464ec50d1e2350fce2269254
4
+ data.tar.gz: 25dd886efeabf6883ab05a93ac28edc930ad3e90
5
5
  SHA512:
6
- metadata.gz: 7b48b10eb4c989418f13ff2d0ac514fbea4394cd78b5b62ae19a49500add7433a2970f514383fd60d7573261849a6c18d6b08924feade5f3654a615e14a1a8ee
7
- data.tar.gz: 3d8b8753e9d3d530c111845c3d22d440a61b97ae13e788ac468826d69f928e95665a2520a74ac2b822576ac1ce7beac43cf391cbd9e94a0ec6483abf6ed00127
6
+ metadata.gz: 608d2eedee387ea5e7e7dc2228030851dabb07b1623010aa28ba66fd0a3764cfffcfdba17c25ec2554435984037d6275ed20b14c72e7dadf7f1dfafc9dca1933
7
+ data.tar.gz: b4572f476050c5d1502c0e768b9e23ae0b0b21107b43b7866bc17463c0e0c9360db1978f0cc6a13134602afb469b34aac74080697e86145d06ca0afb0fb3096a
data/README.md CHANGED
@@ -260,7 +260,7 @@ This would do quite the same thing:
260
260
  Prométhée works natively with Active Storage.
261
261
  [https://github.com/rails/rails/tree/master/activestorage](Configure it properly.)
262
262
 
263
- ## Database
263
+ ## Database
264
264
 
265
265
  ### PostgreSQL
266
266
 
@@ -59,13 +59,13 @@ promethee.controller('PrometheeController', ['$scope', 'summernoteConfig', 'pres
59
59
  data: { file: file },
60
60
  headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }
61
61
  }).then(function (resp) {
62
- $scope.promethee.inspected.attributes.blob_id = resp.data.id;
63
- $scope.promethee.inspected.attributes.blob_name = resp.data.name;
62
+ $scope.promethee.inspected.attributes.blob = resp.data;
63
+ $scope.upload_error = undefined;
64
64
  }, function (resp) {
65
- // console.log('Error');
65
+ $scope.upload_error = "An error occured (error " + resp.status + ": " + resp.statusText + ")";
66
66
  }, function (evt) {
67
67
  var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);
68
- // console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);
68
+ $scope.upload_progress = progressPercentage;
69
69
  });
70
70
  };
71
71
 
@@ -4,9 +4,9 @@
4
4
  promethee-edit__cover-content"
5
5
  style="background-image: url('{{component.attributes.src}}')">
6
6
  <hgroup>
7
- <p class="surtitle">{{component.attributes.surtitle}}</p>
7
+ <h2 class="surtitle">{{component.attributes.surtitle}}</h2>
8
8
  <h1>{{component.attributes.title}}</h1>
9
- <h2>{{component.attributes.subtitle}}</h2>
9
+ <h2 class="subtitle">{{component.attributes.subtitle}}</h2>
10
10
  </hgroup>
11
11
  </div>
12
12
  </div>
@@ -6,7 +6,10 @@
6
6
  data: {
7
7
  type: 'image',
8
8
  attributes: {
9
- src: 'https://picsum.photos/1920/1080/?random',
9
+ blob: {
10
+ id: undefined,
11
+ name: ''
12
+ },
10
13
  alt: '',
11
14
  caption: ''
12
15
  }
@@ -1,8 +1,12 @@
1
1
  <script type="text/ng-template" id="promethee/components/image/edit/inspect">
2
- <div class="form-group">
2
+ <div class="form-group" ngf-drop="upload($file)" >
3
3
  <label class="label-control">Image</label>
4
- <p>{{promethee.inspected.attributes.blob_name}}</p>
5
- <div class="button btn btn-default" ngf-select="upload($file)">Select an image</div>
4
+ <p>{{promethee.inspected.attributes.blob.name}}</p>
5
+ <div class="button btn btn-default" ngf-select="upload($file)" class="drop-box">Select or drop an image</div>
6
+ <div class="progress" ng-show="upload_progress != undefined && upload_progress != 0 && upload_progress != 100">
7
+ <div class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: {{upload_progress}}%"></div>
8
+ </div>
9
+ <div class="alert alert-danger" ng-show="upload_error">{{upload_error}}</div>
6
10
  </div>
7
11
 
8
12
  <div class="form-group">
@@ -1,13 +1,13 @@
1
1
  <script type="text/ng-template" id="promethee/components/image/edit/move">
2
2
  <%= render 'promethee/edit/move.header', type: 'image' %>
3
- <figure ng-show="component.attributes.blob_id">
4
- <img ng-src="/promethee/blob/{{component.attributes.blob_id}}"
3
+ <figure ng-show="component.attributes.blob.id">
4
+ <img ng-src="/promethee/blob/{{component.attributes.blob.id}}"
5
5
  class="img-responsive">
6
- <figcaption ng-show="component.attributes.caption"
6
+ <figcaption ng-show="component.attributes.caption"
7
7
  ng-bind-html="component.attributes.caption | htmlSafe"></figcaption>
8
8
  </figure>
9
- <div ng-hide="component.attributes.blob_id">
10
- <p ng-hide="editing"
9
+ <div ng-hide="component.attributes.blob.id">
10
+ <p ng-hide="editing"
11
11
  class="text-center">Click to set the image</p>
12
12
  </div>
13
13
  </div>
@@ -3,7 +3,7 @@
3
3
  <hr>
4
4
  <div class="row">
5
5
  <div class="col-md-6">
6
- <img ng-src="{{component.master.attributes.src}}" class="img-responsive" />
6
+ <img ng-src="/promethee/blob/{{component.attributes.blob.id}}" class="img-responsive" />
7
7
  <div ng-show="component.master.attributes.alt">
8
8
  <b>Alt</b>
9
9
  <p>{{component.master.attributes.alt}}</p>
@@ -1,5 +1,5 @@
1
1
  <%
2
- blob_id = component[:attributes][:blob_id]
2
+ blob_id = component[:attributes][:blob][:id]
3
3
  blob = ActiveStorage::Blob.find blob_id if blob_id
4
4
  alt = component[:attributes][:alt]
5
5
  caption = component[:attributes][:caption].to_s
@@ -1,5 +1,5 @@
1
1
  module Promethee
2
2
  module Rails
3
- VERSION = '1.4.0'
3
+ VERSION = '1.4.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: promethee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julien Dargelos
@@ -13,7 +13,7 @@ authors:
13
13
  autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
- date: 2018-04-23 00:00:00.000000000 Z
16
+ date: 2018-04-24 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: rails
@@ -341,7 +341,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
341
341
  version: '0'
342
342
  requirements: []
343
343
  rubyforge_project:
344
- rubygems_version: 2.6.13
344
+ rubygems_version: 2.6.11
345
345
  signing_key:
346
346
  specification_version: 4
347
347
  summary: Bring fire to your page