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
935b356a
Commit
935b356a
authored
Mar 13, 2014
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flow view
parent
61e8e6be
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
61 additions
and
21 deletions
+61
-21
app/assets/stylesheets/application.css
+3
-0
app/assets/stylesheets/lib/mod-hover-hidden.css.scss
+11
-0
app/controllers/flow_controller.rb
+1
-1
app/decorators/post_decorator.rb
+14
-0
app/decorators/posts_decorator.rb
+2
-0
app/views/posts/_large_item.html.slim
+17
-11
spec/controllers/flow_controller_spec.rb
+4
-0
spec/controllers/stock_controller_spec.rb
+9
-9
No files found.
app/assets/stylesheets/application.css
View file @
935b356a
...
@@ -14,3 +14,6 @@
...
@@ -14,3 +14,6 @@
*= require_self
*= require_self
*/
*/
.text-shadow
{
color
:
#999999
;
}
app/assets/stylesheets/lib/mod-hover-hidden.css.scss
0 → 100644
View file @
935b356a
.mod-hover-hidden
:hover
{
.mod-hover-hidden-item
{
display
:
initial
;
}
}
.mod-hover-hidden
{
.mod-hover-hidden-item
{
display
:
none
;
}
}
app/controllers/flow_controller.rb
View file @
935b356a
...
@@ -2,6 +2,6 @@ class FlowController < ApplicationController
...
@@ -2,6 +2,6 @@ class FlowController < ApplicationController
before_action
:require_login
before_action
:require_login
def
show
def
show
@posts
=
Post
.
order
(
updated_at: :desc
).
limit
(
20
)
@posts
=
Post
.
order
(
updated_at: :desc
).
limit
(
20
)
.
decorate
end
end
end
end
app/decorators/post_decorator.rb
View file @
935b356a
...
@@ -5,4 +5,18 @@ class PostDecorator < Draper::Decorator
...
@@ -5,4 +5,18 @@ class PostDecorator < Draper::Decorator
h
.
post_path
(
model
)
h
.
post_path
(
model
)
end
end
# 読了時間
# 500文字/1分換算
def
read_time
_time_min
=
model
.
body
.
length
/
500
case
_time_min
when
0
'< 1 min.'
when
1
..
10
"
#{
_time_min
}
min."
else
'> 10 min.'
end
end
end
end
app/decorators/posts_decorator.rb
0 → 100644
View file @
935b356a
class
PostsDecorator
<
Draper
::
CollectionDecorator
end
app/views/posts/_large_item.html.slim
View file @
935b356a
/ locals:
/ locals:
/ post {Post}
/ post {Post}
a
.list-group-item.post-list
data-post-id
=
post
.id
href
=
post_path
(
post
)
a
.list-group-item.post-list
.mod-hover-hidden
data-post-id
=
post
.id
href
=
post_path
(
post
)
.container-fluid
.container-fluid
.row
.row
.col-xs-10
.col-xs-10
.text-primary
#{
post
.
title
}
.text-primary
#{
post
.
title
}
.col-xs-2
.col-xs-2
small
.pull-right
small
.pull-right
=
post
.
id
##{
post
.id
}
.row
.row
.col-xs-
10
.col-xs-
8
small
small
.text-success
|
#{
post
.
author
.
name
}
posted
|
#{
post
.
author
.
name
}
posted
abbr
.js-time-ago
data-time-ago-at
=
post
.updated_at
abbr
.js-time-ago
data-time-ago-at
=
post
.updated_at
|
.
|
.
-
post
.
tags
.
each
do
|
tag
|
-
post
.
tags
.
each
do
|
tag
|
span
.label.label-success
#
#{
tag
.
name
}
span
.label.label-success
#
#{
tag
.
name
}
|
|
.col-xs-
2
.col-xs-
4
small
.pull-right
small
.pull-right
span
.glyphicon.glyphicon-paperclip
1
span
.glyphicon.glyphicon-time
|
span
.mod-hover-hidden-item
span
.glyphicon.glyphicon-eye-open
2
|
読了時間
|
|
#{
post
.
read_time
}
span
.glyphicon.glyphicon-edit
3
span
.glyphicon.glyphicon-edit
|
span
.mod-hover-hidden-item
|
コメント
|
#{
post
.
comments
.
count
}
.row
.col-xs-12
small
.text-shadow
=
truncate
post
.
body
,
length:
240
spec/controllers/flow_controller_spec.rb
View file @
935b356a
...
@@ -2,6 +2,10 @@ require 'spec_helper'
...
@@ -2,6 +2,10 @@ require 'spec_helper'
describe
FlowController
do
describe
FlowController
do
before
:each
do
@post
=
create
(
:post
)
end
describe
"GET 'show'"
do
describe
"GET 'show'"
do
it
"returns http success"
do
it
"returns http success"
do
get
'show'
get
'show'
...
...
spec/controllers/stock_controller_spec.rb
View file @
935b356a
require
'spec_helper'
#
require 'spec_helper'
describe
StockController
do
#
describe StockController do
describe
"GET 'show'"
do
#
describe "GET 'show'" do
it
"returns http success"
do
#
it "returns http success" do
get
'show'
#
get 'show'
response
.
should
be_success
#
response.should be_success
end
#
end
end
#
end
end
#
end
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