Commit 0db284300677aa84710297e0c03b1122bb8d2db9

Added first pass of show ticket
Fixed user URL issue

Commit diff

app/controllers/projects_controller.rb

 
3434# @wiki = @project.wiki
3535 @title = "Summary"
3636 @critical_tickets = Ticket.find_critical(@project.id)
37 @tickets = Ticket.find_recent(@project.id)
3738 @url_suffix = ""
3839 #FIXME mainline / hardcoded?
3940 @repository = @project.repositories.find_by_name!("mainline")
toggle raw diff

app/controllers/tickets_controller.rb

 
1616 end
1717 end
1818
19 def show
20 @ticket = Ticket.find_by_slug(params[:id])
21 if @ticket
22 #@title, @url_suffix = Project.tab_settings(PRJ_TAB_TICKETS)
23 @title = "Ticket " + @ticket.slug
24 render :action => "ac_project_show"
25 else
26 flash[:error] = "Ticket not found."
27 redirect_to project_tickets_path(@project)
28 end
29 end
1930
2031end
toggle raw diff

app/models/ticket.rb

 
2424# find(:all, :conditions => ["milestone_id = '#{milestone_id}'"], :order => "due_date DESC")
2525# end
2626
27 def self.find_by_slug(slug)
28 find(:first, :conditions => ["slug = '#{slug}'"])
29 end
2730
2831 def self.find_critical (project_id)
2932 first_milestone = Milestone.find_current_milestone(project_id)
4040 WHERE milestones.id = #{first_milestone.id}
4141 AND milestones.project_id = #{project_id}
4242 AND tickets.status IN ('proposed', 'open')
43 AND tickets.priority = 'critical'") if first_milestone
43 AND tickets.priority = 'critical'
44 ORDER BY created_at DESC") if first_milestone
4445 end
46
47 def self.find_recent (project_id)
48 first_milestone = Milestone.find_current_milestone(project_id)
49 find_by_sql("SELECT tickets.slug,
50 tickets.summary,
51 users.fullname,
52 tickets.created_at
53 FROM tickets
54 JOIN users ON tickets.submitter_id = users.id
55 JOIN milestones ON tickets.milestone_id = milestones.id
56 WHERE milestones.id = #{first_milestone.id}
57 AND milestones.project_id = #{project_id}
58 AND tickets.status IN ('proposed', 'open')
59 AND NOT tickets.priority = 'critical'
60 ORDER BY created_at DESC
61 LIMIT 3") if first_milestone
62 end
63
4564
4665 def self.qconcat (filters, types, lstart)
4766 s = ""
toggle raw diff

app/models/wiki.rb

 
66
77 protected
88
9 #
109 def self.find_by_search(phrase)
1110 #find(:all, :conditions => ["status = '#{:published}' AND title like ?", "%" << phrase << "%"])
1211 end
1312
14 #
1513 def self.find_by_id(wiki_id)
1614 find(:first, :conditions => ["status = '#{:published}' AND id = '#{wiki_id}'"])
1715 end
1816
19 #
2017 def self.find_by_slug(slug)
2118 # removed status = '#{:published}', needs to be tested for when called
2219 find(:first, :conditions => ["slug = '#{slug}'"])
2320 end
2421
25 #
2622 def self.find_by_project(id)
2723 find(:all, :conditions => ["project_id = '#{id}'"], :order => "views DESC, created_at ASC")
2824 end
toggle raw diff

app/views/layouts/application.html.erb

 
2222 </div>
2323 <% end -%>
2424
25 <div id="system_message">
26 <p><strong>Notice:</strong> This site is unstable work-in-progress, source available on <a href='http://gitorious.org/projects/gitlab/'>gitorious.org</a>. Contact <a href='mailto:mtkd@prj2.com'>mtkd@prj2.com</a></p>
27 </div>
28
2925 <div id='header'>
3026 <div id='menu'>
3127 <ul class='item'>
toggle raw diff

app/views/members/_ac_right_actionbox_post_message.html.erb

 
11
2<table class='right_input'>
3<tr><td>
24<% form_for :message, :url => project_members_path(@project.slug), :method => :post, :html => {:name => 'postmessage', :id => 'input'} do |f| -%>
3
4 <h2>Post Message</h2>
5
6 <p>Add your current activity:</p>
7
8 <%= f.text_area(:activity, :rows => 4) -%>
5
6 <label>Message:</label>
7 <%= f.text_area(:activity, :rows => 2) -%>
98
109 <p>
1110 <a href="javascript:document.postmessage.submit();">Update</a>
1211 </p>
1312
1413<% end -%>
14</td></tr>
15</table>
toggle raw diff

app/views/projects/ac_show.html.erb

 
77<p><%= @project.summary %> <%= link_to "[more]", project_wiki_path(@project.slug, @project.wiki_slug), :class => "small" %></p>
88
99<% unless @critical_tickets.empty? %>
10<h4>Critical Tickets</h4>
10<h4>Recent Tickets</h4>
1111<hr />
1212<ul>
1313<% for ticket in @critical_tickets %>
1515 <%= link_to ticket.slug, project_ticket_path(@project.slug, ticket.slug) %> by <strong><%= ticket.fullname %></strong> <span class='small_grey'>(<%= time_ago_in_words(ticket.created_at) %> ago)</span><br />
1616 <span class='red'><%= ticket.summary %></span></li>
1717<% end %>
18<% for ticket in @tickets %>
19 <li>
20 <%= link_to ticket.slug, project_ticket_path(@project.slug, ticket.slug) %> by <strong><%= ticket.fullname %></strong> <span class='small_grey'>(<%= time_ago_in_words(ticket.created_at) %> ago)</span><br />
21 <%= ticket.summary %></li>
22<% end %>
1823</ul>
1924<%= link_to "[more]", project_tickets_path(@project.slug), :class => "small" %><br />
2025<% end %>
toggle raw diff

app/views/tickets/ac_project_index.html.erb

 
1717 <tr>
1818 <td><%= link_to ticket.slug, project_ticket_path(@project.slug, ticket.slug) %></td>
1919 <td><%= ticket.name %></td>
20 <td><%= "<span class='red'>" if ticket.priority == :critical %><%= ticket.summary %><%= "</span>" if ticket.priority == :critical %></td>
20 <td><div class='cut'><%= "<span class='red'>" if ticket.priority == :critical %><%= ticket.summary %><%= "</span>" if ticket.priority == :critical %></div></td>
2121 <td><%= ticket.fullname %></td>
2222 <td><%= ticket.formatted_ttype %></td>
2323 <td><%= ticket.status.to_s.capitalize %></td>
2828</table>
2929<br />
3030
31<%= div_formattedtext_close %>
32
3133<%= render :partial => "projects/ac_project_footer" %>
34
toggle raw diff

app/views/tickets/ac_project_show.html.erb

 
1<%= render :partial => "projects/ac_project_header", :locals => { :tab => PRJ_TAB_TICKETS, :project => @project, :pagetitle => @title } %>
2
3<%= div_formattedtext_open %>
4
5<ul>
6 <li>Summary: <%= @ticket.summary %></li>
7 <li>Detail: <%= @ticket.detail %></li>
8 <li>Type: <%= @ticket.ttype.to_s.capitalize %></li>
9 <li>Status: <%= @ticket.status.to_s.capitalize %></li>
10 <li>Impact: <%= @ticket.impact.to_s.capitalize %></li>
11 <li>Priority: <%= @ticket.priority.to_s.capitalize %></li>
12 <li>Audience: <%= @ticket.audience.to_s.capitalize %></li>
13 <li>CC: <%= @ticket.cc %></li>
14 <li>Slug: <%= @ticket.slug %></li>
15 <li>Open Date: <%= @ticket.open_date %></li>
16 <li>Close Date: <%= @ticket.close_date %></li>
17 <li>Views: <%= @ticket.views.to_s %></li>
18 <li>Milestone: <%= @ticket.milestone_id %></li>
19 <li>Assignee: <%= @ticket.assignee_id %></li>
20 <li>Submitter: <%= @ticket.submitter_id %></li>
21</ul>
22
23
24
25<%= div_formattedtext_close %>
26
27<%= render :partial => "projects/ac_project_footer" %>
toggle raw diff

config/initializers/gitlab_constants.rb

 
4040PRJ_TAB_ARTICLES_EDIT = 2
4141PRJ_TAB_ARTICLES_LIST = 3
4242
43PRJ_TAB_TICKETS_NEW = 1
44PRJ_TAB_TICKETS_EDIT = 2
45PRJ_TAB_TICKETS_LIST = 3
46
4347# 'Subtabs' for projects/documenation
4448PRJ_TAB_LOG_NEW = 1
4549PRJ_TAB_LOG_EDIT = 2
5757PRJ_TAB_GIT_MERGEREQUESTS = 5
5858
5959#
60PRF_TAB_SUMMARY = 1
61PRF_TAB_ARTICLES = 2
62PRF_TAB_TICKETS = 3
63PRF_TAB_WIKIS = 4
64PRF_TAB_FORUM = 5
65PRF_TAB_TIMELINE = 6
66PRF_TAB_CONFIG = 7
60#PRF_TAB_SUMMARY = 1
61#PRF_TAB_ARTICLES = 2
62#PRF_TAB_TICKETS = 3
63#PRF_TAB_WIKIS = 4
64#PRF_TAB_FORUM = 5
65#PRF_TAB_TIMELINE = 6
66#PRF_TAB_CONFIG = 7
6767
6868#
6969ART_LIST_USER = 1
toggle raw diff

public/stylesheets/base.css

 
2727div.hr hr {display: none;}
2828
2929/* Page holds all sections - header, breadcrumb, content, footer */
30#page { text-align: left; margin: 0 auto; min-width: 960px; } /* holds entire page including header */
30#page { text-align: left; margin: 0 auto; min-width: 1010px; } /* holds entire page including header */
3131
3232/* Header holds the top menu and logo */
3333#header { display: block; background: #ededed; border-bottom: 1px solid #aaa; padding: 0px; margin: 0px; width: 100%; height: 29px; }
132132.formattedtext .screenshot { display: block; }
133133.formattedtext .screenshot img { border: 1px solid #aaa; display: inline; margin: 0px 10px 0px 0px; }
134134
135.formattedtext .red { color: #ff0000; background-color: #ffe0e0; padding-left: 2px; padding-right: 2px; font-weight: 600; }
135.formattedtext .red { color: #ff0000; background-color: #ffe0e0; padding: 1px 3px 1px 3px; font-weight: 600; }
136136.formattedtext .small_grey { color: grey; font-size: 0.8em; }
137137.formattedtext .small { font-size: 0.8em; }
138138
197197table.right_default_table .count { font-size: 0.9em; }
198198table.right_default_table .function { margin: 10px 0px 0px 0px; background-color: #fff; text-decoration: none; padding: 4px 8px 4px 8px; border: 1px solid #dde; font-weight: 800; }
199199
200table.right_input { border: 0px; width: 100%; margin: 0px 0px 20px 0px; border-spacing: 0px; }
201
200202/*
201203table.releasedownload { margin-top: 10px; margin-bottom: 20px; background-color: #fff; border-spacing: 0px; }
202204table.releasedownload td { vertical-align: top; color: #000; font-size: 1.0em; border: 0px; }
218218table.public { margin: 0px; background-color: #ddd; border-spacing: 1px; width: 100% }
219219table.public th { text-align: center; background-color: #eee; color: #000; font-size: 1.0em; padding: 4px; border: 1px solid #fff; font-weight: normal; }
220220table.public td { vertical-align: top; background-color: #fff; color: #000; font-size: 1.0em; padding: 4px 6px 4px 6px; border: 0px; }
221div.cut { margin: 0; padding: 0; overflow: hidden; white-space: nowrap; }
221222
222223#todo { background-image: url('../images/gitlab/dev/todo.png'); padding: 0px 20px 0px 20px; margin: 10px 0px 10px 0px; border: 1px solid #000; }
223224/* Swap with line above to hide todo divs
233233#tabmenu a:hover { color: #fff; background: #e52; }
234234/*#tabmenu a.active:hover { background: #ABAD85; color: #DEDECF; }*/
235235
236/* the 20px bottom margin is needed for when it's used in the right column */
237#input { font-family: Monospace; border: 2px solid #dde; background-color: #eef; margin: 0px 0px 20px 0px; padding: 20px; }
236#input { font-family: Monospace; border: 2px solid #dde; background-color: #eef; margin: 0px; padding: 10px; }
238237#input h2 { font-size: 20px; color: #446; padding: 0px 0px; margin: 0px; }
239#input p { font-size: 16px; color: #446; padding: 0px; margin: 20px 0px 20px 0px; }
238#input p { font-size: 16px; color: #446; padding: 0px; margin: 20px 0px 10px 0px; }
240239#input label { font-size: 16px; color: #446; padding: 0px; margin: 0px 0px 4px 0px; }
241240#input input { font-family: Monospace; color: #333; border: 1px solid #dde; background-color: #fff; padding: 4px 6px 4px 6px; font-size: 16px; height: 20px; margin: 0px; }
242241#input select { font-family: Monospace; color: #333; border: 1px solid #dde; background-color: #fff; padding: 4px 2px 4px 2px; font-size: 16px; height: 30px; margin: 0px; }
243#input textarea { font-family: Monospace; color: #333; border: 1px solid #dde; background-color: #fff; padding: 4px 6px 4px 6px; font-size: 16px; width: 100%; margin: 0px; padding: 0px; }
242/*FIXME when I set l/r padding the Post Message box runs over right border */
243#input textarea { font-family: Monospace; color: #333; border: 1px solid #dde; background-color: #fff; padding: 4px 0px 4px 0px; font-size: 16px; margin: 0px 0px 0px 0px; width: 100%; }
244244#input p.error { font-size: 14px; color: red; border: 1px solid red; background-color: #ccc; }
245245#input p.success { font-size: 14px; color: green; border: 1px solid green; background-color: #ccc; }
246246table.entry { }
278278
279279
280280.commit_item { margin: 10px 0px 30px 0px; }
281.commit_message { margin-top: 10px; width: 60%; color: #444; background-color: #f0f0f0; padding: 10px 10px 0px 10px; border: 1px solid #ddd; }
281.commit_message { margin-top: 10px; width: 60%; color: #444; background-color: #f0f0f0; padding: 6px 6px 0px 6px; border: 1px solid #ddd; }
282282.commit_message p { font-size: 0.9em; line-height: 1.2em; font-family: Monaco, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; padding: 0px; margin: 0px 0px 10px 0px; }
283283
284284code, pre, tt { font-size: 0.9em; font-family: Monaco, "Bitstream Vera Sans Mono", "Courier New", Courier, monospace; }
toggle raw diff

test/fixtures/messages.yml

 
55
66<% fixtures :users, :projects %>
77
85:
9 id: 5
10 activity: "Public viewers of the messages tab will see a list of all recent messages, chronologically."
11 audience: :public
12 project_id: <%= projects(:gitlab) %>
13 user_id: <%= users(:mtkd) %>
14 created_at: "2008-05-03 18:07:00"
15
8164:
917 id: 4
10 activity: "Test message 4"
18 activity: "The messages tab, if you are logged in, shows your recent messages, and those of the rest of the team - grouped by person."
1119 audience: :public
1220 project_id: <%= projects(:gitlab) %>
1321 user_id: <%= users(:mtkd) %>
2323
24243:
2525 id: 3
26 activity: "Test message 3"
26 activity: "The blog is mainly aimed at larger posts - aimed at a public audience."
2727 audience: :public
2828 project_id: <%= projects(:gitlab) %>
2929 user_id: <%= users(:mtkd) %>
3131
32322:
3333 id: 2
34 activity: "Test message 2"
34 activity: "Messages are just tweats so you can document, briefly, what you are working on."
3535 audience: :public
3636 project_id: <%= projects(:gitlab) %>
3737 user_id: <%= users(:mtkd) %>
3939
40401:
4141 id: 1
42 activity: "Test message 1"
42 activity: "First message."
4343 audience: :public
4444 project_id: <%= projects(:gitlab) %>
4545 user_id: <%= users(:mtkd) %>
toggle raw diff

test/fixtures/tickets.yml

 
2727#
2828# Allow log links to drill in to detailed info on event or change
2929#
30
30# Add a code review system - http://review-board.org/
31#
32#
3133
3234#
3335# Possible filtering
toggle raw diff

test/fixtures/users.yml

 
1414 activated_at: <%= 20.days.ago.to_s :db %>
1515 ssh_key_id: 1
1616 fullname: "mtkd"
17 url: "www.prj2.com"
17 url: "http://prj2.com"
1818 #
1919 slug: "mtkd"
2020
toggle raw diff

test/fixtures/wiki_pages/_about.txt

 
11
22<p>Gitlab.org is a git repo browser (forked from Gitorious) with added collaborative features - for public and private projects.</p>
3</p>This site is unstable work-in-progress, source available from <a href='http://gitorious.org/projects/gitlab/'>gitorious.org</a>. Contact <a href='mailto:mtkd@prj2.com'>mtkd@prj2.com</a>.</p>
34
45
56
toggle raw diff

test/fixtures/wiki_pages/_git_crib_sheet.txt

 
108108
109109
110110
111Creating an archived version
111112
113git tab v0.1
114git archive --format=zip
112115
113116
114117
toggle raw diff