Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rendezvous
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VeNtura
rendezvous
Commits
005b634d
Commit
005b634d
authored
Mar 08, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
presentation
parent
ca366ef6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
1 deletions
+41
-1
app/controllers/posts_controller.rb
+6
-1
app/models/post.rb
+5
-0
app/views/layouts/slideshow.html.erb
+15
-0
app/views/posts/_show_fragment.html.erb
+3
-0
app/views/posts/slideshow.html.erb
+11
-0
config/routes.rb
+1
-0
No files found.
app/controllers/posts_controller.rb
View file @
005b634d
require
'nkf'
class
PostsController
<
ApplicationController
before_action
:set_post
,
only:
[
:show
,
:edit
,
:update
,
:destroy
]
before_action
:set_post
,
only:
[
:show
,
:edit
,
:update
,
:destroy
,
:slideshow
]
before_action
:require_login
include
RV
::
Mailer
...
...
@@ -112,6 +112,11 @@ class PostsController < ApplicationController
end
end
# Show presentation view
def
slideshow
render
layout:
'slideshow'
end
private
# Use callbacks to share common setup or constraints between actions.
...
...
app/models/post.rb
View file @
005b634d
...
...
@@ -55,4 +55,9 @@ class Post < ActiveRecord::Base
_forked_post
end
# slideshow用のbody
def
body_for_slideshow
self
.
body
.
gsub
(
/^#/
,
"---
\n\n
#"
)
end
end
app/views/layouts/slideshow.html.erb
0 → 100644
View file @
005b634d
<!DOCTYPE html>
<html
lang=
"ja"
>
<head>
<title>
Rendezvous
</title>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
</head>
<body
class=
"rails-
<%=
params
[
:controller
]
%>
-
<%=
params
[
:action
]
%>
"
>
<%=
yield
%>
<script
src=
"http://gnab.github.io/remark/downloads/remark-0.6.0.min.js"
type=
"text/javascript"
>
</script>
<script
type=
"text/javascript"
>
var
slideshow
=
remark
.
create
();
</script>
</body>
</html>
app/views/posts/_show_fragment.html.erb
View file @
005b634d
...
...
@@ -30,6 +30,9 @@
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu" role="menu">
<li><a href="<%= slideshow_post_path(@post) %>" target="_blank">Slideshow</a></li>
<li><a href="https://github.com/gnab/remark" target="_blank" class="small">What is Slideshow?</a></li>
<li class="divider"></li>
<li><a href="<%= fork_post_path(@post) %>">Fork</a></li>
<li><a href="#" data-toggle="modal" data-target="#myModal">Mail to...</a></li>
<li class="divider"></li>
...
...
app/views/posts/slideshow.html.erb
0 → 100644
View file @
005b634d
<textarea
id=
"source"
>
class: center, middle
<%=
@post
.
title
%>
<%=
@post
.
author
.
name
%>
(
<%=
@post
.
updated_at
.
strftime
(
'%Y-%m-%d'
)
%>
)
<%=
@post
.
body_for_slideshow
%>
</textarea>
config/routes.rb
View file @
005b634d
...
...
@@ -8,6 +8,7 @@ Rendezvous::Application.routes.draw do
get
'posts/:id/fork'
=>
'posts#fork'
,
as:
'fork_post'
post
'posts/:id/mail'
=>
'posts#mail'
,
as:
'mail_post'
post
'posts/:id/comment'
=>
'posts#comment'
,
as:
'comment_post'
get
'posts/:id/slideshow'
=>
'posts#slideshow'
,
as:
'slideshow_post'
resources
:posts
post
'tags/:name/merge_to/:merge_to_name'
=>
'tags#merge_to'
,
as:
'merge_to_tag'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment