├── log
└── .keep
├── app
├── mailers
│ └── .keep
├── models
│ ├── .keep
│ ├── concerns
│ │ └── .keep
│ ├── photo.rb
│ ├── comment.rb
│ └── article.rb
├── assets
│ ├── images
│ │ ├── .keep
│ │ ├── 1.jpg
│ │ ├── 2.jpg
│ │ ├── 3.jpg
│ │ ├── 4.jpg
│ │ ├── 5.jpg
│ │ ├── 6.jpg
│ │ ├── 7.jpg
│ │ ├── 8.jpg
│ │ ├── bg.png
│ │ ├── rss.png
│ │ ├── pic1.jpg
│ │ ├── CZ16VX4.gif
│ │ ├── images.jpeg
│ │ ├── search.gif
│ │ └── fork_me_on_github.png
│ ├── stylesheets
│ │ ├── articles.scss
│ │ ├── application.scss
│ │ ├── admin
│ │ │ └── posts.scss
│ │ ├── highlight.css
│ │ ├── markdown.scss
│ │ ├── welcome.scss
│ │ └── variables.scss
│ └── javascripts
│ │ ├── application.js
│ │ ├── admin
│ │ ├── photos.coffee
│ │ └── posts.coffee
│ │ ├── photo.coffee
│ │ ├── googleanalytics.coffee
│ │ └── jquery.atwho.js
├── views
│ ├── articles
│ │ ├── jia.html
│ │ ├── index.html.slim
│ │ ├── search.html.slim
│ │ └── show.html.slim
│ ├── demos
│ │ └── index.html.slim
│ ├── kaminari
│ │ ├── _gap.html.slim
│ │ ├── _first_page.html.slim
│ │ ├── _last_page.html.slim
│ │ ├── _next_page.html.slim
│ │ ├── _prev_page.html.slim
│ │ ├── _page.html.slim
│ │ └── _paginator.html.slim
│ ├── admin
│ │ ├── articles
│ │ │ ├── edit.html.slim
│ │ │ ├── new.html.slim
│ │ │ ├── index.html.slim
│ │ │ └── _form.html.slim
│ │ ├── sessions
│ │ │ └── new.html.slim
│ │ └── photos
│ │ │ └── index.html.slim
│ ├── welcome
│ │ ├── about.html.slim
│ │ ├── photo.html.slim
│ │ ├── index.html.slim
│ │ └── rss.builder
│ ├── shared
│ │ └── _form_error_message.html.slim
│ └── layouts
│ │ ├── photo.html.slim
│ │ ├── admin.html.slim
│ │ └── application.html.slim
├── controllers
│ ├── concerns
│ │ └── .keep
│ ├── demos_controller.rb
│ ├── application_controller.rb
│ ├── admin
│ │ ├── sessions_controller.rb
│ │ ├── photos_controller.rb
│ │ └── articles_controller.rb
│ ├── comments_controller.rb
│ ├── welcome_controller.rb
│ └── articles_controller.rb
├── helpers
│ ├── welcome_helper.rb
│ ├── articles_helper.rb
│ ├── comments_helper.rb
│ ├── admin
│ │ ├── posts_helper.rb
│ │ └── sessions_helper.rb
│ └── application_helper.rb
└── uploaders
│ └── image_uploader.rb
├── lib
├── assets
│ └── .keep
├── tasks
│ └── .keep
└── markdown.rb
├── public
├── favicon.ico
├── audios
│ └── sound.mp3
├── img
│ └── prev_next.png
├── uploads
│ └── photo
│ │ └── image
│ │ └── 0
│ │ ├── photo01.jpg
│ │ ├── photo02.jpg
│ │ ├── photo03.jpg
│ │ ├── photo04.jpg
│ │ ├── photo05.jpg
│ │ ├── photo06.jpg
│ │ ├── photo07.jpg
│ │ ├── photo08.jpg
│ │ ├── photo09.jpg
│ │ ├── photo10.jpg
│ │ ├── photo12.jpg
│ │ ├── photo13.jpg
│ │ ├── photo14.jpg
│ │ ├── photo15.jpg
│ │ ├── photo16.jpg
│ │ ├── photo17.jpg
│ │ ├── photo18.jpg
│ │ ├── photo20.jpg
│ │ ├── photo21.jpg
│ │ ├── photo22.jpg
│ │ ├── photo23.jpg
│ │ ├── photo24.jpg
│ │ ├── photo25.jpg
│ │ ├── photo26.jpg
│ │ └── photo30.jpg
├── robots.txt
├── sitemap.xml
├── 500.html
├── 422.html
├── 404.html
└── jia.html
├── test
├── helpers
│ └── .keep
├── mailers
│ └── .keep
├── models
│ └── .keep
├── controllers
│ └── .keep
├── fixtures
│ └── .keep
├── integration
│ └── .keep
└── test_helper.rb
├── vendor
└── assets
│ ├── javascripts
│ ├── .keep
│ ├── mp3.js
│ ├── jquery.tiles.js
│ └── jquery.html5-fileupload.js
│ └── stylesheets
│ ├── .keep
│ └── jquery.tiles.min.css
├── config
├── initializers
│ ├── backtrace_silencers.rb
│ ├── cookies_serializer.rb
│ ├── filter_parameter_logging.rb
│ ├── assets.rb
│ ├── truncate_html.rb
│ ├── session_store.rb
│ ├── mime_types.rb
│ ├── kaminari_config.rb
│ ├── wrap_parameters.rb
│ └── inflections.rb
├── boot.rb
├── environment.rb
├── environments
│ ├── development.rb
│ ├── test.rb
│ └── production.rb
├── database.yml
├── nigix.conf
├── locales
│ └── en.yml
├── unicorn
│ └── production.rb
├── routes.rb
├── secrets.yml
├── application.rb
└── deploy.rb
├── .ackrc
├── config.ru
├── Rakefile
├── bin
├── rake
├── bundle
├── rails
└── setup
├── db
├── migrate
│ ├── 20150324104912_add_article_id_to_comment.rb
│ ├── 20160224023054_add_photo_type_to_photo.rb
│ ├── 20160224042413_add_self_info_to_article.rb
│ └── 20150326142916_create_photos.rb
├── seeds.rb
└── schema.rb
├── .gitignore
├── Gemfile
├── README.md
└── Gemfile.lock
/log/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/mailers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/models/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/assets/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/lib/tasks/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/helpers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/mailers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/models/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/assets/images/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/controllers/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/fixtures/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/test/integration/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/models/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/views/articles/jia.html:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/controllers/concerns/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/vendor/assets/stylesheets/.keep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/views/demos/index.html.slim:
--------------------------------------------------------------------------------
1 | p 敬请期待
2 |
--------------------------------------------------------------------------------
/config/initializers/backtrace_silencers.rb:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/app/helpers/welcome_helper.rb:
--------------------------------------------------------------------------------
1 | module WelcomeHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/articles_helper.rb:
--------------------------------------------------------------------------------
1 | module ArticlesHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/comments_helper.rb:
--------------------------------------------------------------------------------
1 | module CommentsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/admin/posts_helper.rb:
--------------------------------------------------------------------------------
1 | module Admin::PostsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/helpers/application_helper.rb:
--------------------------------------------------------------------------------
1 | module ApplicationHelper
2 | end
3 |
--------------------------------------------------------------------------------
/.ackrc:
--------------------------------------------------------------------------------
1 | --ignore-file=ext:log
2 | --ignore-dir=public
3 | --ignore-dir=tmp
4 |
--------------------------------------------------------------------------------
/app/helpers/admin/sessions_helper.rb:
--------------------------------------------------------------------------------
1 | module Admin::SessionsHelper
2 | end
3 |
--------------------------------------------------------------------------------
/app/controllers/demos_controller.rb:
--------------------------------------------------------------------------------
1 | class DemosController < ApplicationController
2 | end
3 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | require ::File.expand_path('../config/environment', __FILE__)
2 | run Rails.application
3 |
--------------------------------------------------------------------------------
/app/assets/images/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/1.jpg
--------------------------------------------------------------------------------
/app/assets/images/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/2.jpg
--------------------------------------------------------------------------------
/app/assets/images/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/3.jpg
--------------------------------------------------------------------------------
/app/assets/images/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/4.jpg
--------------------------------------------------------------------------------
/app/assets/images/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/5.jpg
--------------------------------------------------------------------------------
/app/assets/images/6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/6.jpg
--------------------------------------------------------------------------------
/app/assets/images/7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/7.jpg
--------------------------------------------------------------------------------
/app/assets/images/8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/8.jpg
--------------------------------------------------------------------------------
/app/assets/images/bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/bg.png
--------------------------------------------------------------------------------
/app/assets/images/rss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/rss.png
--------------------------------------------------------------------------------
/app/views/kaminari/_gap.html.slim:
--------------------------------------------------------------------------------
1 | li.disabled
2 | = link_to raw(t 'views.pagination.truncate'), '#'
3 |
--------------------------------------------------------------------------------
/public/audios/sound.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/audios/sound.mp3
--------------------------------------------------------------------------------
/public/img/prev_next.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/img/prev_next.png
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | require File.expand_path('../config/application', __FILE__)
2 |
3 | Rails.application.load_tasks
4 |
--------------------------------------------------------------------------------
/app/assets/images/pic1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/pic1.jpg
--------------------------------------------------------------------------------
/config/initializers/cookies_serializer.rb:
--------------------------------------------------------------------------------
1 | Rails.application.config.action_dispatch.cookies_serializer = :json
2 |
--------------------------------------------------------------------------------
/config/initializers/filter_parameter_logging.rb:
--------------------------------------------------------------------------------
1 | Rails.application.config.filter_parameters += [:password]
2 |
--------------------------------------------------------------------------------
/app/assets/images/CZ16VX4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/CZ16VX4.gif
--------------------------------------------------------------------------------
/app/assets/images/images.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/images.jpeg
--------------------------------------------------------------------------------
/app/assets/images/search.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/search.gif
--------------------------------------------------------------------------------
/app/views/admin/articles/edit.html.slim:
--------------------------------------------------------------------------------
1 | .container
2 | h2.article-new
3 | |编辑博客
4 |
5 | = render 'form'
6 |
--------------------------------------------------------------------------------
/app/views/admin/articles/new.html.slim:
--------------------------------------------------------------------------------
1 | .container
2 | h2.article-new
3 | |新建博客
4 |
5 | = render 'form'
6 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative '../config/boot'
3 | require 'rake'
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/app/assets/images/fork_me_on_github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/app/assets/images/fork_me_on_github.png
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo01.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo02.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo03.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo04.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo05.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo05.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo06.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo06.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo07.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo07.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo08.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo08.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo09.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo09.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo10.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo12.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo13.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo13.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo14.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo14.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo15.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo15.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo16.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo16.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo17.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo17.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo18.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo18.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo20.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo20.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo21.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo21.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo22.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo22.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo23.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo23.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo24.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo24.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo25.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo25.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo26.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo26.jpg
--------------------------------------------------------------------------------
/public/uploads/photo/image/0/photo30.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/liuzhenangel/Rina_Blog/HEAD/public/uploads/photo/image/0/photo30.jpg
--------------------------------------------------------------------------------
/config/initializers/assets.rb:
--------------------------------------------------------------------------------
1 | Rails.application.config.assets.version = '1.0'
2 | Rails.application.config.assets.precompile += %w( mp3.js )
3 |
--------------------------------------------------------------------------------
/app/views/kaminari/_first_page.html.slim:
--------------------------------------------------------------------------------
1 | li
2 | = link_to_unless current_page.first?, raw(t 'views.pagination.first'),
3 | url, remote: remote
4 |
--------------------------------------------------------------------------------
/app/views/kaminari/_last_page.html.slim:
--------------------------------------------------------------------------------
1 | li
2 | = link_to_unless current_page.last?, raw(t 'views.pagination.last'),
3 | url, remote: remote
4 |
--------------------------------------------------------------------------------
/bin/bundle:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3 | load Gem.bin_path('bundler', 'bundle')
4 |
--------------------------------------------------------------------------------
/config/initializers/truncate_html.rb:
--------------------------------------------------------------------------------
1 | TruncateHtml.configure do |config|
2 | config.length = 200
3 | config.omission = '...'
4 | end
5 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2 |
3 | require 'bundler/setup' # Set up gems listed in the Gemfile.
4 |
--------------------------------------------------------------------------------
/app/views/kaminari/_next_page.html.slim:
--------------------------------------------------------------------------------
1 | li
2 | = link_to_unless current_page.last?, raw(t 'views.pagination.next'),
3 | url, rel: 'next', remote: remote
4 |
--------------------------------------------------------------------------------
/app/views/kaminari/_prev_page.html.slim:
--------------------------------------------------------------------------------
1 | li
2 | = link_to_unless current_page.first?, raw(t 'views.pagination.previous'),
3 | url, rel: 'prev', remote: remote
4 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path('../../config/application', __FILE__)
3 | require_relative '../config/boot'
4 | require 'rails/commands'
5 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # Load the Rails application.
2 | require File.expand_path('../application', __FILE__)
3 |
4 | # Initialize the Rails application.
5 | Rails.application.initialize!
6 |
--------------------------------------------------------------------------------
/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | Rails.application.config.session_store :cookie_store, key: '_Rina_Blog_session'
4 |
--------------------------------------------------------------------------------
/app/views/welcome/about.html.slim:
--------------------------------------------------------------------------------
1 | - content_for(:title) do
2 | |关于 - 个人资料
3 |
4 | h2
5 | = @self_info.title
6 | .show-background
7 | .content.markdown
8 | == @self_info.content_html
9 |
--------------------------------------------------------------------------------
/db/migrate/20150324104912_add_article_id_to_comment.rb:
--------------------------------------------------------------------------------
1 | class AddArticleIdToComment < ActiveRecord::Migration
2 | def change
3 | add_column :comments, :article_id, :integer
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/app/views/kaminari/_page.html.slim:
--------------------------------------------------------------------------------
1 | li class="#{'active' if page.current?}"
2 | = link_to page, page.current? ? '#' : url,
3 | remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil
4 |
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # Add new mime types for use in respond_to blocks:
4 | # Mime::Type.register "text/richtext", :rtf
5 |
--------------------------------------------------------------------------------
/db/migrate/20160224023054_add_photo_type_to_photo.rb:
--------------------------------------------------------------------------------
1 | class AddPhotoTypeToPhoto < ActiveRecord::Migration
2 | def change
3 | add_column :photos, :photo_type, :boolean, :default => false
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/db/migrate/20160224042413_add_self_info_to_article.rb:
--------------------------------------------------------------------------------
1 | class AddSelfInfoToArticle < ActiveRecord::Migration
2 | def change
3 | add_column :articles, :self_info, :boolean, :default => false
4 | end
5 | end
6 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/articles.scss:
--------------------------------------------------------------------------------
1 | .search-content{
2 | margin: 20px 8px 3px 4px;
3 | }
4 |
5 | img{
6 | width: 848px;
7 | }
8 |
9 | .pagination{
10 | margin: 80px 0;
11 | }
12 |
13 | em{
14 | color: #c00;
15 | }
16 |
--------------------------------------------------------------------------------
/app/models/photo.rb:
--------------------------------------------------------------------------------
1 | class Photo < ActiveRecord::Base
2 | mount_uploader :image, ImageUploader
3 |
4 | scope :photo_album, -> { where(photo_type: true) }
5 |
6 | def image_name
7 | image.file.filename
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | User-agent: *
5 | Disallow: /admin
6 |
--------------------------------------------------------------------------------
/db/migrate/20150326142916_create_photos.rb:
--------------------------------------------------------------------------------
1 | class CreatePhotos < ActiveRecord::Migration
2 | def change
3 | create_table :photos do |t|
4 | t.string :image
5 |
6 | t.timestamps null: false
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/views/articles/index.html.slim:
--------------------------------------------------------------------------------
1 | - content_for(:title) do
2 | |所有 - 所有文章列表
3 |
4 | - @articles.each do |article|
5 | .row.all-article
6 | .col-md-4
7 | = link_to article.title, article
8 | .col-md-4
9 | = article.created_at.to_date
10 |
--------------------------------------------------------------------------------
/app/models/comment.rb:
--------------------------------------------------------------------------------
1 | class Comment < ActiveRecord::Base
2 | belongs_to :article
3 |
4 | validates :message, :username, :email, presence: true
5 | validates :username, length: { maximum: 20 }
6 | validates_format_of :email,:with => /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/
7 | end
8 |
--------------------------------------------------------------------------------
/app/views/articles/search.html.slim:
--------------------------------------------------------------------------------
1 | .search-content
2 | = render 'shared/form_error_message'
3 | - @articles.each do |article|
4 | h2.search-title
5 | = link_to sanitize(article.title), article
6 | .search-html
7 | = sanitize article.content
8 | = paginate @articles
9 |
--------------------------------------------------------------------------------
/lib/markdown.rb:
--------------------------------------------------------------------------------
1 | require 'rouge'
2 | require 'rouge/plugins/redcarpet'
3 |
4 | class CodeHTML < Redcarpet::Render::HTML
5 | include Rouge::Plugins::Redcarpet
6 |
7 | def initialize(extensions = {})
8 | super extensions.merge(link_attributes: { target: "_blank" })
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/assets/javascripts/application.js:
--------------------------------------------------------------------------------
1 | //= require jquery
2 | //= require bootstrap-sprockets
3 | //= require jquery_ujs
4 | //= require turbolinks
5 | //= require nprogress
6 | //= require nprogress-turbolinks
7 | //= require jquery.html5-fileupload
8 | //= require jquery.tiles
9 | //= require_tree .
10 |
--------------------------------------------------------------------------------
/config/initializers/kaminari_config.rb:
--------------------------------------------------------------------------------
1 | Kaminari.configure do |config|
2 | config.default_per_page = 10
3 | # config.max_per_page = nil
4 | config.window = 2
5 | # config.outer_window = 0
6 | # config.left = 0
7 | # config.right = 0
8 | # config.page_method_name = :page
9 | # config.param_name = :page
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/shared/_form_error_message.html.slim:
--------------------------------------------------------------------------------
1 | - flash.each do |name, msg|
2 | - if msg.is_a?(String)
3 | div class="alert alert-dismissible alert-#{name == 'error'? 'danger':'info'}" role='alert'
4 | button.close type='button' data-dismiss="alert" aria-label="Close"
5 | span aria-hidden="true"
6 | |×
7 | = msg
8 |
--------------------------------------------------------------------------------
/app/controllers/application_controller.rb:
--------------------------------------------------------------------------------
1 | class ApplicationController < ActionController::Base
2 | protect_from_forgery with: :exception
3 |
4 | before_action do
5 | @newest_articles = Article.order(created_at: 'desc').limit(10)
6 | end
7 |
8 | helper_method :login?
9 | def login?
10 | session[:login].present?
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/application.scss:
--------------------------------------------------------------------------------
1 | @import 'variables';
2 | @import "bootstrap-sprockets";
3 | @import "bootstrap";
4 | @import 'admin/posts';
5 | @import 'articles';
6 | @import 'ihover';
7 | @import 'welcome';
8 | @import 'markdown';
9 | @import 'highlight';
10 | @import 'jquery.tiles.min';
11 | @import 'nprogress';
12 | @import 'nprogress-bootstrap';
13 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # This file should contain all the record creation needed to seed the database with its default values.
2 | # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3 | #
4 | # Examples:
5 | #
6 | # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7 | # Mayor.create(name: 'Emanuel', city: cities.first)
8 |
--------------------------------------------------------------------------------
/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | ENV['RAILS_ENV'] ||= 'test'
2 | require File.expand_path('../../config/environment', __FILE__)
3 | require 'rails/test_help'
4 |
5 | class ActiveSupport::TestCase
6 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
7 | fixtures :all
8 |
9 | # Add more helper methods to be used by all tests here...
10 | end
11 |
--------------------------------------------------------------------------------
/app/views/welcome/photo.html.slim:
--------------------------------------------------------------------------------
1 | = render 'shared/form_error_message'
2 |
3 | section
4 | .title
5 | button.start.action type="button" Play
6 | button.stop.action type="button" Stop
7 | .slider-wrap
8 | .slider
9 | - @photos.each do |photo|
10 | = image_tag(photo.image_url, size: '940*400')
11 | p = photo.image_name
12 | footer
13 | = link_to '返回首页', '/'
14 |
--------------------------------------------------------------------------------
/app/assets/javascripts/admin/photos.coffee:
--------------------------------------------------------------------------------
1 | $(document).on 'ready, page:change', ->
2 | $('#upload-photo-album').click ->
3 | $("input[type=file]").show().focus().click().hide()
4 | false
5 |
6 | opt =
7 | type: 'POST'
8 | url: "/admin/photos/upload"
9 | success: (data,status,xhr)->
10 | location.reload()
11 |
12 | $('input.file-window-photo-album').fileUpload(opt)
13 |
--------------------------------------------------------------------------------
/app/views/welcome/index.html.slim:
--------------------------------------------------------------------------------
1 | - content_for(:title) do
2 | |主页 - 最新文章列表
3 | .row.index-row
4 | - @articles.each_with_index do |artc1, index|
5 | .col-sm-6
6 | .ih-item.square.effect3.bottom_to_top.index-row
7 | .index-title
8 | = artc1.title
9 | = link_to article_path(artc1) do
10 | .img
11 | = image_tag("#{index + 1}.jpg")
12 | .info
13 | h3 = artc1.title
14 | p.square-p 点击查看
15 |
--------------------------------------------------------------------------------
/app/views/kaminari/_paginator.html.slim:
--------------------------------------------------------------------------------
1 | = paginator.render do
2 | ul.pagination
3 | == first_page_tag unless current_page.first?
4 | == prev_page_tag unless current_page.first?
5 |
6 | - each_page do |page|
7 | - if page.left_outer? || page.right_outer? || page.inside_window?
8 | == page_tag page
9 | - elsif !page.was_truncated?
10 | == gap_tag
11 |
12 | == next_page_tag unless current_page.last?
13 | == last_page_tag unless current_page.last?
14 |
--------------------------------------------------------------------------------
/app/views/admin/articles/index.html.slim:
--------------------------------------------------------------------------------
1 | .container
2 | - @articles.each do |article|
3 | .row
4 | .col-md-3
5 | = link_to article.title, article
6 | .col-md-2
7 | = article.created_at.to_date
8 | .col-md-1
9 | = link_to "评论", article
10 | .col-md-1
11 | = link_to "编辑", edit_admin_article_path(article)
12 | .col-md-1
13 | = link_to "删除", admin_article_path(article), method: :delete, data: { confirm: "确认删除?" }
14 |
15 | = paginate @articles
16 |
--------------------------------------------------------------------------------
/app/views/admin/sessions/new.html.slim:
--------------------------------------------------------------------------------
1 | .container
2 | .row
3 | .col-sm-6.col-sm-offset-3
4 | = render 'shared/form_error_message'
5 | h1 登录
6 | = form_for(:session, url: signin_path, class: 'form-horizontal') do |f|
7 | .form-group
8 | = f.text_field :username, class: 'form-control', placeholder: '用户名'
9 | .form-group
10 | = f.password_field :password, class: 'form-control', placeholder: '密码'
11 | = f.submit '登录', class: 'btn btn-large btn-primary'
12 |
--------------------------------------------------------------------------------
/app/views/layouts/photo.html.slim:
--------------------------------------------------------------------------------
1 | html
2 | head
3 | title
4 | |Rina's Blog
5 | meta name="viewport" content="width=device-width, initial-scale=1.0, max-scale=1.0"
6 | = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
7 | = javascript_include_tag 'application', 'data-turbolinks-track' => true
8 | = csrf_meta_tags
9 | body.photo-body
10 | .container.photo-container
11 | = audio_tag("sound.mp3", loop: true, class: 'audio-tag', type: 'audio/mpeg')
12 | = yield
13 |
--------------------------------------------------------------------------------
/config/environments/development.rb:
--------------------------------------------------------------------------------
1 | Rails.application.configure do
2 |
3 | config.cache_classes = false
4 | config.eager_load = false
5 | config.consider_all_requests_local = true
6 |
7 | config.action_controller.perform_caching = false
8 | config.action_mailer.raise_delivery_errors = false
9 | config.active_support.deprecation = :log
10 | config.active_record.migration_error = :page_load
11 |
12 | config.assets.debug = false
13 | config.assets.digest = true
14 | config.assets.raise_runtime_errors = true
15 | end
16 |
--------------------------------------------------------------------------------
/vendor/assets/javascripts/mp3.js:
--------------------------------------------------------------------------------
1 | $(document).on('ready, page:change',function(){
2 | $('.header-circle').click(function(){
3 | if($('.start-misic').offset().left == 0){
4 | $('.audio-tag')[0].pause();
5 | $('.stop-misic').hide();
6 | $('.start-misic').show();
7 | }else{
8 | $('.audio-tag')[0].play();
9 | $('.start-misic').hide();
10 | $('.stop-misic').show();
11 | }
12 | })
13 | $('.audio-tag')[0].onended = function(){
14 | $('.stop-misic').hide();
15 | $('.start-misic').show();
16 | }
17 | });
18 |
--------------------------------------------------------------------------------
/app/views/welcome/rss.builder:
--------------------------------------------------------------------------------
1 | xml.instruct!
2 |
3 | xml.rss "version" => "2.0", "xmlns:dc" => "http://purl.org/dc/elements/1.1/" do
4 | xml.channel do
5 |
6 | xml.title 'Rina\'s Blog'
7 | xml.link 'http://liuzhem.me'
8 | xml.description 'hello world'
9 |
10 | @articles.each do |article|
11 | xml.item do
12 | xml.title article.title
13 | xml.link article_url(article)
14 | xml.description article.to_html.content
15 | xml.guid article_url(article)
16 | end
17 | end
18 |
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/app/controllers/admin/sessions_controller.rb:
--------------------------------------------------------------------------------
1 | class Admin::SessionsController < ApplicationController
2 | layout 'admin'
3 |
4 | def new
5 | end
6 |
7 | def create
8 | if params[:session][:username] == ENV['pusher_user'] && params[:session][:password] == ENV['pusher_pwd']
9 | session[:login] = true
10 | redirect_to admin_articles_path
11 | else
12 | flash.now[:error] = '用户名或密码错误'
13 | render 'new'
14 | end
15 | end
16 |
17 | def destroy
18 | session[:login] = false
19 | flash[:notic] = '成功退出'
20 | redirect_to signin_path
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/config/initializers/wrap_parameters.rb:
--------------------------------------------------------------------------------
1 | # Be sure to restart your server when you modify this file.
2 |
3 | # This file contains settings for ActionController::ParamsWrapper which
4 | # is enabled by default.
5 |
6 | # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7 | ActiveSupport.on_load(:action_controller) do
8 | wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9 | end
10 |
11 | # To enable root element in JSON for ActiveRecord objects.
12 | # ActiveSupport.on_load(:active_record) do
13 | # self.include_root_in_json = true
14 | # end
15 |
--------------------------------------------------------------------------------
/app/views/admin/photos/index.html.slim:
--------------------------------------------------------------------------------
1 | .container
2 | .row
3 | a.pull-right.btn.btn-info.index-btn-info.self_photograph#upload-photo-album herf='#'
4 | |插入图片
5 | input.file-window-photo-album type='file'
6 |
7 | - @photos.each do |photo|
8 | .row
9 | .col-md-2
10 | = photo.image_name
11 | .col-md-3
12 | = image_tag photo.image_url, style: 'width: 50%'
13 | .col-md-2
14 | = photo.created_at.to_date
15 | .col-md-1
16 | = link_to "删除", admin_photo_path(photo), method: :delete, data: { confirm: "确认删除?" }
17 |
18 | = paginate @photos
19 |
--------------------------------------------------------------------------------
/public/sitemap.xml:
--------------------------------------------------------------------------------
1 |
2 |
If you are the application owner check the logs for more information.
64 |Maybe you tried to change something you didn't have access to.
63 |If you are the application owner check the logs for more information.
65 |You may have mistyped the address or the page may have moved.
63 |If you are the application owner check the logs for more information.
65 |50 | 使用说明: 网站主可以自己定义要分享的图片,其自定义标准代码如下: 51 |
52 |<!-- JiaThis Button BEGIN -->
53 | <script "text/javascript">
54 | var jiathis_config = {
55 | pic:”自定义分享的图片地址”
56 | }
57 | </script>
58 | <script src="http://v2.jiathis.com/code/jiathis_r.js?move=0"></script>
59 | <!-- JiaThis Button END -->
60 |
61 |
62 |
63 |
65 | 66 |
67 |