iatelier 0.3.1 → 0.4.3
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/iatelier.rb +1 -1
- data/lib/iatelier/assets/stylesheets/iatelier.css +510 -0
- data/lib/iatelier/controllers/books/edit.rb +1 -0
- data/lib/iatelier/controllers/books/new.rb +1 -0
- data/lib/iatelier/controllers/books/update.rb +3 -1
- data/lib/iatelier/models/book.rb +28 -47
- data/lib/iatelier/templates/books/_engine.html.haml +2 -2
- data/lib/iatelier/templates/books/grouping/_keywords.html.haml +1 -1
- data/lib/iatelier/templates/books/new.html.haml +1 -2
- data/lib/iatelier/version.rb +1 -1
- data/package.json +1 -1
- data/src/sass/iatelier.scss +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 76590b778f4a1751dd45b71b66454fd09cd4ccef1d618877104640f4b081ada5
|
|
4
|
+
data.tar.gz: 19ee2dac571df2899673d08636fedcbeef8f77a29a5280d7c7e4c8711251ec23
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 85efe36bba980cf2d6ae02dad61d6d2d8df5f88cf4d65223d0bac66be8512ed167d804ba9b791348245a94c4c2bccb6487fa49e0495e3a7c765a952735fb2677
|
|
7
|
+
data.tar.gz: 2bad2720e84c46ba353a4226768a76a1384a6f2d4a6ccf95dbf5eb5f7ff3520d861de25a721eefd0b38a490e385537b22a8f5138d2aa7338d567c1d98f642add
|
data/lib/iatelier.rb
CHANGED
|
@@ -114,7 +114,7 @@ module Iatelier
|
|
|
114
114
|
#
|
|
115
115
|
# middleware.use Rack::Protection
|
|
116
116
|
middleware.use Rack::Auth::Basic, 'Welcome' do |username, password|
|
|
117
|
-
username ==
|
|
117
|
+
username == Iatelier.configuration.admin_username && password == Iatelier.configuration.admin_password
|
|
118
118
|
end
|
|
119
119
|
|
|
120
120
|
# Default format for the requests that don't specify an HTTP_ACCEPT header
|
|
@@ -521,6 +521,516 @@ a:hover {
|
|
|
521
521
|
background-color: rgba(255, 255, 255, 0.2);
|
|
522
522
|
}
|
|
523
523
|
|
|
524
|
+
.selectable-text {
|
|
525
|
+
cursor: text;
|
|
526
|
+
-webkit-user-select: text;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.text-center {
|
|
530
|
+
text-align: center;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.text-right {
|
|
534
|
+
text-align: right;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.text-left {
|
|
538
|
+
text-align: left;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.pull-left {
|
|
542
|
+
float: left;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
.pull-right {
|
|
546
|
+
float: right;
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
.padded {
|
|
550
|
+
padding: 10px;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
.padded-less {
|
|
554
|
+
padding: 5px;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
.padded-more {
|
|
558
|
+
padding: 20px;
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
.padded-vertically {
|
|
562
|
+
padding-top: 10px;
|
|
563
|
+
padding-bottom: 10px;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.padded-vertically-less {
|
|
567
|
+
padding-top: 5px;
|
|
568
|
+
padding-bottom: 5px;
|
|
569
|
+
}
|
|
570
|
+
|
|
571
|
+
.padded-vertically-more {
|
|
572
|
+
padding-top: 20px;
|
|
573
|
+
padding-bottom: 20px;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
.padded-horizontally {
|
|
577
|
+
padding-right: 10px;
|
|
578
|
+
padding-left: 10px;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.padded-horizontally-less {
|
|
582
|
+
padding-right: 5px;
|
|
583
|
+
padding-left: 5px;
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
.padded-horizontally-more {
|
|
587
|
+
padding-right: 20px;
|
|
588
|
+
padding-left: 20px;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.padded-top {
|
|
592
|
+
padding-top: 10px;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
.padded-top-less {
|
|
596
|
+
padding-top: 5px;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
.padded-top-more {
|
|
600
|
+
padding-top: 20px;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
.padded-bottom {
|
|
604
|
+
padding-bottom: 10px;
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
.padded-bottom-less {
|
|
608
|
+
padding-bottom: 5px;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
.padded-bottom-more {
|
|
612
|
+
padding-bottom: 20px;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
.sidebar {
|
|
616
|
+
background-color: #f5f5f4;
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
.draggable {
|
|
620
|
+
-webkit-app-region: drag;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
.clearfix:before,
|
|
624
|
+
.clearfix:after {
|
|
625
|
+
display: table;
|
|
626
|
+
content: " ";
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
.clearfix:after {
|
|
630
|
+
clear: both;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
* {
|
|
634
|
+
cursor: default;
|
|
635
|
+
box-sizing: border-box;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
html {
|
|
639
|
+
height: 100%;
|
|
640
|
+
width: 100%;
|
|
641
|
+
overflow: hidden;
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
body {
|
|
645
|
+
height: 100%;
|
|
646
|
+
padding: 0;
|
|
647
|
+
margin: 0;
|
|
648
|
+
font-family: system, -apple-system, ".SFNSDisplay-Regular", "Helvetica Neue", Helvetica, "Segoe UI", sans-serif;
|
|
649
|
+
font-size: 13px;
|
|
650
|
+
line-height: 1.6;
|
|
651
|
+
color: #333;
|
|
652
|
+
background-color: transparent;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
hr {
|
|
656
|
+
margin: 15px 0;
|
|
657
|
+
overflow: hidden;
|
|
658
|
+
background: transparent;
|
|
659
|
+
border: 0;
|
|
660
|
+
border-bottom: 1px solid #ddd;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
h1,
|
|
664
|
+
h2,
|
|
665
|
+
h3,
|
|
666
|
+
h4,
|
|
667
|
+
h5,
|
|
668
|
+
h6 {
|
|
669
|
+
margin-top: 20px;
|
|
670
|
+
margin-bottom: 10px;
|
|
671
|
+
font-weight: 500;
|
|
672
|
+
white-space: nowrap;
|
|
673
|
+
overflow: hidden;
|
|
674
|
+
text-overflow: ellipsis;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
h1 {
|
|
678
|
+
font-size: 36px;
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
h2 {
|
|
682
|
+
font-size: 30px;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
h3 {
|
|
686
|
+
font-size: 24px;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
h4 {
|
|
690
|
+
font-size: 18px;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
h5 {
|
|
694
|
+
font-size: 14px;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
h6 {
|
|
698
|
+
font-size: 12px;
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
/*
|
|
702
|
+
.window {
|
|
703
|
+
position: absolute;
|
|
704
|
+
top: 0;
|
|
705
|
+
right: 0;
|
|
706
|
+
bottom: 0;
|
|
707
|
+
left: 0;
|
|
708
|
+
display: flex;
|
|
709
|
+
flex-direction: column;
|
|
710
|
+
background-color: $chrome-color;
|
|
711
|
+
}
|
|
712
|
+
*/
|
|
713
|
+
|
|
714
|
+
.window-content {
|
|
715
|
+
position: relative;
|
|
716
|
+
overflow-y: auto;
|
|
717
|
+
display: -webkit-box;
|
|
718
|
+
display: flex;
|
|
719
|
+
-webkit-box-flex: 1;
|
|
720
|
+
flex: 1;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
.toolbar {
|
|
724
|
+
min-height: 22px;
|
|
725
|
+
box-shadow: inset 0 1px 0 #f5f4f5;
|
|
726
|
+
background-color: #e8e6e8;
|
|
727
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e6e8), to(#d1cfd1));
|
|
728
|
+
background-image: linear-gradient(to bottom, #e8e6e8 0%, #d1cfd1 100%);
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
.toolbar:before,
|
|
732
|
+
.toolbar:after {
|
|
733
|
+
display: table;
|
|
734
|
+
content: " ";
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
.toolbar:after {
|
|
738
|
+
clear: both;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
.toolbar-header {
|
|
742
|
+
border-bottom: 1px solid #b3b2b3;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
.toolbar-header .title {
|
|
746
|
+
margin-top: 1px;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
.toolbar-footer {
|
|
750
|
+
border-top: 1px solid #b3b2b3;
|
|
751
|
+
-webkit-app-region: drag;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
.title {
|
|
755
|
+
margin: 0;
|
|
756
|
+
font-size: 12px;
|
|
757
|
+
font-weight: 400;
|
|
758
|
+
text-align: center;
|
|
759
|
+
color: #555;
|
|
760
|
+
cursor: default;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
.toolbar-borderless {
|
|
764
|
+
border-top: 0;
|
|
765
|
+
border-bottom: 0;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
.toolbar-actions {
|
|
769
|
+
margin-top: 4px;
|
|
770
|
+
margin-bottom: 3px;
|
|
771
|
+
padding-right: 3px;
|
|
772
|
+
padding-left: 3px;
|
|
773
|
+
padding-bottom: 3px;
|
|
774
|
+
-webkit-app-region: drag;
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
.toolbar-actions:before,
|
|
778
|
+
.toolbar-actions:after {
|
|
779
|
+
display: table;
|
|
780
|
+
content: " ";
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
.toolbar-actions:after {
|
|
784
|
+
clear: both;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.toolbar-actions > .btn,
|
|
788
|
+
.toolbar-actions > .btn-group {
|
|
789
|
+
margin-left: 4px;
|
|
790
|
+
margin-right: 4px;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.menu-bar {
|
|
794
|
+
margin: 0px;
|
|
795
|
+
padding: 0px;
|
|
796
|
+
font-size: 12px;
|
|
797
|
+
background-color: #d3d3d3;
|
|
798
|
+
border-bottom: 1px solid black;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
.menu-bar a {
|
|
802
|
+
display: inline-block;
|
|
803
|
+
margin: 0px 0px;
|
|
804
|
+
padding: 1px 8px;
|
|
805
|
+
border: none;
|
|
806
|
+
background-color: transparent;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
.menu-bar a:hover {
|
|
810
|
+
color: white;
|
|
811
|
+
background-color: #345EF2;
|
|
812
|
+
border: none;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
.window .bar {
|
|
816
|
+
box-shadow: inset 0 1px 0 #f5f4f5;
|
|
817
|
+
background-color: #e8e6e8;
|
|
818
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e6e8), to(#d1cfd1));
|
|
819
|
+
background-image: linear-gradient(to bottom, #e8e6e8 0%, #d1cfd1 100%);
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
.window .bar > .menu {
|
|
823
|
+
height: 22px;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
.window .bar > .buttons {
|
|
827
|
+
height: 44px;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
.window .bar > .tabs {
|
|
831
|
+
border-top: 1px solid gray;
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
.window .bar > .tabs > a {
|
|
835
|
+
display: inline-block;
|
|
836
|
+
font-size: 12px;
|
|
837
|
+
margin: 4px 1px;
|
|
838
|
+
padding: 0px 8px;
|
|
839
|
+
border-radius: 4px;
|
|
840
|
+
border: none;
|
|
841
|
+
background-color: transparent;
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
.window .bar > .tabs > a:hover {
|
|
845
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
846
|
+
color: white;
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
.window .bar > .tabs > a:active {
|
|
850
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
851
|
+
color: white;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
#os {
|
|
855
|
+
display: -ms-grid;
|
|
856
|
+
display: grid;
|
|
857
|
+
-ms-grid-rows: 20px auto;
|
|
858
|
+
grid-template-rows: 20px auto;
|
|
859
|
+
height: 100vh;
|
|
860
|
+
width: 100vw;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
#os .menu-bar {
|
|
864
|
+
margin: 0px;
|
|
865
|
+
padding: 0px;
|
|
866
|
+
font-size: 12px;
|
|
867
|
+
background-color: #d3d3d3;
|
|
868
|
+
border-bottom: 1px solid black;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
#os .menu-bar a {
|
|
872
|
+
display: inline-block;
|
|
873
|
+
margin: 0px 0px;
|
|
874
|
+
padding: 1px 8px;
|
|
875
|
+
border: none;
|
|
876
|
+
background-color: transparent;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
#os .menu-bar a:hover {
|
|
880
|
+
color: white;
|
|
881
|
+
background-color: #345EF2;
|
|
882
|
+
border: none;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
#os .desk {
|
|
886
|
+
min-height: 0;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
.window {
|
|
890
|
+
height: 100%;
|
|
891
|
+
max-height: 100%;
|
|
892
|
+
max-width: 100%;
|
|
893
|
+
display: -ms-grid;
|
|
894
|
+
display: grid;
|
|
895
|
+
-ms-grid-rows: min-content 1fr min-content;
|
|
896
|
+
grid-template-rows: -webkit-min-content 1fr -webkit-min-content;
|
|
897
|
+
grid-template-rows: min-content 1fr min-content;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
.window .bar {
|
|
901
|
+
box-shadow: inset 0 1px 0 #f5f4f5;
|
|
902
|
+
background-color: #e8e6e8;
|
|
903
|
+
background-image: -webkit-gradient(linear, left top, left bottom, from(#e8e6e8), to(#d1cfd1));
|
|
904
|
+
background-image: linear-gradient(to bottom, #e8e6e8 0%, #d1cfd1 100%);
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
.window .bar > .menu {
|
|
908
|
+
height: 22px;
|
|
909
|
+
text-align: center;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.window .bar > .buttons {
|
|
913
|
+
height: 44px;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
.window .bar > .tabs {
|
|
917
|
+
border-top: 1px solid gray;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
.window .bar > .tabs > a {
|
|
921
|
+
display: inline-block;
|
|
922
|
+
font-size: 12px;
|
|
923
|
+
margin: 4px 1px;
|
|
924
|
+
padding: 0px 8px;
|
|
925
|
+
border-radius: 4px;
|
|
926
|
+
border: none;
|
|
927
|
+
background-color: transparent;
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.window .bar > .tabs > a:hover {
|
|
931
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
932
|
+
color: white;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.window .bar > .tabs > a:active {
|
|
936
|
+
background-color: rgba(0, 0, 0, 0.4);
|
|
937
|
+
color: white;
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
.window .content {
|
|
941
|
+
min-height: 0;
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
.window-drawer-top {
|
|
945
|
+
margin: 0.5rem auto;
|
|
946
|
+
padding: 0.4rem;
|
|
947
|
+
max-width: 40rem;
|
|
948
|
+
text-align: left;
|
|
949
|
+
background-color: #e8e6e8;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
.window > .content {
|
|
953
|
+
display: -ms-grid;
|
|
954
|
+
display: grid;
|
|
955
|
+
-ms-grid-columns: 1fr;
|
|
956
|
+
grid-template-columns: 1fr;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
@media screen and (min-width: 35.5em) {
|
|
960
|
+
.window > .content {
|
|
961
|
+
-ms-grid-columns: 14.4rem 1fr;
|
|
962
|
+
grid-template-columns: 14.4rem 1fr;
|
|
963
|
+
}
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
.window > .content > .sidebar {
|
|
967
|
+
display: none;
|
|
968
|
+
overflow-y: scroll;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
@media screen and (min-width: 35.5em) {
|
|
972
|
+
.window > .content > .sidebar {
|
|
973
|
+
display: block;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
.window > .content > .panel {
|
|
978
|
+
overflow: scroll;
|
|
979
|
+
min-width: 0px;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
.text-editor {
|
|
983
|
+
min-height: 80vh;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
.panel-edit > .form-box {
|
|
987
|
+
padding: 0.8rem;
|
|
988
|
+
background-color: #cdcdcd;
|
|
989
|
+
border-radius: 0.4rem;
|
|
990
|
+
box-shadow: inset 0px 0px 1px grey;
|
|
991
|
+
}
|
|
992
|
+
|
|
993
|
+
.os-form-group {
|
|
994
|
+
margin: 0.4rem 0.4rem;
|
|
995
|
+
white-space: nowrap;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
.os-form-group > label {
|
|
999
|
+
display: inline-block;
|
|
1000
|
+
width: 5em;
|
|
1001
|
+
vertical-align: middle;
|
|
1002
|
+
text-align: end;
|
|
1003
|
+
white-space: normal;
|
|
1004
|
+
word-wrap: break-word;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
.os-form-group > .form-control {
|
|
1008
|
+
display: inline-block;
|
|
1009
|
+
width: calc(100% - 5em);
|
|
1010
|
+
box-sizing: border-box;
|
|
1011
|
+
vertical-align: middle;
|
|
1012
|
+
white-space: normal;
|
|
1013
|
+
}
|
|
1014
|
+
|
|
1015
|
+
/*
|
|
1016
|
+
@import '~purecss/build/pure-min.css';
|
|
1017
|
+
@import '~purecss/build/grids-responsive-min.css';
|
|
1018
|
+
@import '/pure/grids/xx';
|
|
1019
|
+
|
|
1020
|
+
// BlazeCSS
|
|
1021
|
+
// @import '~blaze';
|
|
1022
|
+
|
|
1023
|
+
// font
|
|
1024
|
+
@import '/fonts';
|
|
1025
|
+
|
|
1026
|
+
// variables & basics
|
|
1027
|
+
@import '/shadow';
|
|
1028
|
+
@import '/colors/style';
|
|
1029
|
+
|
|
1030
|
+
@import '/components/link-button';
|
|
1031
|
+
@import '/components/insection';
|
|
1032
|
+
*/
|
|
1033
|
+
|
|
524
1034
|
.text-editor {
|
|
525
1035
|
min-height: 80vh;
|
|
526
1036
|
}
|
|
@@ -5,8 +5,10 @@ module Iatelier
|
|
|
5
5
|
include Iatelier::Action
|
|
6
6
|
include Iatelier::Controllers::Books::DbConnector
|
|
7
7
|
def call(params)
|
|
8
|
-
|
|
8
|
+
@database = params[:database]
|
|
9
|
+
self.set_database @database
|
|
9
10
|
@book = Object.const_get(params[:book_type].capitalize).find(params[:id])
|
|
11
|
+
@book.namespace = Ilog.configuration.namespaces.key(@database)
|
|
10
12
|
@book.revise(params)
|
|
11
13
|
@book.save
|
|
12
14
|
self.body = @book.save.to_json
|
data/lib/iatelier/models/book.rb
CHANGED
|
@@ -2,14 +2,11 @@ require 'redcarpet'
|
|
|
2
2
|
|
|
3
3
|
class Book < ActiveRecord::Base
|
|
4
4
|
self.abstract_class = true
|
|
5
|
+
DIMENSIONS = []
|
|
6
|
+
GROUPINGS = []
|
|
7
|
+
ROLES = []
|
|
5
8
|
|
|
6
|
-
@@dimensions = []
|
|
7
|
-
@@groupings = []
|
|
8
|
-
@@roles = []
|
|
9
|
-
|
|
10
9
|
@content_raw = ''
|
|
11
|
-
|
|
12
|
-
@namespace = nil
|
|
13
10
|
|
|
14
11
|
has_one :title, as: :titleable, class_name: 'Dimensions::Title'
|
|
15
12
|
has_one :slug, as: :slugable, class_name: 'Dimensions::Slug'
|
|
@@ -23,49 +20,38 @@ class Book < ActiveRecord::Base
|
|
|
23
20
|
|
|
24
21
|
has_many :peopleables, as: :peopleable, dependent: :destroy
|
|
25
22
|
has_many :peoples, through: :peopleables
|
|
26
|
-
|
|
23
|
+
|
|
27
24
|
has_many :bundleables, as: :bundleable, dependent: :destroy
|
|
28
25
|
has_many :bundles, through: :bundleables
|
|
29
|
-
|
|
26
|
+
|
|
30
27
|
accepts_nested_attributes_for :title, :slug, :subtitle, :description, :thumbnail, :timestamp
|
|
31
28
|
validates_associated :slug
|
|
32
|
-
|
|
29
|
+
|
|
33
30
|
attr_accessor :namespace
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
|
|
36
33
|
def kind
|
|
37
34
|
self.class.to_s
|
|
38
35
|
end
|
|
39
36
|
def uniq
|
|
40
37
|
self.class.to_s + self.id.to_s
|
|
41
38
|
end
|
|
42
|
-
|
|
43
|
-
def dimensions
|
|
44
|
-
@@dimensions
|
|
45
|
-
end
|
|
46
|
-
def self.dimensions
|
|
47
|
-
@@dimensions
|
|
48
|
-
end
|
|
49
39
|
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
def dimensions
|
|
41
|
+
self.class::DIMENSIONS
|
|
52
42
|
end
|
|
53
|
-
def
|
|
54
|
-
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def groupings
|
|
58
|
-
@@groupings
|
|
43
|
+
def groupings
|
|
44
|
+
self.class::GROUPINGS
|
|
59
45
|
end
|
|
60
|
-
def
|
|
61
|
-
|
|
46
|
+
def roles
|
|
47
|
+
self.class::ROLES
|
|
62
48
|
end
|
|
63
49
|
|
|
64
50
|
def individuals requested_role
|
|
65
51
|
@query = '`peopleables`.`role` = "' + requested_role.to_s + '"'
|
|
66
52
|
self.peoples.includes(:peopleables).where(@query)
|
|
67
53
|
end
|
|
68
|
-
|
|
54
|
+
|
|
69
55
|
def content_raw
|
|
70
56
|
puts 'trying to open content'
|
|
71
57
|
unless self.id.nil?
|
|
@@ -82,11 +68,7 @@ class Book < ActiveRecord::Base
|
|
|
82
68
|
@content = nil
|
|
83
69
|
end
|
|
84
70
|
end
|
|
85
|
-
|
|
86
|
-
def self.with_all
|
|
87
|
-
self.includes(self.dimensions + self.groupings)
|
|
88
|
-
end
|
|
89
|
-
|
|
71
|
+
|
|
90
72
|
def content
|
|
91
73
|
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
|
|
92
74
|
markdown.render(self.content_raw)
|
|
@@ -95,16 +77,16 @@ class Book < ActiveRecord::Base
|
|
|
95
77
|
# def initialized
|
|
96
78
|
# super()
|
|
97
79
|
# puts "content of the dimension: \n"
|
|
98
|
-
# puts
|
|
99
|
-
#
|
|
80
|
+
# puts dimensions.inspect
|
|
81
|
+
# dimensions.each do |dimension|
|
|
100
82
|
# reference = dimension + able
|
|
101
83
|
# hasone dimension.to_sym as: reference.to_sym
|
|
102
84
|
# end
|
|
103
85
|
# end
|
|
104
86
|
|
|
105
87
|
def create params
|
|
106
|
-
puts 'these are the stuff were going to add:' +
|
|
107
|
-
|
|
88
|
+
puts 'these are the stuff were going to add:' + dimensions.to_s
|
|
89
|
+
dimensions.each do |dimension|
|
|
108
90
|
method_name = 'setup_' + dimension
|
|
109
91
|
self.public_send(method_name.to_sym, params)
|
|
110
92
|
end
|
|
@@ -115,7 +97,7 @@ class Book < ActiveRecord::Base
|
|
|
115
97
|
end
|
|
116
98
|
|
|
117
99
|
def revise params
|
|
118
|
-
|
|
100
|
+
dimensions.each do |dimension|
|
|
119
101
|
if self.public_send(dimension.to_sym)
|
|
120
102
|
method_name = 'revise_' + dimension
|
|
121
103
|
else
|
|
@@ -123,7 +105,7 @@ class Book < ActiveRecord::Base
|
|
|
123
105
|
end
|
|
124
106
|
self.public_send(method_name.to_sym, params)
|
|
125
107
|
end
|
|
126
|
-
|
|
108
|
+
dimensions.each do |dimension|
|
|
127
109
|
self.public_send(dimension.to_sym).save
|
|
128
110
|
end
|
|
129
111
|
sync_keywords params
|
|
@@ -193,11 +175,11 @@ class Book < ActiveRecord::Base
|
|
|
193
175
|
def revise_title params
|
|
194
176
|
self.title.update(value: params[:title])
|
|
195
177
|
end
|
|
196
|
-
|
|
178
|
+
|
|
197
179
|
def setup_subtitle params
|
|
198
180
|
self.build_subtitle({value: params[:subtitle]})
|
|
199
181
|
end
|
|
200
|
-
def
|
|
182
|
+
def revise_subtitle params
|
|
201
183
|
self.subtitle.update(value: params[:subtitle])
|
|
202
184
|
end
|
|
203
185
|
|
|
@@ -207,12 +189,12 @@ class Book < ActiveRecord::Base
|
|
|
207
189
|
def revise_slug params
|
|
208
190
|
self.slug.update(value: params[:slug])
|
|
209
191
|
end
|
|
210
|
-
|
|
192
|
+
|
|
211
193
|
def setup_thumbnail params
|
|
212
194
|
end
|
|
213
195
|
def revise_thumbnail params
|
|
214
196
|
end
|
|
215
|
-
|
|
197
|
+
|
|
216
198
|
def setup_timestamp params
|
|
217
199
|
puts 'setting up timestamp'
|
|
218
200
|
self.build_timestamp({
|
|
@@ -235,10 +217,9 @@ class Book < ActiveRecord::Base
|
|
|
235
217
|
self.setup_timestamp params
|
|
236
218
|
end
|
|
237
219
|
end
|
|
238
|
-
|
|
220
|
+
|
|
239
221
|
def sync_content params
|
|
240
|
-
|
|
241
|
-
path = Iatelier.configuration.storage_dir + params[:database].to_s + self.class.name.downcase + '/' + self.id.to_s
|
|
222
|
+
path = Iatelier.configuration.storage_dir + @namespace.to_s + self.class.name.downcase + '/' + self.id.to_s
|
|
242
223
|
Dir.mkdir(path) unless File.exists?(path)
|
|
243
224
|
File.open(path + '/main.md', 'w+') do |file|
|
|
244
225
|
file.puts params[:content]
|
|
@@ -248,4 +229,4 @@ class Book < ActiveRecord::Base
|
|
|
248
229
|
self.save
|
|
249
230
|
puts self.loc.to_s
|
|
250
231
|
end
|
|
251
|
-
end
|
|
232
|
+
end
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
-if book.dimensions.include? 'description'
|
|
17
17
|
%label.label Description
|
|
18
18
|
%input{:class => "form-control pure-input-1", :name => "description", :type => "text", :placeholder => "Description", :value => book.description.try(:value)}
|
|
19
|
-
|
|
20
19
|
.form-box
|
|
21
20
|
%label Text
|
|
22
|
-
%
|
|
21
|
+
%br
|
|
22
|
+
%textarea{:name => "content", :class => "text-editor pure-input-1 form-control", :type => "text", :placeholder => "Content of the book ...", :style => "width: 100%"}
|
|
23
23
|
-unless book.content_raw.nil?
|
|
24
24
|
= book.content_raw
|
|
25
25
|
%div{:class => "grid-large panel-edit"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
%div{:class => "c-card__item c-card__item--divider"}
|
|
2
|
-
.span Keyword
|
|
3
2
|
%div{:class => "c-card__item"}
|
|
3
|
+
%label Keywords
|
|
4
4
|
%input{:id => "keywords", :name => "keywords", :value => book.keywords.pluck(:word).join(", ")}
|
|
5
5
|
%div{:id => "keywords-field", :name => "keywords", :type => "text", :style => "width: 100%; display: block;"}
|
|
@@ -3,5 +3,4 @@
|
|
|
3
3
|
%form{:class => "atelier-main-form pure-form pure-form-aligned", :action => "/iatelier/#{database}/#{book.class.name.downcase}/#{book.id}", :method => "POST", :enctype => "multipart/form-data"}
|
|
4
4
|
.form-actions
|
|
5
5
|
<button type="submit" class="btn btn-default">Create</button>
|
|
6
|
-
|
|
7
|
-
= render :partial => 'engine'
|
|
6
|
+
= render :partial => 'engine'
|
data/lib/iatelier/version.rb
CHANGED
data/package.json
CHANGED
data/src/sass/iatelier.scss
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: iatelier
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3
|
|
4
|
+
version: 0.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Captain Husayn Pinguin
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-01-
|
|
11
|
+
date: 2020-01-29 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|