exposition 0.0.3.pre.alpha

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.
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,17 @@
1
+ @import url(https://fonts.googleapis.com/css?family=Merriweather:300);
2
+ @import url(https://fonts.googleapis.com/css?family=Merriweather+Sans:300);
3
+
4
+ @import 'normalize';
5
+ @import 'bourbon';
6
+ @import 'neat';
7
+ @import 'variables';
8
+ @import 'mixins';
9
+ @import 'breakpoints';
10
+ @import 'layout';
11
+ @import 'posts';
12
+ @import 'tags';
13
+ @import 'header';
14
+ @import 'footer';
15
+ @import 'code';
16
+ @import 'pagination';
17
+
@@ -0,0 +1,5 @@
1
+ module Exposition
2
+ class Admin::AdminController < ApplicationController
3
+ include Concerns::Controller::Admin::AdminController
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Exposition
2
+ class Admin::PostsController < Admin::AdminController
3
+ include Concerns::Controller::Admin::PostsController
4
+ end
5
+ end
@@ -0,0 +1,31 @@
1
+ module Exposition
2
+ class Admin::SessionsController < Admin::AdminController
3
+ skip_before_action :authorize, only: [:new, :create]
4
+
5
+ def new
6
+ end
7
+
8
+ def create
9
+ user = User.find_by(email: params[:session][:email].downcase)
10
+ if user && user.authenticate(params[:session][:password])
11
+ # Log the user in and redirect to the user's show page.
12
+
13
+ user.set_encrypted_remember_token!
14
+ session[:user_id] = user.id
15
+ cookies.permanent.signed[:user_id] = user.id
16
+ cookies.permanent[:remember_token] = user.remember_token
17
+ redirect_to admin_posts_path
18
+ else
19
+ flash.now[:error] = t("sessions.failed_login")
20
+ render 'new'
21
+ end
22
+ end
23
+
24
+ def destroy
25
+ session.delete(:user_id)
26
+ cookies.delete(:user_id)
27
+ cookies.delete(:remember_token)
28
+ redirect_to root_url
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,5 @@
1
+ module Exposition
2
+ class Admin::TagsController < Admin::AdminController
3
+ include Concerns::Controller::Admin::TagsController
4
+ end
5
+ end
@@ -0,0 +1,8 @@
1
+ module Exposition
2
+ class ApplicationController < ActionController::Base
3
+ # Prevent CSRF attacks by raising an exception.
4
+ # For APIs, you may want to use :null_session instead.
5
+ protect_from_forgery with: :exception
6
+
7
+ end
8
+ end
@@ -0,0 +1,5 @@
1
+ module Exposition
2
+ class PostsController < ApplicationController
3
+ include Concerns::Controller::PostsController
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Exposition
2
+ class TagsController < ApplicationController
3
+ include Concerns::Controller::TagsController
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ module Exposition
2
+ module Admin::FlashesHelper
3
+ def user_facing_flashes
4
+ flash.to_hash.slice("alert", "error", "notice", "success")
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,20 @@
1
+ module Exposition
2
+ module Admin::SessionsHelper
3
+ def current_user
4
+ if (user_id = session[:user_id])
5
+ @current_user ||= User.find_by(id: user_id)
6
+ elsif (user_id = cookies.signed[:user_id])
7
+ # TODO put this in admin controller for authentication check
8
+ user = User.find_by(id: user_id)
9
+ if user && user.authenticated?(cookies[:remember_token])
10
+ session[:user_id] = user.id
11
+ @current_user = user
12
+ end
13
+ end
14
+ end
15
+
16
+ def logged_in?
17
+ !current_user.nil?
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,21 @@
1
+ require 'redcarpet'
2
+ require 'rouge'
3
+ require 'rouge/plugins/redcarpet'
4
+
5
+ module Exposition
6
+ module MarkdownHelper
7
+
8
+ # Create a Redcarpet Renderer with Rouge code formatting.
9
+ # See: https://github.com/jneen/rouge#you-can-even-use-it-with-redcarpet
10
+ class HTMLwithHighlighting < Redcarpet::Render::HTML
11
+ include Rouge::Plugins::Redcarpet
12
+ end
13
+
14
+ def markdown_to_html(markdown)
15
+ @renderer ||=
16
+ Redcarpet::Markdown.new(HTMLwithHighlighting,
17
+ extensions = {fenced_code_blocks: true})
18
+ @renderer.render(markdown).html_safe
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,6 @@
1
+ class Categorical::Tag < ActiveRecord::Base
2
+ include Categorical::Concerns::Models::Tag
3
+ include HumanUrls::Sluggable
4
+
5
+ sluggify :slug, generated_from: :label
6
+ end
@@ -0,0 +1,10 @@
1
+ module Exposition
2
+ class Encryptor
3
+ # Returns the hash digest of the given string.
4
+ def self.encrypt(string)
5
+ cost = ActiveModel::SecurePassword.min_cost ? BCrypt::Engine::MIN_COST :
6
+ BCrypt::Engine.cost
7
+ BCrypt::Password.create(string, cost: cost)
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ module Exposition
2
+ class Post < ActiveRecord::Base
3
+ include Concerns::Models::Post
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ module Exposition
2
+ class User < ActiveRecord::Base
3
+ include Concerns::Models::User
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ %section.images
2
+ .admin-title-header
3
+ %h2 Images
4
+ = link_to "Add New", new_admin_post_path
5
+ %table
6
+ %thead
7
+ %tr
8
+ %th Title
9
+ %tbody
10
+ - @images.each do |image|
11
+ %tr
12
+ %td= "#{image.title}"
File without changes
@@ -0,0 +1,8 @@
1
+ - if model.errors.any?
2
+ #error-explanation
3
+ %h4
4
+ = pluralize(model.errors.count, "error")
5
+ prohibited this post from being saved:
6
+ %ul
7
+ - model.errors.full_messages.each do |msg|
8
+ %li= msg
@@ -0,0 +1,23 @@
1
+ %p
2
+ = form.label :title
3
+ = form.text_field :title
4
+ %p
5
+ = form.label :summary
6
+ = form.text_area :summary
7
+ %p
8
+ = form.label :body
9
+ = form.text_area :body
10
+ %p
11
+ = form.label :author
12
+ = form.collection_select(:author_id, @authors, :id, :name)
13
+ %p
14
+ = form.label :slug
15
+ = form.text_field :slug
16
+ %p
17
+ = form.label :tag_ids, 'Tags'
18
+ = form.collection_check_boxes(:tag_ids, @tags, :id, :label) do |b|
19
+ = b.label { b.check_box + b.text }
20
+ %p
21
+ = form.label :published
22
+ = form.check_box :published
23
+ %p= form.submit
@@ -0,0 +1,5 @@
1
+ %section.edit-post
2
+ %h2= "Editing Post: #{@post.title}"
3
+ = form_for @post, url: admin_post_path(@post), method: :patch do |f|
4
+ = render partial: 'error_handler', locals: { model: @post }
5
+ = render partial: 'form_fields', locals: { form: f }
@@ -0,0 +1,23 @@
1
+ %section.posts
2
+ .admin-title-header
3
+ %h2 Posts
4
+ = link_to "Add New", exposition.new_admin_post_path
5
+ %table
6
+ %thead
7
+ %tr
8
+ %th Title
9
+ %th Article
10
+ %th Author
11
+ %th Slug
12
+ %th Tags
13
+ %th Manage
14
+ %tbody
15
+ - @posts.each do |post|
16
+ %tr.post{class: "#{post.css_classes}"}
17
+ %td= "#{post.title}"
18
+ %td= truncate(post.summary, length: 40, separator: ' ')
19
+ %td= "#{post.author.name}"
20
+ %td= "#{post.slug}"
21
+ %td= "#{post.tags.to_sentence}"
22
+ %td= link_to "Edit", exposition.edit_admin_post_path(post)
23
+ = paginate @posts
@@ -0,0 +1,7 @@
1
+ %section.new-post
2
+ .admin-title-header
3
+ %h2 New Post
4
+ = link_to "Back to Posts", admin_posts_path
5
+ = form_for @post, url: admin_posts_path, method: :post do |f|
6
+ = render partial: 'error_handler', locals: { model: @post }
7
+ = render partial: 'form_fields', locals: { form: f }
@@ -0,0 +1,2 @@
1
+ %h1 Admin::Posts#update
2
+ %p Find me in app/views/admin/posts/update.html.haml
@@ -0,0 +1,10 @@
1
+ %section.login
2
+ %h2= "Login"
3
+ = form_for :session, url: admin_login_path do |f|
4
+ %p
5
+ = f.label :email
6
+ = f.text_field :email
7
+ %p
8
+ = f.label :password
9
+ = f.password_field :password
10
+ %p= f.submit "#{t("sessions.submit")}"
@@ -0,0 +1,8 @@
1
+ - if model.errors.any?
2
+ #error-explanation
3
+ %h4
4
+ = pluralize(model.errors.count, "error")
5
+ prohibited this post from being saved:
6
+ %ul
7
+ - model.errors.full_messages.each do |msg|
8
+ %li= msg
@@ -0,0 +1,10 @@
1
+ %section.new-tag
2
+ .admin-title-header
3
+ %h2 Edit Tag
4
+ = link_to "Back to Tags", admin_tags_path
5
+ = form_for @tag, url: admin_tag_path(@tag), method: :patch do |f|
6
+ = render partial: 'error_handler', locals: { model: @tag }
7
+ %p
8
+ = f.label :label
9
+ = f.text_field :label
10
+ %p= f.submit
@@ -0,0 +1,18 @@
1
+ %section.tags
2
+ .admin-title-header
3
+ %h2 Tags
4
+ = link_to "Add New", new_admin_tag_path
5
+ %table
6
+ %thead
7
+ %tr
8
+ %th Label
9
+ %th Manage
10
+ %tbody
11
+ - @tags.each do |tag|
12
+ %tr.tag
13
+ %td= "#{tag.label}"
14
+ %td
15
+ = link_to "Edit", edit_admin_tag_path(tag)
16
+ = link_to "Delete", admin_tag_path(tag), method: :delete
17
+
18
+ = paginate @tags
@@ -0,0 +1,10 @@
1
+ %section.new-tag
2
+ .admin-title-header
3
+ %h2 New Tag
4
+ = link_to "Back to Tags", admin_tags_path
5
+ = form_for @tag, url: admin_tags_path, method: :post do |f|
6
+ = render partial: 'error_handler', locals: { model: @tag }
7
+ %p
8
+ = f.label :label
9
+ = f.text_field :label
10
+ %p= f.submit
@@ -0,0 +1,8 @@
1
+ %article
2
+ %time= "Published #{l(post.published_at.to_date, format: :long)}"
3
+ .content.summary
4
+ %h3= link_to(post.title, post)
5
+ = preserve do
6
+ = markdown_to_html(post.summary)
7
+ %section.info
8
+ = render 'exposition/posts/tags', tags: post.tags
@@ -0,0 +1,6 @@
1
+ .tags
2
+ - if tags.any?
3
+ - tags.each do |tag|
4
+ %span= link_to tag.label, tag
5
+ - else
6
+ %span.empty Not tagged
@@ -0,0 +1,8 @@
1
+ .posts
2
+ - unless @posts.empty?
3
+ = render @posts
4
+ -else
5
+ %section.no-posts
6
+ %p= t('posts.index.no_posts_warning')
7
+
8
+ = paginate @posts
@@ -0,0 +1,5 @@
1
+ %article.post
2
+ %section.content
3
+ %h3= @post.title
4
+ = preserve do
5
+ = markdown_to_html(@post.body)
@@ -0,0 +1,6 @@
1
+ .posts
2
+ - unless @taggables.empty?
3
+ = render @taggables
4
+ -else
5
+ %section.no-posts
6
+ %p= t('posts.index.no_posts_warning')
@@ -0,0 +1,22 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/
5
+ %title Exposition
6
+ = stylesheet_link_tag 'exposition/admin/application', media: 'all', 'data-turbolinks-track' => true
7
+ = javascript_include_tag 'exposition/admin/application', 'data-turbolinks-track' => true
8
+ = csrf_meta_tags
9
+ %body
10
+ %nav.admin
11
+ %ul
12
+ %li= link_to "Posts", admin_posts_path
13
+ %li= link_to "Tags", admin_tags_path
14
+ - if logged_in?
15
+ %ul.login
16
+ %li= link_to current_user.name, admin_posts_path
17
+ %li= link_to t('sessions.destroy'), admin_logout_path, method: :delete
18
+ - if flash.any?
19
+ .flashes
20
+ - user_facing_flashes.each do |key, value|
21
+ %div{:class => "flash-#{key}"}= value
22
+ = yield
@@ -0,0 +1,20 @@
1
+ <!doctype html>
2
+ %html
3
+ %head
4
+ %title= t('title')
5
+ = stylesheet_link_tag "exposition/application"
6
+ = csrf_meta_tags
7
+ %meta{:name => "viewport", :content => "width=device-width, initial-scale=1.0, maximum-scale=1.0"}
8
+ %body
9
+ %header
10
+ %nav
11
+ %h1= link_to t('title'), '/'
12
+ %ul.social
13
+ %li= link_to(image_tag('exposition/twitter.svg', class: 'twitter'), '#')
14
+ %ul.menu
15
+ %li= link_to 'Static Page', '#'
16
+ = yield
17
+
18
+ %footer
19
+ .info
20
+ %p= "By #{t('owner')}"
@@ -0,0 +1,37 @@
1
+ # Files in the config/locales directory are used for internationalization
2
+ # and are automatically loaded by Rails. If you want to use locales other
3
+ # than English, add the necessary files in this directory.
4
+ #
5
+ # To use the locales, use `I18n.t`:
6
+ #
7
+ # I18n.t 'hello'
8
+ #
9
+ # In views, this is aliased to just `t`:
10
+ #
11
+ # <%= t('hello') %>
12
+ #
13
+ # To use a different locale, set it with `I18n.locale`:
14
+ #
15
+ # I18n.locale = :es
16
+ #
17
+ # This would use the information in config/locales/es.yml.
18
+ #
19
+ # To learn more, please read the Rails Internationalization guide
20
+ # available at http://guides.rubyonrails.org/i18n.html.
21
+
22
+ en:
23
+ title: 'Your Title'
24
+ owner: 'Your Name'
25
+ date:
26
+ formats:
27
+ default: "%m/%d/%Y"
28
+ time:
29
+ formats:
30
+ default: "%m/%d/%Y"
31
+ posts:
32
+ index:
33
+ no_posts_warning: 'There are no posts yet. Please check back later!'
34
+ sessions:
35
+ submit: 'Log in'
36
+ failed_login: 'Invalid user/password combination.'
37
+ destroy: 'Log Out'