修改了按标签搜索,并改了一些样式
This commit is contained in:
parent
a426cf46de
commit
a611ed4848
|
@ -1,5 +1,5 @@
|
|||
class OpenSourceProject < ActiveRecord::Base
|
||||
attr_accessible :String
|
||||
attr_accessible :name
|
||||
|
||||
include Redmine::SafeAttributes
|
||||
has_many :applies, :class_name => "ApplyProjectMaster", :as => :apply, :dependent => :delete_all
|
||||
|
@ -12,6 +12,7 @@ class OpenSourceProject < ActiveRecord::Base
|
|||
has_many :apply_tips, :class_name => 'ApplyProjectMaster', :as => :apply, :dependent => :delete_all, :conditions => "#{ApplyProjectMaster.table_name}.status = 1"
|
||||
has_many :applicants, :class_name => 'User', :through => :apply_tips, :source => :user
|
||||
|
||||
validates_uniqueness_of :name
|
||||
|
||||
acts_as_taggable
|
||||
|
||||
|
@ -41,7 +42,7 @@ class OpenSourceProject < ActiveRecord::Base
|
|||
}
|
||||
|
||||
scope :filter_time, lambda {|args|
|
||||
nil
|
||||
where("YEAR(#{OpenSourceProject.table_name}.created_at) = ?", args) unless args.nil?
|
||||
}
|
||||
|
||||
# def filter_app_dir(app_dir)
|
||||
|
|
|
@ -57,12 +57,12 @@
|
|||
<%= content_tag('span', "项目来源:")%><%= link_to project.url, project.url %>
|
||||
</div>
|
||||
<div class="licences">
|
||||
<%= content_tag('span', "数据更新时间") %><%= content_tag('span', format_time(project.created_at)) %>
|
||||
<%= content_tag('span', "数据更新时间:") %><%= content_tag('span', project.date_collected) %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tags">
|
||||
<div id="tags">
|
||||
<%= image_tag( "/images/sidebar/tags.png") %>
|
||||
<%= render :partial => 'tags/tag_name', :locals => {:obj => project,:object_flag => "2",:non_list_all => true }%>
|
||||
<%= render :partial => 'tags/tag_name', :locals => {:obj => project,:object_flag => "7",:non_list_all => true }%>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<%= form_tag(:controller => 'open_source_projects', :action => "search", :method => :get) do %>
|
||||
<table width="940px">
|
||||
<tr>
|
||||
<td class="info_font" style="width: 220px; color: #15bccf"><%= l(:label_project_deposit) %></td>
|
||||
<td class="info_font" style="width: 220px; color: #15bccf">开源项目社区</td>
|
||||
<td class="location-list"><strong><%= l(:label_user_location) %> :</strong></td>
|
||||
<td rowspan="2"></td>
|
||||
<td rowspan="2" >
|
||||
|
@ -13,8 +13,8 @@
|
|||
</div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="padding-left: 8px"><a><%= link_to request.host()+"/projects", :controller => 'projects', :action => 'index', :project_type => 0 %> </a></td>
|
||||
<td ><%= link_to l(:field_homepage), home_path %> > <%= link_to l(:label_project_deposit), :controller => 'projects', :action => 'index', :project_type => 0 %></td>
|
||||
<td style="padding-left: 8px"><a><%= link_to request.host()+"/open_source_projects", :controller => 'open_source_projects', :action => 'index' %> </a></td>
|
||||
<td ><%= link_to l(:field_homepage), home_path %> > <%= link_to "开源项目社区", :controller => 'open_source_projects', :action => 'index' %></td>
|
||||
</tr>
|
||||
</table>
|
||||
<% end %>
|
||||
|
@ -179,13 +179,14 @@ li {
|
|||
<%= link_to "C", open_source_projects_path(:language => "c", :app_dir => @app_dir, :created_at => @created_at), :class => "nav-more J_More show" %>
|
||||
<%= link_to "C#", open_source_projects_path(:language => "c#", :app_dir => @app_dir, :created_at => @created_at), :class => "nav-more J_More show" %>
|
||||
<%= link_to "ruby", open_source_projects_path(:language => "ruby", :app_dir => @app_dir, :created_at => @created_at), :class => "nav-more J_More show" %>
|
||||
<%= link_to "其他", open_source_projects_path(:language => "其他", :app_dir => @app_dir, :created_at => @created_at), :class => "nav-more J_More show" %>
|
||||
<%#= link_to "其他", open_source_projects_path(:language => "其他", :app_dir => @app_dir, :created_at => @created_at), :class => "nav-more J_More show" %>
|
||||
|
||||
<span class="arrow arrow-bottom"></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="nav-category ">
|
||||
<h4 title="网络类型">创立时间<span>:</span></h4>
|
||||
<%= link_to "2014", open_source_projects_path(:app_dir => @app_dir, :language => @language, :created_at => "2014"), :class => "nav-more J_More show" %>
|
||||
<%= link_to "2013", open_source_projects_path(:app_dir => @app_dir, :language => @language, :created_at => "2013"), :class => "nav-more J_More show" %>
|
||||
<%= link_to "2012", open_source_projects_path(:app_dir => @app_dir, :language => @language, :created_at => "2012"), :class => "nav-more J_More show" %>
|
||||
<%= link_to "2011", open_source_projects_path(:app_dir => @app_dir, :language => @language, :created_at => "2011"), :class => "nav-more J_More show" %>
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
class ChangeDescriptionTypeToOpenSourceProject < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :open_source_projects, :description, :text
|
||||
end
|
||||
|
||||
def down
|
||||
raise ActiveRecord::IrreversibleMigration
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20140404031622) do
|
||||
ActiveRecord::Schema.define(:version => 20140411011700) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -679,15 +679,15 @@ ActiveRecord::Schema.define(:version => 20140404031622) do
|
|||
|
||||
create_table "open_source_projects", :force => true do |t|
|
||||
t.string "name"
|
||||
t.string "description", :default => ""
|
||||
t.text "description"
|
||||
t.integer "commit_count", :default => 0
|
||||
t.integer "code_line", :default => 0
|
||||
t.integer "users_count", :default => 0
|
||||
t.date "last_commit_time"
|
||||
t.string "url"
|
||||
t.date "date_collected"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "praise_tread_caches", :force => true do |t|
|
||||
|
|
Loading…
Reference in New Issue