修改了tabs页面,字体大小

exceptionHandle
huangjingquan 12 years ago
parent 844f1d2dcf
commit c4df893eab

@ -34,6 +34,7 @@ class BidsController < ApplicationController
limit = @bid_count % @limit
@bids = @bids.offset(@offset).limit(limit).all.reverse
end
@s_state = 0
when '1'
unless @offset == 0
@bids = @bids.reorder('bids.commit').offset(@offset).limit(@limit).all.reverse
@ -41,6 +42,7 @@ class BidsController < ApplicationController
limit = @bid_count % @limit
@bids = @bids.reorder('bids.commit').offset(@offset).limit(limit).all.reverse
end
@s_state = 1
when '2'
unless @offset == 0
@bids = @bids.offset(@offset).limit(@limit).all.reverse
@ -48,6 +50,7 @@ class BidsController < ApplicationController
limit = @bid_count % @limit
@bids = @bids.offset(@offset).limit(@limit).all.reverse
end
@s_state = 0
end
else
unless @offset == 0
@ -56,6 +59,7 @@ class BidsController < ApplicationController
limit = @bid_count % @limit
@bids = @bids.offset(@offset).limit(limit).all.reverse
end
@s_state = 0
end
#end
# @limit = api_offset_and_limit({:limit => 5})

@ -19,6 +19,9 @@ class ProjectsController < ApplicationController
menu_item :overview
menu_item :roadmap, :only => :roadmap
menu_item :settings, :only => :settings
menu_item l(:label_sort_by_time), :only => :index
menu_item l(:label_sort_by_active), :only => :index
menu_item l(:label_sort_by_influence), :only => :index
before_filter :find_project, :except => [ :index, :list, :new, :create, :copy ]
before_filter :authorize, :except => [:watcherlist, :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy, :member, :focus, :file, :statistics, :feedback, :project_respond]
@ -104,6 +107,7 @@ class ProjectsController < ApplicationController
@project_pages = Paginator.new @project_count, @limit, params['page']
@offset ||= @project_pages.reverse_offset
#@projects = @projects.offset(@offset).limit(@limit).order('created_on DESC').all
if params[:project_sort_type].present?
case params[:project_sort_type]
@ -118,6 +122,7 @@ class ProjectsController < ApplicationController
end
@projects = @projects.offset(@offset).limit(limit).all.reverse
end
@s_type = 0
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
# @projects = @projects[@offset, @limit]
when '1'
@ -131,6 +136,7 @@ class ProjectsController < ApplicationController
end
@projects = @projects.includes(:project_status).reorder('project_statuses.changesets_count').offset(@offset).limit(limit).all.reverse
end
@s_type = 1
#@projects = @projects[@offset, @limit]
when '2'
@ -144,6 +150,7 @@ class ProjectsController < ApplicationController
end
@projects = @projects.includes(:project_status).reorder('project_statuses.watchers_count').offset(@offset).limit(limit).all.reverse
end
@s_type = 2
end
else
@offset ||= @project_pages.reverse_offset
@ -156,6 +163,7 @@ class ProjectsController < ApplicationController
end
@projects = @projects.offset(@offset).limit(limit).all.reverse
end
@s_type = 0
# @projects = @projects.sort {|x,y| y.created_on <=> x.created_on }
# @projects = @projects[@offset, @limit]

@ -37,4 +37,18 @@ module BidsHelper
Bid.tagged_with(tag_name).order('updated_on desc')
end
def sort_bid(state)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0'), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1')))
when 1
content << content_tag('li', link_to(l(:label_sort_by_time), calls_path(:bid_sort_type => '0')))
content << content_tag('li', link_to(l(:label_sort_by_active), calls_path(:bid_sort_type => '1'), :class=>"selected"), :class=>"selected")
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs")
end
end

@ -36,6 +36,28 @@ module ProjectsHelper
]
tabs.select {|tab| User.current.allowed_to?(tab[:action], @project)}
end
def sort_project(state)
content = ''.html_safe
case state
when 0
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0'), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1')))
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2')))
when 1
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0')))
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1'), :class=>"selected"), :class=>"selected")
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2')))
when 2
content << content_tag('li', link_to(l(:label_sort_by_time), projects_path(:project_sort_type => '0')))
content << content_tag('li', link_to(l(:label_sort_by_active), projects_path(:project_sort_type => '1')))
content << content_tag('li', link_to(l(:label_sort_by_influence), projects_path(:project_sort_type => '2'), :class=>"selected"), :class=>"selected")
end
content = content_tag('ul', content)
content_tag('div', content, :class => "tabs")
end
def parent_project_select_tag(project)
selected = project.parent

@ -28,8 +28,8 @@
</div>
<% end %>
<div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
<%= sort_bid(@s_state)%>
<!-- <div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
<ul style="margin-right:0px">
<li>
<%= link_to l(:label_sort_by_time), calls_path(:bid_sort_type => '0') %>
@ -40,8 +40,8 @@
<!-- <li>
<%= link_to l(:label_sort_by_influence), calls_path(:bid_sort_type => '2') %>
</li> -->
</ul>
</div>
<!-- </ul>
</div> -->
<div id="bid-show">
<%= render :partial => 'bid_show', :locals => {:bids => @bids, :bid_pages => @bid_pages} %>

@ -19,19 +19,20 @@
</div>
<%end%>
<div class="pagination" style="border-bottom: 1px solid rgb(223,223,223); width: 95%; margin-left: 2%; margin-top: 15px" >
<ul style="margin-right:0px">
<%= sort_project(@s_type)%>
<!-- <div class="pagination_list">
<ul>
<li>
<%= link_to l(:label_sort_by_time), projects_path(:project_sort_type => '0') %>
<%= link_to l(:label_sort_by_time), projects_path(:project_sort_type => '0'),:class=>"test_new" %>
</li>
<li>
<%= link_to l(:label_sort_by_active), projects_path(:project_sort_type => '1') %>
<%= link_to l(:label_sort_by_active), projects_path(:project_sort_type => '1'),:class=>"test_new" %>
</li>
<li>
<%= link_to l(:label_sort_by_influence), projects_path(:project_sort_type => '2') %>
<%= link_to l(:label_sort_by_influence), projects_path(:project_sort_type => '2'),:class=>"test_new" %>
</li>
</ul>
</div>
</div> -->
<div id="projects-index">

File diff suppressed because it is too large Load Diff

@ -1350,6 +1350,11 @@ div.pagination ul {
margin-left: 0px;
margin-top: 0px;
}
div.pagination ul li{
font-size: 14px;
text-decoration:none;
}
div.user-bottom {
margin-left: 64px;

Loading…
Cancel
Save