Revision 912:5e80956cc792 app/views/journals

View differences:

app/views/journals/_notes_form.html.erb
1
<% form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %>
2
    <%= label_tag "notes", l(:description_notes), :class => "hidden-for-sighted" %>
3
    <%= text_area_tag :notes, @journal.notes,
4
          :id => "journal_#{@journal.id}_notes",
5
          :class => 'wiki-edit',
6
          :rows => (@journal.notes.blank? ? 10 : [[10, @journal.notes.length / 50].max, 100].min) %>
7
    <%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %>
8
    <p><%= submit_tag l(:button_save) %>
9
    <%= link_to_remote l(:label_preview),
10
                       { :url => preview_issue_path(:project_id => @project, :id => @journal.issue),
11
                         :method => 'post',
12
                         :update => "journal_#{@journal.id}_preview",
13
                         :with => "Form.serialize('journal-#{@journal.id}-form')",
14
                         :complete => "Element.scrollTo('journal_#{@journal.id}_preview')"
15
                       }, :accesskey => accesskey(:preview) %>
16
    |
17
    <%= link_to l(:button_cancel), '#', :onclick => "Element.remove('journal-#{@journal.id}-form'); " +
18
                                                    "Element.show('journal-#{@journal.id}-notes'); return false;" %></p>
19

  
20
    <div id="journal_<%= @journal.id %>_preview" class="wiki"></div>
21
<% end %>
22
<%= wikitoolbar_for "journal_#{@journal.id}_notes" %>
app/views/journals/_notes_form.rhtml
1
<% form_remote_tag(:url => {}, :html => { :id => "journal-#{@journal.id}-form" }) do %>
2
    <%= text_area_tag :notes, @journal.notes,
3
          :id => "journal_#{@journal.id}_notes",
4
          :class => 'wiki-edit', 
5
          :rows => (@journal.notes.blank? ? 10 : [[10, @journal.notes.length / 50].max, 100].min) %>
6
    <%= call_hook(:view_journals_notes_form_after_notes, { :journal => @journal}) %>
7
    <p><%= submit_tag l(:button_save) %>
8
    <%= link_to_remote l(:label_preview), 
9
                       { :url => preview_issue_path(:project_id => @project, :id => @journal.issue),
10
                         :method => 'post',
11
                         :update => "journal_#{@journal.id}_preview",
12
                         :with => "Form.serialize('journal-#{@journal.id}-form')",
13
                         :complete => "Element.scrollTo('journal_#{@journal.id}_preview')"
14
                       }, :accesskey => accesskey(:preview) %>
15
    |
16
    <%= link_to l(:button_cancel), '#', :onclick => "Element.remove('journal-#{@journal.id}-form'); " +
17
                                                    "Element.show('journal-#{@journal.id}-notes'); return false;" %></p>
18

  
19
    <div id="journal_<%= @journal.id %>_preview" class="wiki"></div>
20
<% end %>
21
<%= wikitoolbar_for "journal_#{@journal.id}_notes" %>
app/views/journals/index.builder
1
xml.instruct!
2
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
3
  xml.title   @title
4
  xml.link    "rel" => "self", "href" => url_for(:format => 'atom', :key => User.current.rss_key, :only_path => false)
5
  xml.link    "rel" => "alternate", "href" => home_url(:only_path => false)
6
  xml.id      url_for(:controller => 'welcome', :only_path => false)
7
  xml.updated((@journals.first ? @journals.first.event_datetime : Time.now).xmlschema)
8
  xml.author  { xml.name "#{Setting.app_title}" }
9
  @journals.each do |change|
10
    issue = change.issue
11
    xml.entry do
12
      xml.title   "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}"
13
      xml.link    "rel" => "alternate", "href" => url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false)
14
      xml.id      url_for(:controller => 'issues' , :action => 'show', :id => issue, :journal_id => change, :only_path => false)
15
      xml.updated change.created_on.xmlschema
16
      xml.author do
17
        xml.name change.user.name
18
        xml.email(change.user.mail) if change.user.is_a?(User) && !change.user.mail.blank? && !change.user.pref.hide_mail
19
      end
20
      xml.content "type" => "html" do
21
        xml.text! '<ul>'
22
        change.details.each do |detail|
23
          xml.text! '<li>' + show_detail(detail, false) + '</li>'
24
        end
25
        xml.text! '</ul>'
26
        xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
27
      end
28
    end
29
  end
30
end
app/views/journals/index.rxml
1
xml.instruct!
2
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
3
  xml.title   @title
4
  xml.link    "rel" => "self", "href" => url_for(:format => 'atom', :key => User.current.rss_key, :only_path => false)
5
  xml.link    "rel" => "alternate", "href" => home_url(:only_path => false)
6
  xml.id      url_for(:controller => 'welcome', :only_path => false)
7
  xml.updated((@journals.first ? @journals.first.event_datetime : Time.now).xmlschema)
8
  xml.author  { xml.name "#{Setting.app_title}" }
9
  @journals.each do |change|
10
    issue = change.issue
11
    xml.entry do
12
      xml.title   "#{issue.project.name} - #{issue.tracker.name} ##{issue.id}: #{issue.subject}"
13
      xml.link    "rel" => "alternate", "href" => url_for(:controller => 'issues' , :action => 'show', :id => issue, :only_path => false)
14
      xml.id      url_for(:controller => 'issues' , :action => 'show', :id => issue, :journal_id => change, :only_path => false)
15
      xml.updated change.created_on.xmlschema
16
      xml.author do
17
        xml.name change.user.name
18
        xml.email(change.user.mail) if change.user.is_a?(User) && !change.user.mail.blank? && !change.user.pref.hide_mail
19
      end
20
      xml.content "type" => "html" do
21
        xml.text! '<ul>'
22
        change.details.each do |detail|
23
          xml.text! '<li>' + show_detail(detail, false) + '</li>'
24
        end
25
        xml.text! '</ul>'
26
        xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
27
      end
28
    end
29
  end
30
end

Also available in: Unified diff