修改查询条件样式

This commit is contained in:
fanqiang 2014-04-21 08:54:11 +08:00
parent a611ed4848
commit 8600265f00
3 changed files with 40 additions and 7 deletions

View File

@ -1,6 +1,6 @@
module OpenSourceProjectsHelper module OpenSourceProjectsHelper
def render_opensource_project(os_projects) def render_opensource_project(os_projects)
s='' s=''.html_safe
s << "<ul class='projects'>\n" s << "<ul class='projects'>\n"
os_projects.each do |project| os_projects.each do |project|
s << "<li class='project-table'><div class='#{classes}'>" s << "<li class='project-table'><div class='#{classes}'>"
@ -12,4 +12,35 @@ module OpenSourceProjectsHelper
s << "</ul>" s << "</ul>"
end end
def show_condition(app_dir, language, created_at)
s=''.html_safe
unless app_dir.nil?
s_temp = content_tag('a', app_dir)
temp = link_to 'x', {:controller => "tags", :action => "remove_tag"}, :remote => true
temp = content_tag('span', temp, :class => 'del')
s_temp << temp
s_temp = content_tag('span', s_temp, :class => 'tag_show')
s << content_tag('div', s_temp, :id => 'tag')
end
unless language.nil?
s_temp = content_tag('a', language)
temp = link_to 'x', {:controller => "tags", :action => "remove_tag"}, :remote => true
temp = content_tag('span', temp, :class => 'del')
s_temp << temp
s_temp = content_tag('span', s_temp, :class => 'tag_show')
s << content_tag('div', s_temp, :id => 'tag')
end
unless created_at.nil?
s_temp = content_tag('a', created_at)
temp = link_to 'x', {:controller => "tags", :action => "remove_tag"}, :remote => true
temp = content_tag('span', temp, :class => 'del')
s_temp << temp
s_temp = content_tag('span', s_temp, :class => 'tag_show')
s << content_tag('div', s_temp, :id => 'tag')
end
s = content_tag('div', s, :id => 'tags')
# s = content_tag('div', s, :class => 'tags')
end
end end

View File

@ -37,7 +37,10 @@
<% end %> <% end %>
</div></td> </div></td>
</tr> </tr>
<tr></tr> <tr>
<td style="padding-left: 8px"><%= link_to request.host()+"/open_source_projects", :controller => 'open_source_projects', :action => 'index' %></td>
<td ><%= link_to l(:field_homepage), home_path %> > <%= link_to "开源项目社区", :controller => 'open_source_projects', :action => 'index' %> > <%=link_to @open_source_project.name, open_source_project_path(@open_source_project) %></td>
</tr>
</table> </table>
</div> </div>

View File

@ -144,10 +144,9 @@ li {
<li class="has-arrow">查找条件><span class="nav-topbar-arror"></span> <li class="has-arrow">查找条件><span class="nav-topbar-arror"></span>
</li> </li>
<li> <li>
<span class="topbar-search J_TopbarSearch"> <span class="topbar-search J_TopbarSearch">
<%= @app_dir%> <%= show_condition(@app_dir, @language, @created_at) %>
<%= @language%>
<%= @created_at%>
</span> </span>
</li> </li>
<li>共 <span class="h"><%= @os_project_count %></span> 个开源项目</li> <li>共 <span class="h"><%= @os_project_count %></span> 个开源项目</li>