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
4311c1e2
Commit
4311c1e2
authored
Dec 31, 2013
by
tady
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
side tab navigation
parent
fa371a28
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
37 additions
and
12 deletions
+37
-12
Guardfile
+1
-0
app/assets/javascripts/posts/index.js.coffee
+11
-3
app/assets/stylesheets/app.css.scss
+6
-0
app/helpers/posts_helper.rb
+1
-1
app/views/posts/index.html.erb
+15
-2
db/seeds/SkypeのチャットをリアルタイムにChatworkに転送するRubyスクリプト(更新-API利用版)
+1
-4
spec/features/posts_spec.rb
+2
-2
No files found.
Guardfile
View file @
4311c1e2
...
@@ -5,6 +5,7 @@ guard :rspec, all_after_pass: true, spring: true do
...
@@ -5,6 +5,7 @@ guard :rspec, all_after_pass: true, spring: true do
watch
(
%r{^app/(.+)
\.
rb$}
)
{
|
m
|
"spec/
#{
m
[
1
]
}
_spec.rb"
}
watch
(
%r{^app/(.+)
\.
rb$}
)
{
|
m
|
"spec/
#{
m
[
1
]
}
_spec.rb"
}
watch
(
%r{^app/(.*)(
\.
erb|
\.
haml)$}
)
{
|
m
|
"spec/
#{
m
[
1
]
}#{
m
[
2
]
}
_spec.rb"
}
watch
(
%r{^app/(.*)(
\.
erb|
\.
haml)$}
)
{
|
m
|
"spec/
#{
m
[
1
]
}#{
m
[
2
]
}
_spec.rb"
}
watch
(
%r{^app/(.*)(
\.
erb|
\.
haml)$}
)
{
'spec/features'
}
watch
(
%r{^spec/factories/(.+)
\.
rb$}
)
{
'spec/factories_spec.rb'
}
watch
(
%r{^spec/factories/(.+)
\.
rb$}
)
{
'spec/factories_spec.rb'
}
watch
(
%r{^spec/support/(.+)
\.
rb$}
)
{
'spec'
}
watch
(
%r{^spec/support/(.+)
\.
rb$}
)
{
'spec'
}
watch
(
'config/routes.rb'
)
{
'spec/routing'
}
watch
(
'config/routes.rb'
)
{
'spec/routing'
}
...
...
app/assets/javascripts/posts/index.js.coffee
View file @
4311c1e2
...
@@ -18,15 +18,23 @@ if window.location.pathname.match /^\/posts\/?$/
...
@@ -18,15 +18,23 @@ if window.location.pathname.match /^\/posts\/?$/
# 初期に詳細を表示
# 初期に詳細を表示
# open post when `id` parameter set.
# open post when `id` parameter set.
id_param
=
RV
.
tools
.
getQueryParams
()[
"id"
]
id_param
=
RV
.
tools
.
getQueryParams
()[
"id"
]
if
id_param
?
if
id_param
?
$
(
".post-list[data-post-id='
#{
id_param
}
']"
).
addClass
(
'active'
)
$
(
"
a
.post-list[data-post-id='
#{
id_param
}
']"
).
addClass
(
'active'
)
$
.
get
(
'/posts/show_fragment'
,
{
$
.
get
(
'/posts/show_fragment'
,
{
'id'
:
id_param
,
'id'
:
id_param
,
})
})
.
done
(
data
)
->
.
done
(
data
)
->
$
(
'#list_post'
).
html
(
data
)
$
(
'#list_post'
).
html
(
data
)
prettyPrint
()
prettyPrint
()
else
$el
=
$
(
"a.post-list:eq(0)"
)
$el
.
addClass
(
'active'
)
$
.
get
(
'/posts/show_fragment'
,
{
'id'
:
$el
.
data
(
'postId'
),
})
.
done
(
data
)
->
$
(
'#list_post'
).
html
(
data
)
prettyPrint
()
app/assets/stylesheets/app.css.scss
View file @
4311c1e2
...
@@ -51,6 +51,12 @@
...
@@ -51,6 +51,12 @@
width
:
200px
;
width
:
200px
;
}
}
/* side tree view
-------------------------------------------------- */
ul
{
padding-left
:
1em
;
}
/* home#show
/* home#show
-------------------------------------------------- */
-------------------------------------------------- */
.text-box
{
.text-box
{
...
...
app/helpers/posts_helper.rb
View file @
4311c1e2
...
@@ -3,7 +3,7 @@ module PostsHelper
...
@@ -3,7 +3,7 @@ module PostsHelper
def
h_display_tree
(
node
)
def
h_display_tree
(
node
)
_html
=
'<ul>'
_html
=
'<ul>'
if
node
.
posts
.
count
>
0
if
node
.
posts
.
count
>
0
_html
<<
%Q{<li><a href="
#{
root
_path
(
q:
'#'
+
node
.
name
)
}
">
#{
node
.
name
}
<span class="badge">
#{
node
.
posts
.
count
}
</span></a></li>}
_html
<<
%Q{<li><a href="
#{
posts
_path
(
q:
'#'
+
node
.
name
)
}
">
#{
node
.
name
}
<span class="badge">
#{
node
.
posts
.
count
}
</span></a></li>}
end
end
node
.
children
.
each
do
|
_child
|
node
.
children
.
each
do
|
_child
|
_html
<<
h_display_tree
(
_child
)
_html
<<
h_display_tree
(
_child
)
...
...
app/views/posts/index.html.erb
View file @
4311c1e2
...
@@ -9,12 +9,20 @@
...
@@ -9,12 +9,20 @@
<div
class=
"col-xs-6 col-md-4"
id=
"sidebar"
role=
"navigation"
>
<div
class=
"col-xs-6 col-md-4"
id=
"sidebar"
role=
"navigation"
>
<ul
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
href=
"#tab-list"
data-toggle=
"tab"
>
List
</a></li>
<li><a
href=
"#tab-tree"
data-toggle=
"tab"
>
Tag Tree
</a></li>
</ul>
<div
class=
"tab-content"
>
<div
class=
"tab-pane active"
id=
"tab-list"
>
<div
class=
"list-group"
>
<div
class=
"list-group"
>
<%
@posts
.
each
do
|
post
|
%>
<%
@posts
.
each_with_index
do
|
post
,
i
|
%>
<a
href=
"#"
data-post-id=
"
<%=
post
.
id
%>
"
class=
"list-group-item post-list"
>
<%=
post
.
title
%>
</a>
<a
href=
"#"
data-post-id=
"
<%=
post
.
id
%>
"
class=
"list-group-item post-list"
>
<%=
post
.
title
%>
</a>
<%
end
%>
<%
end
%>
</div>
</div>
</div>
<!-- /.tab-pane -->
<div
class=
"tab-pane"
id=
"tab-tree"
>
<%
cache
(
'tag-tree'
,
:expires_in
=>
1
.
hour
)
do
%>
<%
cache
(
'tag-tree'
,
:expires_in
=>
1
.
hour
)
do
%>
<div
class=
"list-group"
>
<div
class=
"list-group"
>
<%
Tag
.
roots
.
each
do
|
root
|
%>
<%
Tag
.
roots
.
each
do
|
root
|
%>
...
@@ -22,6 +30,8 @@
...
@@ -22,6 +30,8 @@
<%
end
%>
<%
end
%>
</div>
</div>
<%
end
%>
<%
end
%>
</div>
<!-- /.tab-pane -->
</div>
<!-- /.tab-content -->
</div>
<!--/span-->
</div>
<!--/span-->
...
@@ -38,6 +48,9 @@
...
@@ -38,6 +48,9 @@
<hr>
<hr>
<footer>
<footer>
<a
href=
"https://github.com/tadyjp/rendezvous"
>
Github
</a>
|
<a
href=
"https://twitter.com/tady_jp"
>
@tady_jp
</a>
</footer>
</footer>
</div>
<!--/.container-->
</div>
<!--/.container-->
...
...
db/seeds/SkypeのチャットをリアルタイムにChatworkに転送するRubyスクリプト(更新-API利用版)
View file @
4311c1e2

### 最終更新日
### 最終更新日
- 2013-12-10
- 2013-12-10
...
...
spec/features/posts_spec.rb
View file @
4311c1e2
...
@@ -18,9 +18,9 @@ describe 'Request via js', js: true do
...
@@ -18,9 +18,9 @@ describe 'Request via js', js: true do
visit
'/posts'
visit
'/posts'
end
end
it
'show
placeholder
'
do
it
'show
first post
'
do
page
.
save_screenshot
(
Rails
.
root
.
join
(
'tmp'
,
'screenshots'
,
"a-
#{
Time
.
now
.
strftime
(
'%Y-%m-%d %H%M%S'
)
}
.png"
))
page
.
save_screenshot
(
Rails
.
root
.
join
(
'tmp'
,
'screenshots'
,
"a-
#{
Time
.
now
.
strftime
(
'%Y-%m-%d %H%M%S'
)
}
.png"
))
expect
(
page
.
find
(
'#
posts-placeholder'
).
text
).
to
include
(
'Select a post
'
)
expect
(
page
.
find
(
'#
list_post div.title a'
).
text
).
to
include
(
'ruby rspec
'
)
end
end
it
'click post and show'
do
it
'click post and show'
do
...
...
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