Skip to content

Commit 8a7ffcd

Browse files
dctalbotcbothner
authored andcommitted
Add WYSIWYG editors to DJ profile (#65)
* Provide trix editors for DJ profile * Direct upload for profile prics, trix editor in progress * wip: trix_upload * send attachment url to trix editor after drag and drop, purge deleted images on update * prevent uploads for dj lists section * add acessible alt tag to dj profile photo * don't hyperlink images * add custom trix css file * prettier, center img w/ max width * add some padding * give trix uploads a top margin * Revert "Use smart quotes around song names" This reverts commit 1aad8f0. * merge smart quotes * remove trix gem * add trix * prevent uploads with a data attribute instead of a class * remove trix gem * move direct_uploads into a pack * dataset is a member of event.target * data attribute must be passed a string value * Upgrade webpacker so the damn thing will load? * Fixes styling of Bio and Picks while editing * Use placeholder for the example “picks” * Stop running the bio and picks through Markdown on the "show" pages * Convert djs.about and djs.lists from markdown to html in a migration * Fix display of trix image galleries * Remove DiskService host parameter which is obviated in Rails 5.2.1
1 parent b4cc0d3 commit 8a7ffcd

32 files changed

+3273
-1517
lines changed

.babelrc

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,10 @@
1313
],
1414
"react"
1515
],
16+
1617
"plugins": [
1718
"syntax-dynamic-import",
1819
"transform-object-rest-spread",
19-
[
20-
"transform-class-properties",
21-
{
22-
"spec": true
23-
}
24-
]
20+
["transform-class-properties", { "spec": true }]
2521
]
2622
}

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,8 @@ coverage
3939

4040
# Ignore master key for decrypting credentials and more.
4141
/config/master.key
42+
/public/packs
43+
/public/packs-test
44+
/node_modules
45+
yarn-debug.log*
46+
.yarn-integrity

.postcssrc.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
plugins:
2-
postcss-smart-import: {}
2+
postcss-import: {}
33
postcss-cssnext: {}

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ gem 'maildown'
6464
# JavaScript #
6565
##############
6666
# Webpacker for the npm ecosystem
67-
gem 'webpacker', '~> 3.0'
67+
gem 'webpacker', '~> 3.5'
6868
# Use jquery as the JavaScript library
6969
gem 'jquery-rails'
7070
gem 'jquery-ui-rails'

Gemfile.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ GEM
208208
rack (>= 0.4)
209209
rack-protection (2.0.4)
210210
rack
211-
rack-proxy (0.6.2)
211+
rack-proxy (0.6.5)
212212
rack
213213
rack-test (1.1.0)
214214
rack (>= 1.0, < 3)
@@ -359,7 +359,7 @@ GEM
359359
activemodel (>= 5.0)
360360
bindex (>= 0.4.0)
361361
railties (>= 5.0)
362-
webpacker (3.0.2)
362+
webpacker (3.5.5)
363363
activesupport (>= 4.2)
364364
rack-proxy (>= 0.6.1)
365365
railties (>= 4.2)
@@ -425,7 +425,7 @@ DEPENDENCIES
425425
turbolinks
426426
uglifier (>= 1.3.0)
427427
web-console
428-
webpacker (~> 3.0)
428+
webpacker (~> 3.5)
429429

430430
RUBY VERSION
431431
ruby 2.5.0p0

Procfile.dev

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
web: bin/rails server -p 5000
2+
webpack: bin/webpack-dev-server
23
sidekiq: bundle exec sidekiq -c 1

app/assets/javascripts/application.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
//= require jquery-ui/widgets/droppable
1919
//= require jquery-ui/widgets/tabs
2020
//= require jquery-ui/widgets/selectable
21+
//= require activestorage
2122
//= require turbolinks
2223
//= require best_in_place
2324
//= require_tree .
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/* direct_uploads.css */
2+
3+
.direct-upload {
4+
display: inline-block;
5+
position: relative;
6+
padding: 2px 4px;
7+
margin: 0 3px 3px 0;
8+
border: 1px solid rgba(0, 0, 0, 0.3);
9+
border-radius: 3px;
10+
font-size: 11px;
11+
line-height: 13px;
12+
}
13+
14+
.direct-upload--pending {
15+
opacity: 0.6;
16+
}
17+
18+
.direct-upload__progress {
19+
position: absolute;
20+
top: 0;
21+
left: 0;
22+
bottom: 0;
23+
opacity: 0.2;
24+
background: #0076ff;
25+
transition: width 120ms ease-out, opacity 60ms 60ms ease-in;
26+
transform: translate3d(0, 0, 0);
27+
}
28+
29+
.direct-upload--complete .direct-upload__progress {
30+
opacity: 0.4;
31+
}
32+
33+
.direct-upload--error {
34+
border-color: red;
35+
}
36+
37+
input[type=file][data-direct-upload-url][disabled] {
38+
display: none;
39+
}

0 commit comments

Comments
 (0)