Commit 92aae2749d961e8d7052f6471db81227f3d19691
- Date: Thu May 01 17:38:57 +0000 2008
- Committer: mtkd (mtkd@prj2.com)
- Author: mtkd (mtkd@prj2.com)
- Commit SHA1: 92aae2749d961e8d7052f6471db81227f3d19691
- Tree SHA1: 4c7979d13a70133990584c90c92c36f062dd1ec5
- app/models/project.rb 5 +++++
- app/controllers/articles_controller.rb 19 -------++++++++++++
- config/routes.rb 2 -+
- app/views/site/ac_index.html.erb 1 +
- app/helpers/projects_helper.rb 18 ---+++++++++++++++
- test/fixtures/wiki_pages/_gitlab_credits.txt 2 -+
- app/helpers/articles_helper.rb 2 -+
Commit diff
- Diff rendering mode:
- inline
- side by side
app/controllers/articles_controller.rb
|   | ||
| 101 | 101 | |
| 102 | 102 | # Show all articles for a project |
| 103 | 103 | def find_by_project |
| 104 | ||
| 105 | ||
| 106 | ||
| 107 | ||
| 108 | ||
| 104 | if @project | |
| 105 | @articles = Article.find_by_project(@project.id, current_user) | |
| 106 | if @articles.size > 0 | |
| 107 | @title = @project.title << " Articles" | |
| 108 | @show_archive_breadcrumb = true | |
| 109 | render :action => "ac_index" | |
| 110 | else | |
| 111 | flash[:error] = "No articles found for project '" << @project.title << "'." | |
| 112 | redirect_to project_path(@project) | |
| 113 | end | |
| 109 | 114 | else |
| 110 | ||
| 111 | ||
| 115 | flash[:error] = "Project not found." | |
| 116 | redirect_to root_path | |
| 112 | 117 | end |
| 113 | 118 | end |
| 114 | 119 | |
| toggle raw diff | ||
app/helpers/articles_helper.rb
|   | ||
| 153 | 153 | out << %Q{#{link_to("Other", article_sitename_path)}} |
| 154 | 154 | else |
| 155 | 155 | #FIXME had to frig this until project routes merged |
| 156 | ||
| 156 | out << %Q{#{link_to(p, "/archives/project/" << u, :class => "blacklink")}} | |
| 157 | 157 | end |
| 158 | 158 | out << %Q{</th>} |
| 159 | 159 | # numeric td |
| toggle raw diff | ||
app/helpers/projects_helper.rb
|   | ||
| 37 | 37 | end |
| 38 | 38 | out |
| 39 | 39 | end |
| 40 | ||
| 41 | def render_right_popular_projects | |
| 42 | out = "" | |
| 43 | projects = Project.find_popular_projects(current_user) | |
| 44 | if projects.size > 0 | |
| 45 | out << "<table class='right_default_table'>" | |
| 46 | out << "<tr><th>Popular Projects</th></tr>" | |
| 47 | for project in projects | |
| 48 | #TODO only display admin/modify members | |
| 49 | out << %Q{<tr><td>#{link_to(project.title, project_path(project))} </span></small></td></tr>} | |
| 50 | end | |
| 51 | out << "</table>" | |
| 52 | end | |
| 53 | out | |
| 54 | end | |
| 40 | 55 | |
| 41 | 56 | def project_tab (active_tab, tab) |
| 42 | 57 | title, suffix = Project.tab_settings(tab) |
| … | … | |
| 148 | 148 | end |
| 149 | 149 | out |
| 150 | 150 | end |
| 151 | ||
| 152 | 151 | |
| 153 | 152 | def render_project_roadmap |
| 154 | 153 | #get all milestones for a project |
| … | … | |
| 176 | 176 | out |
| 177 | 177 | end |
| 178 | 178 | |
| 179 | ||
| 180 | ||
| 181 | 179 | def format_life_cycle (ls) |
| 182 | 180 | case ls |
| 183 | 181 | when :pre_alpha |
| toggle raw diff | ||
app/models/project.rb
|   | ||
| 175 | 175 | find(:all, :conditions => ["status = '#{:active}' AND ( audience = '#{:public}' OR id IN (" << projects_allowed << ") )"]) |
| 176 | 176 | end |
| 177 | 177 | |
| 178 | def self.find_popular_projects (curruser) | |
| 179 | projects_allowed = Project.list_for_user(curruser) | |
| 180 | find(:all, :conditions => ["status = '#{:active}' AND ( audience = '#{:public}' OR id IN (" << projects_allowed << ") )"], :limit => 10, :order => "views DESC") | |
| 181 | end | |
| 182 | ||
| 178 | 183 | # returns all public projects (no private regardless of allowed) |
| 179 | 184 | def self.find_all_active_public_projects (curruser) |
| 180 | 185 | projects_allowed = Project.list_for_user(curruser) |
| toggle raw diff | ||
app/views/site/ac_index.html.erb
|   | ||
| 6 | 6 | |
| 7 | 7 | <%= div_rightcolumn_open %> |
| 8 | 8 | <%= actionbox_basic %> |
| 9 | <%= render_right_popular_projects %> | |
| 9 | 10 | <%= render_right_article_project_grid %> |
| 10 | 11 | <%= div_rightcolumn_close %> |
| 11 | 12 | |
| toggle raw diff | ||
config/routes.rb
|   | ||
| 79 | 79 | #FIXME this can probably be converted in to a map.resources :archives, has_many => [categories, types, projects] |
| 80 | 80 | map.article_category 'archives/category/:category', :controller => 'articles', :action => 'find_by_category' |
| 81 | 81 | map.article_type 'archives/type/:article_type', :controller => 'articles', :action => 'find_by_type' |
| 82 | ||
| 82 | map.article_project 'archives/project/:project_id', :controller => 'articles', :action => 'find_by_project' | |
| 83 | 83 | map.article_user 'archives/user/:user_slug', :controller => 'articles', :action => 'find_by_user' |
| 84 | 84 | #although it could more issues with the security stuff |
| 85 | 85 | #FIXME these need changing now |
| toggle raw diff | ||
test/fixtures/wiki_pages/_gitlab_credits.txt
|   | ||
| 1 | 1 | Biggest credit is to Johan Sørensen of [Gitorious](http://www.gitorious.org), which |
| 2 | ||
| 2 | this project is a fork of and Tom Preston-Werner who developed [Grit](http://grit.rubyforge.org) (the interface to [Git](http://git.or.cz)). | |
| 3 | 3 | |
| 4 | 4 | The credit list includes sources of code either directly used in the project, or read to help figure something out: |
| 5 | 5 | |
| toggle raw diff | ||
