exposition 0.0.3.pre.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (165) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/Rakefile +25 -0
  4. data/app/assets/images/exposition/twitter.svg +10 -0
  5. data/app/assets/javascripts/exposition/admin/application.js +3 -0
  6. data/app/assets/stylesheets/exposition/_breakpoints.scss +5 -0
  7. data/app/assets/stylesheets/exposition/_code.scss +83 -0
  8. data/app/assets/stylesheets/exposition/_footer.scss +9 -0
  9. data/app/assets/stylesheets/exposition/_header.scss +62 -0
  10. data/app/assets/stylesheets/exposition/_layout.scss +28 -0
  11. data/app/assets/stylesheets/exposition/_mixins.scss +4 -0
  12. data/app/assets/stylesheets/exposition/_normalize.scss +427 -0
  13. data/app/assets/stylesheets/exposition/_pagination.scss +18 -0
  14. data/app/assets/stylesheets/exposition/_posts.scss +96 -0
  15. data/app/assets/stylesheets/exposition/_tags.scss +12 -0
  16. data/app/assets/stylesheets/exposition/_variables.scss +16 -0
  17. data/app/assets/stylesheets/exposition/admin/_layout.scss +58 -0
  18. data/app/assets/stylesheets/exposition/admin/_mixins.scss +3 -0
  19. data/app/assets/stylesheets/exposition/admin/_notifications.scss +46 -0
  20. data/app/assets/stylesheets/exposition/admin/_pagination.scss +12 -0
  21. data/app/assets/stylesheets/exposition/admin/_posts.scss +7 -0
  22. data/app/assets/stylesheets/exposition/admin/application.scss +9 -0
  23. data/app/assets/stylesheets/exposition/admin/base/_base.scss +15 -0
  24. data/app/assets/stylesheets/exposition/admin/base/_buttons.scss +31 -0
  25. data/app/assets/stylesheets/exposition/admin/base/_forms.scss +78 -0
  26. data/app/assets/stylesheets/exposition/admin/base/_grid-settings.scss +14 -0
  27. data/app/assets/stylesheets/exposition/admin/base/_lists.scss +31 -0
  28. data/app/assets/stylesheets/exposition/admin/base/_tables.scss +25 -0
  29. data/app/assets/stylesheets/exposition/admin/base/_typography.scss +55 -0
  30. data/app/assets/stylesheets/exposition/admin/base/_variables.scss +35 -0
  31. data/app/assets/stylesheets/exposition/admin/normalize.scss +427 -0
  32. data/app/assets/stylesheets/exposition/application.scss +17 -0
  33. data/app/controllers/exposition/admin/admin_controller.rb +5 -0
  34. data/app/controllers/exposition/admin/posts_controller.rb +5 -0
  35. data/app/controllers/exposition/admin/sessions_controller.rb +31 -0
  36. data/app/controllers/exposition/admin/tags_controller.rb +5 -0
  37. data/app/controllers/exposition/application_controller.rb +8 -0
  38. data/app/controllers/exposition/posts_controller.rb +5 -0
  39. data/app/controllers/exposition/tags_controller.rb +5 -0
  40. data/app/helpers/exposition/admin/flashes_helper.rb +7 -0
  41. data/app/helpers/exposition/admin/sessions_helper.rb +20 -0
  42. data/app/helpers/exposition/markdown_helper.rb +21 -0
  43. data/app/models/categorical/tag.rb +6 -0
  44. data/app/models/exposition/encryptor.rb +10 -0
  45. data/app/models/exposition/post.rb +5 -0
  46. data/app/models/exposition/user.rb +5 -0
  47. data/app/views/exposition/admin/images/index.html.haml +12 -0
  48. data/app/views/exposition/admin/images/new.html.haml +0 -0
  49. data/app/views/exposition/admin/posts/_error_handler.html.haml +8 -0
  50. data/app/views/exposition/admin/posts/_form_fields.html.haml +23 -0
  51. data/app/views/exposition/admin/posts/edit.html.haml +5 -0
  52. data/app/views/exposition/admin/posts/index.html.haml +23 -0
  53. data/app/views/exposition/admin/posts/new.html.haml +7 -0
  54. data/app/views/exposition/admin/posts/update.html.haml +2 -0
  55. data/app/views/exposition/admin/sessions/new.html.haml +10 -0
  56. data/app/views/exposition/admin/tags/_error_handler.html.haml +8 -0
  57. data/app/views/exposition/admin/tags/edit.html.haml +10 -0
  58. data/app/views/exposition/admin/tags/index.html.haml +18 -0
  59. data/app/views/exposition/admin/tags/new.html.haml +10 -0
  60. data/app/views/exposition/posts/_post.html.haml +8 -0
  61. data/app/views/exposition/posts/_tags.html.haml +6 -0
  62. data/app/views/exposition/posts/index.html.haml +8 -0
  63. data/app/views/exposition/posts/show.html.haml +5 -0
  64. data/app/views/exposition/tags/show.html.haml +6 -0
  65. data/app/views/layouts/exposition/admin.html.haml +22 -0
  66. data/app/views/layouts/exposition/application.html.haml +20 -0
  67. data/config/locales/en.yml +37 -0
  68. data/config/routes.rb +14 -0
  69. data/db/migrate/20160106220615_create_exposition_posters.rb +12 -0
  70. data/db/migrate/20160112194424_add_author_id_to_posts.rb +5 -0
  71. data/db/migrate/20160112200248_create_exposition_users.rb +14 -0
  72. data/db/migrate/20160112202302_add_slug_to_expositon_posts.rb +7 -0
  73. data/db/migrate/20160112204019_add_categorial_tags.rb +17 -0
  74. data/db/migrate/20160225203524_add_summary_to_posts.rb +5 -0
  75. data/db/migrate/20160226035733_convert_published_at_to_datetime.rb +9 -0
  76. data/lib/exposition.rb +19 -0
  77. data/lib/exposition/concerns/controllers/admin/admin_controller.rb +39 -0
  78. data/lib/exposition/concerns/controllers/admin/posts_controller.rb +70 -0
  79. data/lib/exposition/concerns/controllers/admin/tags_controller.rb +63 -0
  80. data/lib/exposition/concerns/controllers/posts_controller.rb +19 -0
  81. data/lib/exposition/concerns/controllers/tags_controller.rb +31 -0
  82. data/lib/exposition/concerns/models/post.rb +52 -0
  83. data/lib/exposition/concerns/models/user.rb +43 -0
  84. data/lib/exposition/engine.rb +14 -0
  85. data/lib/exposition/setup.rb +15 -0
  86. data/lib/exposition/version.rb +3 -0
  87. data/lib/tasks/exposition_tasks.rake +4 -0
  88. data/lib/tasks/setup.rb +17 -0
  89. data/spec/controllers/exposition/admin/admin_controller_spec.rb +88 -0
  90. data/spec/controllers/exposition/admin/posts_controller_spec.rb +153 -0
  91. data/spec/controllers/exposition/admin/sessions_controller_spec.rb +46 -0
  92. data/spec/controllers/exposition/admin/tags_controller_spec.rb +106 -0
  93. data/spec/controllers/exposition/posts_controller_spec.rb +43 -0
  94. data/spec/controllers/exposition/tags_controller_spec.rb +40 -0
  95. data/spec/dummy/Gemfile +5 -0
  96. data/spec/dummy/Gemfile.lock +173 -0
  97. data/spec/dummy/README.rdoc +28 -0
  98. data/spec/dummy/Rakefile +6 -0
  99. data/spec/dummy/Thorfile +1 -0
  100. data/spec/dummy/app/assets/javascripts/application.js +1 -0
  101. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  102. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  103. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  104. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  105. data/spec/dummy/bin/bundle +3 -0
  106. data/spec/dummy/bin/rails +9 -0
  107. data/spec/dummy/bin/rake +9 -0
  108. data/spec/dummy/bin/setup +29 -0
  109. data/spec/dummy/bin/spring +15 -0
  110. data/spec/dummy/bin/thor +16 -0
  111. data/spec/dummy/config.ru +4 -0
  112. data/spec/dummy/config/application.rb +26 -0
  113. data/spec/dummy/config/boot.rb +3 -0
  114. data/spec/dummy/config/database.yml +12 -0
  115. data/spec/dummy/config/environment.rb +5 -0
  116. data/spec/dummy/config/environments/development.rb +41 -0
  117. data/spec/dummy/config/environments/production.rb +79 -0
  118. data/spec/dummy/config/environments/test.rb +42 -0
  119. data/spec/dummy/config/initializers/assets.rb +11 -0
  120. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  121. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  122. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  123. data/spec/dummy/config/initializers/inflections.rb +16 -0
  124. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  125. data/spec/dummy/config/initializers/session_store.rb +3 -0
  126. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  127. data/spec/dummy/config/locales/en.yml +23 -0
  128. data/spec/dummy/config/routes.rb +3 -0
  129. data/spec/dummy/config/secrets.yml +22 -0
  130. data/spec/dummy/db/schema.rb +62 -0
  131. data/spec/dummy/db/seeds.rb +22 -0
  132. data/spec/dummy/public/404.html +67 -0
  133. data/spec/dummy/public/422.html +67 -0
  134. data/spec/dummy/public/500.html +66 -0
  135. data/spec/dummy/public/favicon.ico +0 -0
  136. data/spec/dummy/public/robots.txt +5 -0
  137. data/spec/factories/categorical/tags.rb +5 -0
  138. data/spec/factories/posts.rb +8 -0
  139. data/spec/factories/taggings.rb +7 -0
  140. data/spec/factories/users.rb +7 -0
  141. data/spec/features/admin/post_management_spec.rb +95 -0
  142. data/spec/features/admin/session_management_spec.rb +40 -0
  143. data/spec/features/admin/tags_management_spec.rb +59 -0
  144. data/spec/features/posts_index_spec.rb +28 -0
  145. data/spec/features/viewing_a_post_spec.rb +21 -0
  146. data/spec/features/viewing_posts_by_tag_spec.rb +17 -0
  147. data/spec/helpers/admin/flashes_helper_spec.rb +29 -0
  148. data/spec/helpers/admin/sessions_helper_spec.rb +56 -0
  149. data/spec/helpers/markdown_helper_spec.rb +10 -0
  150. data/spec/models/categorical/tag_spec.rb +35 -0
  151. data/spec/models/exposition/post_spec.rb +123 -0
  152. data/spec/models/exposition/user_spec.rb +15 -0
  153. data/spec/rails_helper.rb +47 -0
  154. data/spec/spec_helper.rb +11 -0
  155. data/spec/support/controllers.rb +6 -0
  156. data/spec/support/controllers/pagination.rb +17 -0
  157. data/spec/support/controllers/session_management.rb +20 -0
  158. data/spec/support/features.rb +6 -0
  159. data/spec/support/features/pagination.rb +22 -0
  160. data/spec/support/features/session_management.rb +17 -0
  161. data/spec/support/models.rb +5 -0
  162. data/spec/support/models/sluggable.rb +11 -0
  163. data/spec/tasks/setup_spec.rb +32 -0
  164. data/spec/views/admin/posts/index.html.haml_spec.rb +16 -0
  165. metadata +619 -0
@@ -0,0 +1,18 @@
1
+ nav.pagination {
2
+ @include base-padding;
3
+
4
+ margin: modular-scale(1) 0;
5
+
6
+ span {
7
+ background-color: $dark-background-color;
8
+ padding: modular-scale(-4) modular-scale(-3);
9
+ margin-right: modular-scale(-4);
10
+ text-align: center;
11
+ border: 1px dotted $border-color;
12
+ display: inline-block;
13
+ a {
14
+ color: $text-bold-color;
15
+ }
16
+
17
+ }
18
+ }
@@ -0,0 +1,96 @@
1
+ .posts, .post {
2
+ @include outer-container;
3
+ margin-top: 1em;
4
+ }
5
+
6
+ section.no-posts {
7
+ @include base-padding;
8
+ }
9
+
10
+ article {
11
+ @include outer-container;
12
+ @include base-padding;
13
+ h3 {
14
+ font-size: modular-scale(2);
15
+ margin: modular-scale(-4) 0;
16
+
17
+ a {
18
+ color: $text-bold-color;
19
+ border-bottom: 1px dotted;
20
+
21
+ &:hover {
22
+ color: $main-accent-color;
23
+ }
24
+
25
+ }
26
+ }
27
+
28
+ li {
29
+ a {
30
+ color: $main-accent-color;
31
+ border-bottom: 1px dotted $main-accent-color;
32
+ font-family: $serif-font;
33
+ // font-style: italic;
34
+ }
35
+ }
36
+
37
+
38
+ p {
39
+ line-height: modular-scale(1);
40
+
41
+ a {
42
+ color: $main-accent-color;
43
+ border-bottom: 1px dotted $main-accent-color;
44
+ font-family: $serif-font;
45
+ // font-style: italic;
46
+ }
47
+
48
+ em {
49
+ font-family: $serif-font;
50
+ font-style: italic;
51
+ }
52
+
53
+ strong {
54
+ font-weight: bold;
55
+ }
56
+
57
+ }
58
+
59
+ time {
60
+ color: $text-color;
61
+ font-size: modular-scale(-2);
62
+ }
63
+
64
+
65
+ a.continue-reading {
66
+ display: inline-block;
67
+ padding: modular-scale(-4);
68
+ margin: modular-scale(2) 0;
69
+ border-left: 4px solid $main-accent-color;
70
+ color: $main-accent-color;
71
+ font-size: modular-scale(-1);
72
+ font-family: $serif-font;
73
+ }
74
+
75
+ header {
76
+ padding: modular-scale(-1);
77
+ }
78
+
79
+ code {
80
+ padding: modular-scale(-5);
81
+ display: inline;
82
+ background-color: #212121;
83
+ color: $text-color;
84
+ }
85
+
86
+ pre.highlight {
87
+ background-color: #212121;
88
+ code {
89
+ padding: modular-scale(-1);
90
+ display: block;
91
+ background-color: #212121;
92
+ color: $text-color;
93
+ }
94
+ }
95
+ }
96
+
@@ -0,0 +1,12 @@
1
+ .tags {
2
+
3
+ margin: modular-scale(1) 0;
4
+
5
+ span {
6
+ background-color: $dark-background-color;
7
+ padding: modular-scale(-4);
8
+ a {
9
+ color: $text-bold-color;
10
+ }
11
+ }
12
+ }
@@ -0,0 +1,16 @@
1
+ $navy-blue: #192330;
2
+ $light-blue: #F0F4F7;
3
+ $light-gray-blue: #E3E9ED;
4
+ $gray-blue: #C2CED7;
5
+ $modular-scale-ratio: $perfect-fourth;
6
+ $modular-scale-base: 1.2em;
7
+
8
+ $background-color: #363636;
9
+ $dark-background-color: #2E2E2E;
10
+ $main-accent-color: #F0C800;
11
+ $border-color: rgb(93, 92, 92);
12
+ $text-bold-color: #eee;
13
+ $text-color: #A0A0A0;
14
+ $header-text-color: #9E9E9E;
15
+ $serif-font: "Merriweather", serif;
16
+ $sans-serif-font: "Merriweather Sans", sans-serif;
@@ -0,0 +1,58 @@
1
+ $modular-scale-ratio: $perfect-fourth;
2
+ $modular-scale-base: 1.2em;
3
+
4
+ nav.admin {
5
+ background-color: #5B5E63;
6
+ display: block;
7
+ overflow: auto;
8
+ @include base-padding;
9
+ @include outer-container(100%);
10
+
11
+ a {
12
+ color: #ffffff;
13
+
14
+ &:hover {
15
+ color: #FF9E61;
16
+ }
17
+ }
18
+
19
+ ul {
20
+ float: left;
21
+
22
+ li {
23
+ display: inline-block;
24
+ margin-right: modular-scale(0);
25
+ }
26
+ }
27
+
28
+ ul.login {
29
+ float: right;
30
+ }
31
+ }
32
+
33
+ h1 {
34
+ font-size: modular-scale(3);
35
+ }
36
+
37
+ h2 {
38
+ font-size: modular-scale(2);
39
+ }
40
+
41
+ section {
42
+ @include base-padding;
43
+ @include outer-container(100%);
44
+ }
45
+
46
+ .admin-title-header {
47
+ h2 {
48
+ display: inline-block;
49
+ }
50
+
51
+ a {
52
+ position: relative;
53
+ top: -5px;
54
+ padding: modular-scale(-2);
55
+ margin-left: modular-scale(1);
56
+ background-color: #eee;
57
+ }
58
+ }
@@ -0,0 +1,3 @@
1
+ @mixin base-padding {
2
+ padding: modular-scale(1);
3
+ }
@@ -0,0 +1,46 @@
1
+ $success: #96FFAE;
2
+ $notice: #B1DEEC;
3
+ $error: #ECB1B1;
4
+
5
+ @mixin flash-color($color) {
6
+ background-color: $color;
7
+ color: darken($color, 60%);
8
+ }
9
+
10
+ .flashes {
11
+ div {
12
+ @include base-padding;
13
+ }
14
+ }
15
+
16
+ .flash-success {
17
+ @include flash-color($success);
18
+ }
19
+
20
+ .flash-notice {
21
+ @include flash-color($notice);
22
+ }
23
+
24
+ .flash-error {
25
+ @include flash-color($error);
26
+ }
27
+
28
+ #error-explanation {
29
+ @include flash-color($error);
30
+ @include base-padding;
31
+
32
+ li {
33
+ list-style: disc;
34
+ list-style-position: inside;
35
+ }
36
+ }
37
+
38
+ .field_with_errors {
39
+ input {
40
+ border-color: darken($error, 40%);
41
+ }
42
+
43
+ label {
44
+ color: darken($error, 40%);
45
+ }
46
+ }
@@ -0,0 +1,12 @@
1
+ nav.pagination {
2
+ margin: modular-scale(1) 0;
3
+
4
+ span {
5
+ padding: modular-scale(-4) modular-scale(-3);
6
+ margin-right: modular-scale(-4);
7
+ text-align: center;
8
+ border: $base-border;
9
+ display: inline-block;
10
+ }
11
+ }
12
+
@@ -0,0 +1,7 @@
1
+ textarea#post_body {
2
+ height: modular-scale(10);
3
+ }
4
+
5
+ textarea#post_summary {
6
+ height: modular-scale(7);
7
+ }
@@ -0,0 +1,9 @@
1
+ @import 'normalize';
2
+ @import 'bourbon';
3
+ @import 'base/base';
4
+ @import 'neat';
5
+ @import 'mixins';
6
+ @import 'layout';
7
+ @import 'notifications';
8
+ @import 'posts';
9
+ @import 'pagination';
@@ -0,0 +1,15 @@
1
+ // Bitters 1.0.0
2
+ // http://bitters.bourbon.io
3
+ // Copyright 2013-2015 thoughtbot, inc.
4
+ // MIT License
5
+
6
+ @import "variables";
7
+
8
+ // Neat Settings -- uncomment if using Neat -- must be imported before Neat
9
+ @import "grid-settings";
10
+
11
+ @import "buttons";
12
+ @import "forms";
13
+ @import "lists";
14
+ @import "tables";
15
+ @import "typography";
@@ -0,0 +1,31 @@
1
+ #{$all-button-inputs},
2
+ button {
3
+ @include appearance(none);
4
+ -webkit-font-smoothing: antialiased;
5
+ background-color: $action-color;
6
+ border-radius: $base-border-radius;
7
+ border: none;
8
+ color: #fff;
9
+ cursor: pointer;
10
+ display: inline-block;
11
+ font-family: $base-font-family;
12
+ font-size: $base-font-size;
13
+ font-weight: 600;
14
+ line-height: 1;
15
+ padding: 0.75em 1em;
16
+ text-decoration: none;
17
+ user-select: none;
18
+ vertical-align: middle;
19
+ white-space: nowrap;
20
+
21
+ &:hover,
22
+ &:focus {
23
+ background-color: darken($action-color, 15%);
24
+ color: #fff;
25
+ }
26
+
27
+ &:disabled {
28
+ cursor: not-allowed;
29
+ opacity: 0.5;
30
+ }
31
+ }
@@ -0,0 +1,78 @@
1
+ fieldset {
2
+ background-color: lighten($base-border-color, 10%);
3
+ border: $base-border;
4
+ margin: 0 0 $small-spacing;
5
+ padding: $base-spacing;
6
+ }
7
+
8
+ input,
9
+ label,
10
+ select {
11
+ display: block;
12
+ font-family: $base-font-family;
13
+ font-size: $base-font-size;
14
+ }
15
+
16
+ label {
17
+ font-weight: 600;
18
+ margin-bottom: $small-spacing / 2;
19
+
20
+ &.required::after {
21
+ content: "*";
22
+ }
23
+
24
+ abbr {
25
+ display: none;
26
+ }
27
+ }
28
+
29
+ #{$all-text-inputs},
30
+ select[multiple=multiple],
31
+ textarea {
32
+ background-color: $base-background-color;
33
+ border: $base-border;
34
+ border-radius: $base-border-radius;
35
+ box-shadow: $form-box-shadow;
36
+ box-sizing: border-box;
37
+ font-family: $base-font-family;
38
+ font-size: $base-font-size;
39
+ margin-bottom: $base-spacing / 2;
40
+ padding: $base-spacing / 3;
41
+ transition: border-color;
42
+ width: 100%;
43
+
44
+ &:hover {
45
+ border-color: darken($base-border-color, 10%);
46
+ }
47
+
48
+ &:focus {
49
+ border-color: $action-color;
50
+ box-shadow: $form-box-shadow-focus;
51
+ outline: none;
52
+ }
53
+ }
54
+
55
+ textarea {
56
+ resize: vertical;
57
+ }
58
+
59
+ input[type="search"] {
60
+ @include appearance(none);
61
+ }
62
+
63
+ input[type="checkbox"],
64
+ input[type="radio"] {
65
+ display: inline;
66
+ margin-right: $small-spacing / 2;
67
+ }
68
+
69
+ input[type="file"] {
70
+ padding-bottom: $small-spacing;
71
+ width: 100%;
72
+ }
73
+
74
+ select {
75
+ margin-bottom: $base-spacing;
76
+ max-width: 100%;
77
+ width: auto;
78
+ }
@@ -0,0 +1,14 @@
1
+ @import "neat-helpers"; // or "../neat/neat-helpers" when not in Rails
2
+
3
+ // Neat Overrides
4
+ // $column: 90px;
5
+ // $gutter: 30px;
6
+ // $grid-columns: 12;
7
+ // $max-width: em(1088);
8
+
9
+ // Neat Breakpoints
10
+ $medium-screen: em(640);
11
+ $large-screen: em(860);
12
+
13
+ $medium-screen-up: new-breakpoint(min-width $medium-screen 4);
14
+ $large-screen-up: new-breakpoint(min-width $large-screen 8);
@@ -0,0 +1,31 @@
1
+ ul,
2
+ ol {
3
+ list-style-type: none;
4
+ margin: 0;
5
+ padding: 0;
6
+
7
+ &%default-ul {
8
+ list-style-type: disc;
9
+ margin-bottom: $small-spacing;
10
+ padding-left: $base-spacing;
11
+ }
12
+
13
+ &%default-ol {
14
+ list-style-type: decimal;
15
+ margin-bottom: $small-spacing;
16
+ padding-left: $base-spacing;
17
+ }
18
+ }
19
+
20
+ dl {
21
+ margin-bottom: $small-spacing;
22
+
23
+ dt {
24
+ font-weight: bold;
25
+ margin-top: $small-spacing;
26
+ }
27
+
28
+ dd {
29
+ margin: 0;
30
+ }
31
+ }