Skip to content

Commit

Permalink
remove api and limit height on index page
Browse files Browse the repository at this point in the history
  • Loading branch information
drujensen committed Apr 4, 2016
1 parent e1a9109 commit 82fb4f0
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 27 deletions.
6 changes: 5 additions & 1 deletion Dockerfile
Expand Up @@ -15,9 +15,13 @@ RUN echo "deb http://dist.crystal-lang.org/apt crystal main" > /etc/apt/sources.
# Install Dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libyaml-0-2 \
libpq-dev \
libyaml-dev \
libssl-dev \
zlib1g-dev \
libevent-dev \
libgc-dev \
libpq-dev \
git \
crystal

Expand Down
2 changes: 0 additions & 2 deletions config/routes.cr
Expand Up @@ -14,5 +14,3 @@ get "/posts/:id", PostController::Show.instance
get "/posts/:id/edit", PostController::Edit.instance
put "/posts/:id", PostController::Update.instance
delete "/posts/:id", PostController::Delete.instance

get "/api/posts/:id", ApiController::Show.instance
11 changes: 7 additions & 4 deletions public/stylesheets/main.css
Expand Up @@ -73,11 +73,9 @@ h6, .h6 {
border-left: 5px solid transparent;
}


/*
* Blog name and description
*/

.blog-header {
padding-top: 20px;
padding-bottom: 20px;
Expand All @@ -93,7 +91,6 @@ h6, .h6 {
color: #999;
}


/*
* Main column and sidebar layout
*/
Expand Down Expand Up @@ -132,7 +129,6 @@ h6, .h6 {
border-radius: 30px;
}


/*
* Blog posts
*/
Expand All @@ -149,6 +145,13 @@ h6, .h6 {
color: #999;
}

.truncate {
text-overflow: ellipsis;
word-wrap: break-word;
overflow: hidden;
max-height: 12em;
line-height: 1.5em;
}

/*
* Footer
Expand Down
17 changes: 0 additions & 17 deletions src/controllers/api_controller.cr

This file was deleted.

4 changes: 2 additions & 2 deletions src/controllers/session_controller.cr
Expand Up @@ -16,8 +16,8 @@ module SessionController
username = context.params["username"]
password = context.params["password"]

#puts "Encrypted Password: #{Crypto::MD5.hex_digest(password)}"
if username == "admin" && Crypto::MD5.hex_digest(password as String) == "5f4dcc3b5aa765d61d8327deb882cf99"
# puts "Encrypted Password: #{Crypto::MD5.hex_digest(password as String)}"
if username == "admin" && Crypto::MD5.hex_digest(password as String) == "ff2fca5e688561ed5237c9a9445c427a"
context.session["authorized"] = "true"
end
redirect "/"
Expand Down
2 changes: 1 addition & 1 deletion src/views/post/index.ecr
Expand Up @@ -5,7 +5,7 @@
<p class="blog-post-meta"><%= post.last_updated %> by <a
href="https://github.com/drujensen/kemalyst" target="_blank">Dru Jensen</a></p>

<p><%= post.markdown_body %></p>
<div class="truncate"><%= post.markdown_body %></div>

<p>
<a href="/posts/<%= post.id %>">read</a>
Expand Down

0 comments on commit 82fb4f0

Please sign in to comment.