almanac 0.4.4
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.
- data/MIT-LICENSE +20 -0
- data/README.md +76 -0
- data/Rakefile +40 -0
- data/app/assets/images/almanac/background.jpg +0 -0
- data/app/assets/images/almanac/icons/compose.png +0 -0
- data/app/assets/images/almanac/icons/feed.png +0 -0
- data/app/assets/images/almanac/icons/gear.png +0 -0
- data/app/assets/images/almanac/icons/glyphicons-halflings-white.png +0 -0
- data/app/assets/images/almanac/icons/glyphicons-halflings.png +0 -0
- data/app/assets/images/almanac/icons/upload.png +0 -0
- data/app/assets/images/almanac/logo.jpg +0 -0
- data/app/assets/javascripts/almanac/2-jquery.backstretch.js +357 -0
- data/app/assets/javascripts/almanac/3-pixastic.js +637 -0
- data/app/assets/javascripts/almanac/4-bootstrap-datepicker.js +454 -0
- data/app/assets/javascripts/almanac/5-main.coffee.erb +46 -0
- data/app/assets/javascripts/almanac/application.js +16 -0
- data/app/assets/stylesheets/almanac/1-datepicker.css +7 -0
- data/app/assets/stylesheets/almanac/2-main.css.scss +279 -0
- data/app/assets/stylesheets/almanac/application.css +15 -0
- data/app/controllers/almanac/application_controller.rb +24 -0
- data/app/controllers/almanac/blogs_controller.rb +64 -0
- data/app/controllers/almanac/comments_controller.rb +41 -0
- data/app/controllers/almanac/images_controller.rb +29 -0
- data/app/controllers/almanac/posts_controller.rb +109 -0
- data/app/helpers/almanac/application_helper.rb +4 -0
- data/app/models/almanac/blog.rb +32 -0
- data/app/models/almanac/comment.rb +20 -0
- data/app/models/almanac/image.rb +10 -0
- data/app/models/almanac/post.rb +55 -0
- data/app/views/almanac/blogs/_form.html.haml +76 -0
- data/app/views/almanac/blogs/_topbar.html.haml +5 -0
- data/app/views/almanac/blogs/edit.html.haml +4 -0
- data/app/views/almanac/blogs/new.html.haml +3 -0
- data/app/views/almanac/blogs/spam.html.haml +15 -0
- data/app/views/almanac/posts/_form.html.haml +52 -0
- data/app/views/almanac/posts/_post.html.haml +59 -0
- data/app/views/almanac/posts/edit.html.haml +1 -0
- data/app/views/almanac/posts/index.html.haml +30 -0
- data/app/views/almanac/posts/index.rss.builder +18 -0
- data/app/views/almanac/posts/new.html.haml +1 -0
- data/app/views/almanac/posts/show.html.haml +4 -0
- data/app/views/almanac/posts/tag.html.haml +22 -0
- data/app/views/layouts/almanac/_ga.html.haml +10 -0
- data/app/views/layouts/almanac/_twitter_follow.html.haml +2 -0
- data/app/views/layouts/almanac/application.html.haml +52 -0
- data/config/routes.rb +22 -0
- data/db/migrate/20121009222451_create_almanac_posts.rb +17 -0
- data/db/migrate/20121010033555_create_almanac_blogs.rb +14 -0
- data/db/migrate/20121017032059_add_excerpt_to_almanac_posts.rb +11 -0
- data/db/migrate/20121017210007_create_almanac_files.rb +15 -0
- data/db/migrate/20121017221819_rename_file_to_image.rb +9 -0
- data/db/migrate/20121025223403_add_image_fields_to_almanac_blogs.rb +13 -0
- data/db/migrate/20121029211221_add_new_fields_to_blogs.rb +15 -0
- data/db/migrate/20121029221815_acts_as_taggable_on_migration.rb +30 -0
- data/db/migrate/20121101030836_create_almanac_comments.rb +16 -0
- data/db/migrate/20121102181941_add_rakismet_fields_to_blogs.rb +13 -0
- data/db/migrate/20121102185130_add_spam_to_comments.rb +11 -0
- data/db/migrate/20121110000024_add_written_at_to_posts.rb +11 -0
- data/db/migrate/20121112205256_add_background_fields_to_blogs.rb +13 -0
- data/db/migrate/20121113010557_add_footer_to_almanac_blogs.rb +11 -0
- data/db/migrate/20121114043648_change_default_value_for_background_tiles_in_almanac_blogs.rb +9 -0
- data/lib/almanac.rb +16 -0
- data/lib/almanac/MarkdownParser.rb +18 -0
- data/lib/almanac/engine.rb +9 -0
- data/lib/almanac/version.rb +3 -0
- data/lib/tasks/almanac_tasks.rake +4 -0
- data/spec/controllers/blogs_controller_spec.rb +80 -0
- data/spec/controllers/comments_controller_spec.rb +51 -0
- data/spec/controllers/posts_controller_spec.rb +120 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/ability.rb +13 -0
- data/spec/dummy/app/models/user.rb +11 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/config/application.rb +59 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/almanac.rb +1 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/devise.rb +233 -0
- data/spec/dummy/config/initializers/dragonfly.rb +7 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +14 -0
- data/spec/dummy/db/migrate/20121009230705_create_almanac_posts.rb +18 -0
- data/spec/dummy/db/migrate/20121010033827_create_almanac_blogs.rb +15 -0
- data/spec/dummy/db/migrate/20121102224650_add_excerpt_to_almanac_posts.rb +12 -0
- data/spec/dummy/db/migrate/20121102224651_create_almanac_files..rb +16 -0
- data/spec/dummy/db/migrate/20121102224652_rename_file_to_image.rb +10 -0
- data/spec/dummy/db/migrate/20121102224653_add_image_fields_to_almanac_blogs.rb +14 -0
- data/spec/dummy/db/migrate/20121102224654_add_new_fields_to_almanac_blogs.rb +16 -0
- data/spec/dummy/db/migrate/20121102224655_acts_as_taggable_on_migration.rb +31 -0
- data/spec/dummy/db/migrate/20121102224656_create_almanac_comments.rb +17 -0
- data/spec/dummy/db/migrate/20121102224657_add_rakismet_fields_to_almanac_blogs.rb +14 -0
- data/spec/dummy/db/migrate/20121102224658_add_spam_to_almanac_comments.rb +12 -0
- data/spec/dummy/db/migrate/20121106220325_devise_create_users.rb +46 -0
- data/spec/dummy/db/migrate/20121114032144_add_written_at_to_almanac_posts.rb +12 -0
- data/spec/dummy/db/migrate/20121114032145_add_background_fields_to_almanac_blogs.rb +14 -0
- data/spec/dummy/db/migrate/20121114032146_add_footer_to_almanac_blogs.rb +12 -0
- data/spec/dummy/db/schema.rb +98 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/production.log +1 -0
- data/spec/dummy/log/test.log +2930 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/factories.rb +72 -0
- data/spec/models/blog_spec.rb +16 -0
- data/spec/models/comment_spec.rb +35 -0
- data/spec/models/post_spec.rb +79 -0
- data/spec/spec_helper.rb +37 -0
- metadata +485 -0
@@ -0,0 +1,46 @@
|
|
1
|
+
$(document).ready ->
|
2
|
+
background = $("body").data("background-image")
|
3
|
+
background_tile = $("body").data("background-tile")
|
4
|
+
background_blur = $("body").data("background-blur")
|
5
|
+
logo = $("body").data("logo-image")
|
6
|
+
|
7
|
+
$("a.logo div").css("background-image", "url(" + (if logo? then logo else "<%= asset_path('almanac/logo.jpg') %>") + ")")
|
8
|
+
|
9
|
+
if background_tile
|
10
|
+
$("body.almanac").css("background-image", "url(" + (if background? then background else "<%= asset_path('almanac/background.jpg') %>") + ")")
|
11
|
+
else
|
12
|
+
image = new Image()
|
13
|
+
options = { amount: background_blur }
|
14
|
+
|
15
|
+
image.onload = ->
|
16
|
+
Pixastic.process (Pixastic.process image, "blurfast", options), "blur", options
|
17
|
+
$.backstretch options.resultCanvas.toDataURL('image/png')
|
18
|
+
|
19
|
+
image.src = if background? then background else "<%= asset_path('almanac/background.jpg') %>"
|
20
|
+
|
21
|
+
$(".custom-upload input[type=file]").change ->
|
22
|
+
$("#new_image input[type=submit]").show()
|
23
|
+
$(this).next().find("input").val $(this).val()
|
24
|
+
|
25
|
+
$("a.popup").click (e) ->
|
26
|
+
e.preventDefault()
|
27
|
+
window.open(this.href, "mywindow","width=600,height=300")
|
28
|
+
|
29
|
+
$("a.add-photo").click (e) ->
|
30
|
+
e.preventDefault()
|
31
|
+
$("#post_body").val($("#post_body").val() + "\n\n.data("image") + ")\n\n")
|
32
|
+
|
33
|
+
$(".delete-post").bind ("ajax:success"), ->
|
34
|
+
post = $(this).parent().parent()
|
35
|
+
if post.prev().attr('class') is "head" and post.next().attr('class') is "head"
|
36
|
+
post.prev().fadeOut()
|
37
|
+
post.fadeOut()
|
38
|
+
|
39
|
+
$(".delete-comment").bind ("ajax:success"), ->
|
40
|
+
comment = $(this).parent().parent()
|
41
|
+
if comment.prev().prop("tagName") is "H4" and comment.next().prop("tagName") is "HR"
|
42
|
+
comment.prev().fadeOut()
|
43
|
+
comment.next().fadeOut()
|
44
|
+
comment.fadeOut()
|
45
|
+
|
46
|
+
$('.datepicker').datepicker({ format: 'yyyy-mm-dd' })
|
@@ -0,0 +1,16 @@
|
|
1
|
+
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
+
// listed below.
|
3
|
+
//
|
4
|
+
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
+
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
6
|
+
//
|
7
|
+
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
+
// the compiled file.
|
9
|
+
//
|
10
|
+
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
11
|
+
// GO AFTER THE REQUIRES BELOW.
|
12
|
+
//
|
13
|
+
//= require jquery
|
14
|
+
//= require jquery_ujs
|
15
|
+
//= require bootstrap/bootstrap
|
16
|
+
//= require_tree .
|
@@ -0,0 +1,7 @@
|
|
1
|
+
/*
|
2
|
+
Datepicker for Bootstrap
|
3
|
+
Copyright 2012 Stefan Petre
|
4
|
+
Licensed under the Apache License v2.0
|
5
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
6
|
+
*/
|
7
|
+
.datepicker { top: 0; left: 0; padding: 4px; margin-top: 1px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; /*.dow { border-top: 1px solid #ddd !important; }*/ } .datepicker:before { content: ''; display: inline-block; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 7px solid #ccc; border-bottom-color: rgba(0, 0, 0, 0.2); position: absolute; top: -7px; left: 6px; } .datepicker:after { content: ''; display: inline-block; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 6px solid #ffffff; position: absolute; top: -6px; left: 7px; } .datepicker > div { display: none; } .datepicker table { width: 100%; margin: 0; } .datepicker td, .datepicker th { text-align: center; width: 20px; height: 20px; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td.day:hover { background: #eeeeee; cursor: pointer; } .datepicker td.old, .datepicker td.new { color: #999999; } .datepicker td.active, .datepicker td.active:hover { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td.active:hover, .datepicker td.active:hover:hover, .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active, .datepicker td.active.disabled, .datepicker td.active:hover.disabled, .datepicker td.active[disabled], .datepicker td.active:hover[disabled] { background-color: #0044cc; } .datepicker td.active:active, .datepicker td.active:hover:active, .datepicker td.active.active, .datepicker td.active:hover.active { background-color: #003399 \9; } .datepicker td span { display: block; width: 47px; height: 54px; line-height: 54px; float: left; margin: 2px; cursor: pointer; -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; } .datepicker td span:hover { background: #eeeeee; } .datepicker td span.active { background-color: #006dcc; background-image: -moz-linear-gradient(top, #0088cc, #0044cc); background-image: -ms-linear-gradient(top, #0088cc, #0044cc); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#0088cc), to(#0044cc)); background-image: -webkit-linear-gradient(top, #0088cc, #0044cc); background-image: -o-linear-gradient(top, #0088cc, #0044cc); background-image: linear-gradient(top, #0088cc, #0044cc); background-repeat: repeat-x; filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#0088cc', endColorstr='#0044cc', GradientType=0); border-color: #0044cc #0044cc #002a80; border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25); filter: progid:DXImageTransform.Microsoft.gradient(enabled = false); color: #fff; text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); } .datepicker td span.active:hover, .datepicker td span.active:active, .datepicker td span.active.active, .datepicker td span.active.disabled, .datepicker td span.active[disabled] { background-color: #0044cc; } .datepicker td span.active:active, .datepicker td span.active.active { background-color: #003399 \9; } .datepicker td span.old { color: #999999; } .datepicker th.switch { width: 145px; } .datepicker th.next, .datepicker th.prev { font-size: 19.5px; } .datepicker thead tr:first-child th { cursor: pointer; } .datepicker thead tr:first-child th:hover { background: #eeeeee; } .input-append.date .add-on i, .input-prepend.date .add-on i { display: block; cursor: pointer; width: 16px; height: 16px; }
|
@@ -0,0 +1,279 @@
|
|
1
|
+
$content-width: 600px;
|
2
|
+
$font-family-general: "Georgia", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
|
3
|
+
$font-family-title: "HelveticaNeueBold", "HelveticaNeue-Bold", "Helvetica Neue Bold", "HelveticaNeue", "Helvetica Neue", 'TeXGyreHerosCnBold', "Helvetica", "Tahoma", "Geneva", "Arial Narrow", "Arial", sans-serif;
|
4
|
+
|
5
|
+
.almanac {
|
6
|
+
background-color: grey;
|
7
|
+
[class^="icon-"], [class*=" icon-"] {
|
8
|
+
background-image: url("icons/glyphicons-halflings.png");
|
9
|
+
}
|
10
|
+
|
11
|
+
input[type="file"] {
|
12
|
+
margin-bottom: 10px;
|
13
|
+
}
|
14
|
+
|
15
|
+
.icon-white,
|
16
|
+
.nav-tabs > .active > a > [class^="icon-"],
|
17
|
+
.nav-tabs > .active > a > [class*=" icon-"],
|
18
|
+
.nav-pills > .active > a > [class^="icon-"],
|
19
|
+
.nav-pills > .active > a > [class*=" icon-"],
|
20
|
+
.nav-list > .active > a > [class^="icon-"],
|
21
|
+
.nav-list > .active > a > [class*=" icon-"],
|
22
|
+
.navbar-inverse .nav > .active > a > [class^="icon-"],
|
23
|
+
.navbar-inverse .nav > .active > a > [class*=" icon-"],
|
24
|
+
.dropdown-menu > li > a:hover > [class^="icon-"],
|
25
|
+
.dropdown-menu > li > a:hover > [class*=" icon-"],
|
26
|
+
.dropdown-menu > .active > a > [class^="icon-"],
|
27
|
+
.dropdown-menu > .active > a > [class*=" icon-"] {
|
28
|
+
background-image: url("icons/glyphicons-halflings-white.png");
|
29
|
+
}
|
30
|
+
|
31
|
+
.footer {
|
32
|
+
color: white;
|
33
|
+
padding-bottom: 20px;
|
34
|
+
text-align: center;
|
35
|
+
text-shadow: 0 1px 4px black;
|
36
|
+
}
|
37
|
+
|
38
|
+
.navbar {
|
39
|
+
margin-bottom: 30px;
|
40
|
+
}
|
41
|
+
|
42
|
+
.container {
|
43
|
+
max-width: $content-width;
|
44
|
+
}
|
45
|
+
|
46
|
+
.well.post {
|
47
|
+
p {
|
48
|
+
margin: 0 0 28px;
|
49
|
+
}
|
50
|
+
p:last-child {
|
51
|
+
margin-bottom: 10px;
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
.well {
|
56
|
+
margin: 0 auto 20px;
|
57
|
+
background: white;
|
58
|
+
padding: 25px;
|
59
|
+
font-family: $font-family-general;
|
60
|
+
font-size: 18px;
|
61
|
+
line-height: 28px;
|
62
|
+
color: #4A4A4A;
|
63
|
+
-webkit-font-smoothing: antialiased;
|
64
|
+
font-smoothing: antialiased;
|
65
|
+
overflow: hidden;
|
66
|
+
-webkit-border-radius: 5px;
|
67
|
+
-moz-border-radius: 5px;
|
68
|
+
border-radius: 5px;
|
69
|
+
box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
|
70
|
+
-webkit-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
|
71
|
+
-moz-box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.15);
|
72
|
+
|
73
|
+
.images {
|
74
|
+
img {
|
75
|
+
width: 100px;
|
76
|
+
height: 100px;
|
77
|
+
}
|
78
|
+
div.image-thumb {
|
79
|
+
display: inline-block;
|
80
|
+
width: 100px;
|
81
|
+
|
82
|
+
p {
|
83
|
+
a.add-photo {
|
84
|
+
font-size: 0.8em;
|
85
|
+
}
|
86
|
+
}
|
87
|
+
}
|
88
|
+
}
|
89
|
+
.actions {
|
90
|
+
i.icon {
|
91
|
+
margin-right: 10px;
|
92
|
+
}
|
93
|
+
a:hover {
|
94
|
+
text-decoration: none;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
#header {
|
100
|
+
border: 0 none;
|
101
|
+
position: relative;
|
102
|
+
text-align: center;
|
103
|
+
padding: 0;
|
104
|
+
|
105
|
+
h2, h2 a.title {
|
106
|
+
display: block;
|
107
|
+
font-size: 40px;
|
108
|
+
-webkit-text-shadow: 0px 1px 4px rgba(0, 0, 0, 1);
|
109
|
+
-moz-text-shadow: 0px 1px 4px rgba(0, 0, 0, 1);
|
110
|
+
-o-text-shadow: 0px 1px 4px rgba(0, 0, 0, 1);
|
111
|
+
text-shadow: 0px 1px 4px rgba(0, 0, 0, 1);
|
112
|
+
filter: progid:DXImageTransform.Microsoft.Shadow(direction=135,strength=2,color=424040);
|
113
|
+
position: relative;
|
114
|
+
color: white;
|
115
|
+
font-family: $font-family-title;
|
116
|
+
font-weight: 600;
|
117
|
+
}
|
118
|
+
h2 a.title {
|
119
|
+
margin: 5px 0 30px;
|
120
|
+
}
|
121
|
+
h2 a.logo {
|
122
|
+
div {
|
123
|
+
width: 100px;
|
124
|
+
height: 100px;
|
125
|
+
border: 3px solid white;
|
126
|
+
box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
|
127
|
+
margin-bottom: 10px;
|
128
|
+
display: inline-block;
|
129
|
+
}
|
130
|
+
}
|
131
|
+
|
132
|
+
#top-controls {
|
133
|
+
position: absolute;
|
134
|
+
right: 0;
|
135
|
+
top: 0;
|
136
|
+
|
137
|
+
img {
|
138
|
+
margin-left: 5px;
|
139
|
+
}
|
140
|
+
|
141
|
+
a:hover {
|
142
|
+
text-decoration: none;
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
h3.head {
|
148
|
+
display: block;
|
149
|
+
text-align: center;
|
150
|
+
font-family: $font-family-title;
|
151
|
+
font-size: 24px;
|
152
|
+
-webkit-text-shadow: 0px 1px 4px rgba(0, 0, 0, 1);
|
153
|
+
-moz-text-shadow: 0px 1px 4px rgba(0, 0, 0, 1);
|
154
|
+
-o-text-shadow: 0px 1px 4px rgba(0, 0, 0, 1);
|
155
|
+
text-shadow: 0px 1px 4px rgba(0, 0, 0, 1);
|
156
|
+
filter: progid:DXImageTransform.Microsoft.Shadow(direction=135,strength=2,color=424040);
|
157
|
+
position: relative;
|
158
|
+
color: white;
|
159
|
+
}
|
160
|
+
|
161
|
+
textarea {
|
162
|
+
width: $content-width - 66;
|
163
|
+
font-family: $font-family-general;
|
164
|
+
font-size: 16px;
|
165
|
+
line-height: 22px;
|
166
|
+
@media (max-width: 767px) { width: $content-width / 2; }
|
167
|
+
@media (max-width: 480px) { width: 200px; }
|
168
|
+
}
|
169
|
+
|
170
|
+
textarea#post_body {
|
171
|
+
height: 400px;
|
172
|
+
}
|
173
|
+
|
174
|
+
.custom-upload {
|
175
|
+
position: relative;
|
176
|
+
height: 40px;
|
177
|
+
width: 350px;
|
178
|
+
display: inline-block;
|
179
|
+
margin-right: 18px;
|
180
|
+
|
181
|
+
input[type=file] {
|
182
|
+
outline:none;
|
183
|
+
position: relative;
|
184
|
+
text-align: right;
|
185
|
+
-moz-opacity:0 ;
|
186
|
+
opacity: 0;
|
187
|
+
z-index: 2;
|
188
|
+
width: 100%;
|
189
|
+
height: 100%;
|
190
|
+
}
|
191
|
+
.fake-file {
|
192
|
+
background:url("icons/upload.png") center right no-repeat;
|
193
|
+
position: absolute;
|
194
|
+
top: 0px;
|
195
|
+
left: 0px;
|
196
|
+
width: 350px;
|
197
|
+
padding: 0;
|
198
|
+
margin: 0;
|
199
|
+
z-index: 1;
|
200
|
+
line-height: 100%;
|
201
|
+
|
202
|
+
input {
|
203
|
+
background-color: white;
|
204
|
+
border: 1px solid #C7C7C7;
|
205
|
+
box-shadow: 0 0 2px rgba(1, 1, 1, 0.2) inset;
|
206
|
+
font-size: 16px;
|
207
|
+
height: 30px;
|
208
|
+
padding: 5px;
|
209
|
+
width: 290px;
|
210
|
+
cursor: default;
|
211
|
+
}
|
212
|
+
}
|
213
|
+
}
|
214
|
+
|
215
|
+
#new_image input[type=submit] {
|
216
|
+
display: none;
|
217
|
+
}
|
218
|
+
|
219
|
+
.pagination {
|
220
|
+
text-align: center;
|
221
|
+
|
222
|
+
ul {
|
223
|
+
background-color: white;
|
224
|
+
}
|
225
|
+
}
|
226
|
+
|
227
|
+
#comments {
|
228
|
+
.well {
|
229
|
+
padding: 17px;
|
230
|
+
h5 {
|
231
|
+
margin: 0;
|
232
|
+
}
|
233
|
+
.actions {
|
234
|
+
margin-top: 10px;
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
|
239
|
+
hr.gradient-white {
|
240
|
+
border: 0;
|
241
|
+
height: 1px;
|
242
|
+
background-image: -webkit-linear-gradient(left, rgba(255,255,255,0), rgba(255,255,255,0.75), rgba(255,255,255,0));
|
243
|
+
background-image: -moz-linear-gradient(left, rgba(255,255,255,0), rgba(255,255,255,0.75), rgba(255,255,255,0));
|
244
|
+
background-image: -ms-linear-gradient(left, rgba(255,255,255,0), rgba(255,255,255,0.75), rgba(255,255,255,0));
|
245
|
+
background-image: -o-linear-gradient(left, rgba(255,255,255,0), rgba(255,255,255,0.75), rgba(255,255,255,0));
|
246
|
+
}
|
247
|
+
|
248
|
+
hr.gradient-black {
|
249
|
+
border: 0;
|
250
|
+
height: 1px;
|
251
|
+
background-image: -webkit-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.65), rgba(0,0,0,0));
|
252
|
+
background-image: -moz-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.65), rgba(0,0,0,0));
|
253
|
+
background-image: -ms-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.65), rgba(0,0,0,0));
|
254
|
+
background-image: -o-linear-gradient(left, rgba(0,0,0,0), rgba(0,0,0,0.65), rgba(0,0,0,0));
|
255
|
+
}
|
256
|
+
|
257
|
+
// Flaired edges, by Tomas Theunissen
|
258
|
+
hr.fancy {
|
259
|
+
height: 30px;
|
260
|
+
border-style: solid;
|
261
|
+
border-color: black;
|
262
|
+
border-width: 1px 0 0 0;
|
263
|
+
border-radius: 20px;
|
264
|
+
}
|
265
|
+
hr.fancy:before { /* Not really supposed to work, but does */
|
266
|
+
display: block;
|
267
|
+
content: "";
|
268
|
+
height: 30px;
|
269
|
+
margin-top: -31px;
|
270
|
+
border-style: solid;
|
271
|
+
border-color: black;
|
272
|
+
border-width: 0 0 1px 0;
|
273
|
+
border-radius: 20px;
|
274
|
+
}
|
275
|
+
|
276
|
+
.centered {
|
277
|
+
text-align: center;
|
278
|
+
}
|
279
|
+
}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
/*
|
2
|
+
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
3
|
+
* listed below.
|
4
|
+
*
|
5
|
+
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
6
|
+
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
7
|
+
*
|
8
|
+
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
9
|
+
* compiled file, but it's generally better to create a new file per style scope.
|
10
|
+
*
|
11
|
+
*= require_self
|
12
|
+
*= require bootstrap/bootstrap
|
13
|
+
*= require bootstrap/bootstrap-responsive
|
14
|
+
*= require_tree .
|
15
|
+
*/
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Almanac
|
2
|
+
class ApplicationController < ActionController::Base
|
3
|
+
protect_from_forgery
|
4
|
+
|
5
|
+
before_filter :set_current_author
|
6
|
+
before_filter :set_blog
|
7
|
+
|
8
|
+
before_filter do |controller|
|
9
|
+
@markdown_parser = MarkdownParser.new
|
10
|
+
end
|
11
|
+
|
12
|
+
def set_current_author
|
13
|
+
current_user ||= nil
|
14
|
+
end
|
15
|
+
|
16
|
+
def set_blog
|
17
|
+
@blog = Almanac::Blog.first
|
18
|
+
unless @blog.nil?
|
19
|
+
Rakismet.key = (@blog.rakismet_key) ? @blog.rakismet_key : ''
|
20
|
+
Rakismet.url = (@blog.rakismet_url) ? @blog.rakismet_url : ''
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,64 @@
|
|
1
|
+
require_dependency "almanac/application_controller"
|
2
|
+
|
3
|
+
module Almanac
|
4
|
+
class BlogsController < ApplicationController
|
5
|
+
load_and_authorize_resource class: Almanac::Blog
|
6
|
+
respond_to :html
|
7
|
+
|
8
|
+
before_filter :only => [:show, :edit, :update, :delete] do |controller|
|
9
|
+
@blog = Blog.find(params[:id])
|
10
|
+
end
|
11
|
+
|
12
|
+
def new
|
13
|
+
@blog = (Blog.first.nil?) ? Blog.new : Blog.first
|
14
|
+
|
15
|
+
respond_with(@blog) do |format|
|
16
|
+
if @blog.id
|
17
|
+
format.html { redirect_to :root, :notice => 'You can only have one blog.' }
|
18
|
+
else
|
19
|
+
format.html
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def create
|
25
|
+
@blog = (Blog.first.nil?) ? Blog.new(params[:blog]) : Blog.first
|
26
|
+
@blog.author_id = current_user.id
|
27
|
+
|
28
|
+
respond_with(@blog) do |format|
|
29
|
+
if Blog.first.nil?
|
30
|
+
if @blog.save
|
31
|
+
format.html { redirect_to :root, :notice => 'Blog was successfully created.' }
|
32
|
+
else
|
33
|
+
format.html { render :action => "new", :alert => 'Something went wrong, try again.' }
|
34
|
+
end
|
35
|
+
else
|
36
|
+
format.html { redirect_to :root, :notice => 'You can only have one blog.' }
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def edit
|
42
|
+
respond_to do |format|
|
43
|
+
format.html
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def update
|
48
|
+
respond_with(@blog) do |format|
|
49
|
+
if @blog.update_attributes(params[:blog])
|
50
|
+
format.html { redirect_to :root, :notice => 'Blog was successfully updated.' }
|
51
|
+
else
|
52
|
+
format.html { render :action => "edit" }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def spam
|
58
|
+
@comments = Comment.spam
|
59
|
+
|
60
|
+
respond_with(@comments) do |format|
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|