Skip to content
This repository has been archived by the owner on Apr 23, 2021. It is now read-only.

Commit

Permalink
Merge pull request #19 from KarlHochfilzer/master
Browse files Browse the repository at this point in the history
Don't show more than n pages in submenue of Section
  • Loading branch information
iboard committed Mar 21, 2013
2 parents e25a286 + 022d79e commit 82c05f1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 13 deletions.
11 changes: 0 additions & 11 deletions app/assets/javascripts/page.coffee
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
jQuery ->

if $('#scroll-to').length > 0
$('#scroll-to').ready ->
$('#banner').ready ->
offset = $('#scroll-to').data('offset')
y = $('#scroll-to').position().top + offset
setTimeout("skipBanner(#{y})",500)

self.skipBanner = (y) ->
$('body').animate( {scrollTop : y },'slow')


if $('#toggle-section-banner').length > 0
$('#toggle-section-banner').click (event) ->
event.preventDefault()
Expand Down
21 changes: 21 additions & 0 deletions app/assets/stylesheets/wat.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,27 @@ img.avatar {
}
}
}
ul.pages.dropdown-menu {
background: $navbarBackground;
border-color: #d5d5d5;
border-width: 0 0 1px;
border-radius: 5px;
a {
color: white;
&:hover {
color: black;
background: white;
}
}
.active {
a {
background: $navbarBackgroundHighlight;
&:hover {
color: black;
}
}
}
}
}

.sort-title, .sort-edit-link, .sort-section-label {
Expand Down
12 changes: 10 additions & 2 deletions app/views/pages/_section_subnav.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
- _count_pages = section.pages.count
- _pages_to_show = Settings.pages_in_section_subnav || 4
- if section.pages.count > 1
.subnav
%ul{class: "nav nav-pills section-menu #{section._id} left"}
- _pages = can_read?('Admin','Maintainer') ? section.pages : section.pages.online
- _pages.only(:title).each do |page|
- _pages.only(:title).limit(_pages_to_show).each do |page|
%li{class: page == @page ? 'active' : 'inactive'}=link_to page.title, page, id: "link_to_#{page.id}"
%hr/
- if _count_pages > 4
%li.inactive.dropdown
= link_to ((t(:load_more_link))+"<b class='caret'></b>").html_safe, "#", :class => 'dropdown-toggle', 'data-toggle' => 'dropdown'
%ul.pages.dropdown-menu
- _pages.only(:title).skip(_pages_to_show).each do |page|
%li{class: page == @page ? 'active' : 'inactive'}=link_to page.title, page, id: "link_to_#{page.id}"
%hr
1 change: 1 addition & 0 deletions config/settings/development.yml_sample
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ developer_mail_address: "[email protected]"

# paginate_users_per_page: 4
# paginate_pages_per_page: 4
# pages_in_section_subnav: 4

# TIMELINE BEHAVIOR

Expand Down
1 change: 1 addition & 0 deletions config/settings/production.yml_sample
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ developer_mail_address: "[email protected]"
# default, when not defined = 4
paginate_users_per_page: 2
paginate_pages_per_page: 2
# pages_in_section_subnav: 4

# TIMELINE BEHAVIOR

Expand Down

0 comments on commit 82c05f1

Please sign in to comment.