Skip to content

Commit

Permalink
put data into issue page, and add some bare style
Browse files Browse the repository at this point in the history
  • Loading branch information
hlb committed Jan 18, 2010
1 parent 59edd77 commit d024431
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 6 deletions.
5 changes: 5 additions & 0 deletions app/controllers/iphone/issues_controller.rb
Expand Up @@ -4,12 +4,17 @@ class Iphone::IssuesController < ApplicationController

before_filter :find_issue, :only => [:show]
before_filter :find_project
helper :issues
helper :journals

def index
@issues = @project.issues.all(:conditions => [ "tracker_id = ?", params[:tracker_id] ])
end

def show
@journals = @issue.journals.find(:all, :include => [:user, :details], :order => "#{Journal.table_name}.created_on ASC")
@journals.each_with_index {|j,i| j.indice = i+1}
@journals.reverse! if User.current.wants_comments_in_reverse_order?
end

private
Expand Down
2 changes: 1 addition & 1 deletion app/views/iphone/index.html.erb
Expand Up @@ -25,7 +25,7 @@
<% if @assigned_issues.any? %>
<% for issue in @assigned_issues %>
<li>
<%= link_to "#{h(truncate(issue.subject, :length => 60))} <p>#{h(issue.project)}, #{h(issue.id)}, #{h(issue.tracker)} (#{h(issue.status)})</p>", :controller => 'iphone/issues', :action => 'show', :id => issue %>
<%= link_to "#{h(truncate(issue.subject, :length => 60))} <p>#{h(issue.project)}, ##{h(issue.id)}, #{h(issue.tracker)}(#{h(issue.status)})</p>", :controller => 'iphone/issues', :action => 'show', :id => issue %>
</li>
<% end %>
<% end %>
Expand Down
11 changes: 11 additions & 0 deletions app/views/iphone/issues/_history.html.erb
@@ -0,0 +1,11 @@
<% for journal in journals %>
<div id="change-<%= journal.id %>" class="journal">
<h4><%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %></h4>
<ul>
<% for detail in journal.details %>
<li><%= show_detail(detail) %></li>
<% end %>
</ul>
<%= render_notes(journal) unless journal.notes.blank? %>
</div>
<% end %>
11 changes: 11 additions & 0 deletions app/views/iphone/issues/_relations.html.erb
@@ -0,0 +1,11 @@
<p><strong><%=l(:label_related_issues)%></strong></p>

<% if @issue.relations.any? %>
<% @issue.relations.select {|r| r.other_issue(@issue).visible? }.each do |relation| %>
<p>
<%= l(relation.label_for(@issue)) %> <%= "(#{l('datetime.distance_in_words.x_days', :count => relation.delay)})" if relation.delay && relation.delay != 0 %>
<%= h(relation.other_issue(@issue).project) + ' - ' if Setting.cross_project_issue_relations? %>
<%= link_to_issue relation.other_issue(@issue) %>
</p>
<% end %>
<% end %>
40 changes: 35 additions & 5 deletions app/views/iphone/issues/show.html.erb
@@ -1,16 +1,46 @@
<div id="<%= dom_id(@issue) %>">
<div class="toolbar">
<h1><%=h @issue.subject %></h1>
<h1>#<%= @issue.id %> <%= h(@issue.tracker) %>(<%= @issue.status.name %>)</h1>
<% if !User.current.logged? %>
<a class="button slideup" id="infoButton" href="#login">Login</a>
<% end %>
<a href="#" class="back">Back</a>
</div>

<div class="info">
Created By: <%=h @issue.author.name %>
Status: <%= @issue.status.name %>
<p><%=h @issue.description %></p>
<p class="author">
<%= authoring @issue.created_on, @issue.author %>.
</p>

<p>
<% if @issue.created_on != @issue.updated_on %>
<%= l(:label_updated_time, time_tag(@issue.updated_on)) %>.
<% end %>
<%=l(:field_status)%>: <%= @issue.status.name %>
</p>
</div>

<div class="<%= @issue.css_classes %> details">
<h3 id="issue-subject"><%=h @issue.subject %></h3>
<p><strong><%=l(:field_description)%></strong></p>
<div class="wiki">
<%= textilizable @issue, :description, :attachments => @issue.attachments %>
</div>

<% if authorize_for('issue_relations', 'new') || @issue.relations.any? %>
<hr />
<div id="relations">
<%= render :partial => 'relations' %>
</div>
<% end %>
<% if @journals.any? %>
<div id="history">
<h3><%=l(:label_history)%></h3>
<%= render :partial => 'history', :locals => { :journals => @journals } %>
</div>
<% end %>

</div>

<ul class="individual">
Expand Down
34 changes: 34 additions & 0 deletions assets/stylesheets/iphone.css
Expand Up @@ -5,3 +5,37 @@
#jqt ul li small {
margin-top: -22px;
}

.details {
padding: 10px;
background: #fff;
color: #414141;
line-height: 1.2;
}

.details h3 {
font-size: 18px;
border-bottom: 1px solid #ccc;
margin-bottom: 10px;
}

.details p {
margin: 1em 0;
}

#jqt .journal ul {
border: none;
}

#jqt .journal ul li {
background: none;
color: #666;
font-size: 13px;
border: none;
padding: 0;
}

#jqt .journal ul li a {
display: inline;
color: #369;
}

0 comments on commit d024431

Please sign in to comment.