Revision 1007:3e52bc15dd67 app
| app/controllers/projects_controller.rb | ||
|---|---|---|
| 20 | 20 |
menu_item :roadmap, :only => :roadmap |
| 21 | 21 |
menu_item :settings, :only => :settings |
| 22 | 22 |
|
| 23 |
before_filter :find_project, :except => [ :index, :list, :new, :create, :copy ] |
|
| 24 |
before_filter :authorize, :except => [ :index, :list, :new, :create, :copy, :archive, :unarchive, :destroy] |
|
| 23 |
before_filter :find_project, :except => [ :index, :list, :browse, :new, :create, :copy ]
|
|
| 24 |
before_filter :authorize, :except => [ :index, :list, :browse, :new, :create, :copy, :archive, :unarchive, :destroy]
|
|
| 25 | 25 |
before_filter :authorize_global, :only => [:new, :create] |
| 26 | 26 |
before_filter :require_admin, :only => [ :copy, :archive, :unarchive, :destroy ] |
| 27 | 27 |
accept_rss_auth :index |
| ... | ... | |
| 76 | 76 |
end |
| 77 | 77 |
end |
| 78 | 78 |
|
| 79 |
# A different view of projects using browse boxes |
|
| 80 |
def browse |
|
| 81 |
respond_to do |format| |
|
| 82 |
format.html {
|
|
| 83 |
@projects = Project.visible |
|
| 84 |
render :template => 'projects/browse.html.erb', :layout => !request.xhr? |
|
| 85 |
} |
|
| 86 |
end |
|
| 87 |
end |
|
| 88 |
|
|
| 79 | 89 |
def new |
| 80 | 90 |
@issue_custom_fields = IssueCustomField.find(:all, :order => "#{CustomField.table_name}.position")
|
| 81 | 91 |
@trackers = Tracker.all |
| app/controllers/welcome_controller.rb | ||
|---|---|---|
| 25 | 25 |
@site_project = Project.find_by_identifier "soundsoftware-site" |
| 26 | 26 |
@site_news = [] |
| 27 | 27 |
@site_news = News.latest_for @site_project if @site_project |
| 28 |
@projects = Project.latest User.current |
|
| 29 | 28 |
|
| 30 | 29 |
# tests if user is logged in to generate the tips of the day list |
| 31 | 30 |
if User.current.logged? |
| app/views/projects/_latest.html.erb | ||
|---|---|---|
| 1 | 1 |
<ul> |
| 2 |
<% for project in @projects %> |
|
| 3 |
<% @project = project %> |
|
| 2 |
<% for project in Project.latest(User.current) %> |
|
| 4 | 3 |
<li class="latest"> |
| 5 | 4 |
<span class="title"> |
| 6 | 5 |
<% if !project.root? %> |
| ... | ... | |
| 17 | 16 |
<%= render_project_short_description project %> |
| 18 | 17 |
</li> |
| 19 | 18 |
<% end %> |
| 20 |
<% @project = nil %> |
|
| 21 | 19 |
</ul> |
| app/views/projects/browse.html.erb | ||
|---|---|---|
| 1 |
|
|
| 2 |
<h2><%= l(:label_browse) %></h2> |
|
| 3 |
|
|
| 4 |
<div class="splitcontentleft"> |
|
| 5 |
<div class="projects box"> |
|
| 6 |
<h3><%=l(:label_project_latest)%></h3> |
|
| 7 |
<%= render :partial => 'projects/latest' %> |
|
| 8 |
<%= link_to l(:label_projects_more), :controller => 'projects' %> |
|
| 9 |
</div> |
|
| 10 |
</div> |
|
| 11 |
<div class="splitcontentleft"> |
|
| 12 |
<div class="projects box"> |
|
| 13 |
<h3><%=l(:label_project_tags_all)%></h3> |
|
| 14 |
<%= render :partial => 'projects/tagcloud' %> |
|
| 15 |
<%= link_to l(:label_projects_more), :controller => 'projects' %> |
|
| 16 |
</div> |
|
| 17 |
<div class="projects box"> |
|
| 18 |
<h3><%=l(:label_projects_busy)%></h3> |
|
| 19 |
<%= render :partial => 'activities/busy' %> |
|
| 20 |
<%= link_to l(:label_projects_more), :controller => 'projects' %> |
|
| 21 |
</div> |
|
| 22 |
</div> |
|
| app/views/welcome/index.html.erb | ||
|---|---|---|
| 20 | 20 |
<%= link_to l(:label_news_more), { :controller => 'projects', :action => @site_project.identifier, :id => 'news' } %>
|
| 21 | 21 |
</div> |
| 22 | 22 |
<% end %> |
| 23 |
<% if @projects.any? %> |
|
| 24 | 23 |
<div class="projects box"> |
| 25 | 24 |
<h3><%=l(:label_project_latest)%></h3> |
| 26 | 25 |
<%= render :partial => 'projects/latest' %> |
| ... | ... | |
| 36 | 35 |
<%= render :partial => 'activities/busy' %> |
| 37 | 36 |
<%= link_to l(:label_projects_more), :controller => 'projects' %> |
| 38 | 37 |
</div> |
| 39 |
<% end %> |
|
| 40 | 38 |
<%= call_hook(:view_welcome_index_right, :projects => @projects) %> |
| 41 | 39 |
</div> |
| 42 | 40 |
|
Also available in: Unified diff