##// END OF EJS Templates
Automatically focus several form fields....
Jean-Philippe Lang -
r2293:4972084345de
parent child
Show More
@@ -1,62 +1,62
1 1 <%= breadcrumb link_to(l(:label_board_plural), {:controller => 'boards', :action => 'index', :project_id => @project}) %>
2 2
3 3 <div class="contextual">
4 4 <%= link_to_if_authorized l(:label_message_new),
5 5 {:controller => 'messages', :action => 'new', :board_id => @board},
6 6 :class => 'icon icon-add',
7 :onclick => 'Element.show("add-message"); return false;' %>
7 :onclick => 'Element.show("add-message"); Form.Element.focus("message_subject"); return false;' %>
8 8 <%= watcher_tag(@board, User.current) %>
9 9 </div>
10 10
11 11 <div id="add-message" style="display:none;">
12 12 <h2><%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %> &#187; <%= l(:label_message_new) %></h2>
13 13 <% form_for :message, @message, :url => {:controller => 'messages', :action => 'new', :board_id => @board}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
14 14 <%= render :partial => 'messages/form', :locals => {:f => f} %>
15 15 <p><%= submit_tag l(:button_create) %>
16 16 <%= link_to_remote l(:label_preview),
17 17 { :url => { :controller => 'messages', :action => 'preview', :board_id => @board },
18 18 :method => 'post',
19 19 :update => 'preview',
20 20 :with => "Form.serialize('message-form')",
21 21 :complete => "Element.scrollTo('preview')"
22 22 }, :accesskey => accesskey(:preview) %> |
23 23 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-message")' %></p>
24 24 <% end %>
25 25 <div id="preview" class="wiki"></div>
26 26 </div>
27 27
28 28 <h2><%=h @board.name %></h2>
29 29 <p class="subtitle"><%=h @board.description %></p>
30 30
31 31 <% if @topics.any? %>
32 32 <table class="list messages">
33 33 <thead><tr>
34 34 <th><%= l(:field_subject) %></th>
35 35 <th><%= l(:field_author) %></th>
36 36 <%= sort_header_tag('created_on', :caption => l(:field_created_on)) %>
37 37 <%= sort_header_tag('replies', :caption => l(:label_reply_plural)) %>
38 38 <%= sort_header_tag('updated_on', :caption => l(:label_message_last)) %>
39 39 </tr></thead>
40 40 <tbody>
41 41 <% @topics.each do |topic| %>
42 42 <tr class="message <%= cycle 'odd', 'even' %> <%= topic.sticky? ? 'sticky' : '' %> <%= topic.locked? ? 'locked' : '' %>">
43 43 <td class="subject"><%= link_to h(topic.subject), { :controller => 'messages', :action => 'show', :board_id => @board, :id => topic }, :class => 'icon' %></td>
44 44 <td class="author" align="center"><%= topic.author %></td>
45 45 <td class="created_on" align="center"><%= format_time(topic.created_on) %></td>
46 46 <td class="replies" align="center"><%= topic.replies_count %></td>
47 47 <td class="last_message">
48 48 <% if topic.last_reply %>
49 49 <%= authoring topic.last_reply.created_on, topic.last_reply.author %><br />
50 50 <%= link_to_message topic.last_reply %>
51 51 <% end %>
52 52 </td>
53 53 </tr>
54 54 <% end %>
55 55 </tbody>
56 56 </table>
57 57 <p class="pagination"><%= pagination_links_full @topic_pages, @topic_count %></p>
58 58 <% else %>
59 59 <p class="nodata"><%= l(:label_no_data) %></p>
60 60 <% end %>
61 61
62 62 <% html_title h(@board.name) %>
@@ -1,39 +1,39
1 1 <div class="contextual">
2 2 <%= link_to_if_authorized l(:label_document_new),
3 3 {:controller => 'documents', :action => 'new', :project_id => @project},
4 4 :class => 'icon icon-add',
5 :onclick => 'Element.show("add-document"); return false;' %>
5 :onclick => 'Element.show("add-document"); Form.Element.focus("document_title"); return false;' %>
6 6 </div>
7 7
8 8 <div id="add-document" style="display:none;">
9 9 <h2><%=l(:label_document_new)%></h2>
10 10 <% form_tag({:controller => 'documents', :action => 'new', :project_id => @project}, :class => "tabular", :multipart => true) do %>
11 11 <%= render :partial => 'documents/form' %>
12 12 <div class="box">
13 13 <p><label><%=l(:label_attachment_plural)%></label><%= render :partial => 'attachments/form' %></p>
14 14 </div>
15 15 <%= submit_tag l(:button_create) %>
16 16 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-document")' %>
17 17 <% end %>
18 18 </div>
19 19
20 20 <h2><%=l(:label_document_plural)%></h2>
21 21
22 22 <% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
23 23
24 24 <% @grouped.keys.sort.each do |group| %>
25 25 <h3><%= group %></h3>
26 26 <%= render :partial => 'documents/document', :collection => @grouped[group] %>
27 27 <% end %>
28 28
29 29 <% content_for :sidebar do %>
30 30 <h3><%= l(:label_sort_by, '') %></h3>
31 31 <% form_tag({}, :method => :get) do %>
32 32 <label><%= radio_button_tag 'sort_by', 'category', (@sort_by == 'category'), :onclick => 'this.form.submit();' %> <%= l(:field_category) %></label><br />
33 33 <label><%= radio_button_tag 'sort_by', 'date', (@sort_by == 'date'), :onclick => 'this.form.submit();' %> <%= l(:label_date) %></label><br />
34 34 <label><%= radio_button_tag 'sort_by', 'title', (@sort_by == 'title'), :onclick => 'this.form.submit();' %> <%= l(:field_title) %></label><br />
35 35 <label><%= radio_button_tag 'sort_by', 'author', (@sort_by == 'author'), :onclick => 'this.form.submit();' %> <%= l(:field_author) %></label>
36 36 <% end %>
37 37 <% end %>
38 38
39 39 <% html_title(l(:label_document_plural)) -%>
@@ -1,51 +1,51
1 1 <div class="contextual">
2 2 <%= link_to_if_authorized(l(:label_news_new),
3 3 {:controller => 'news', :action => 'new', :project_id => @project},
4 4 :class => 'icon icon-add',
5 :onclick => 'Element.show("add-news"); return false;') if @project %>
5 :onclick => 'Element.show("add-news"); Form.Element.focus("news_title"); return false;') if @project %>
6 6 </div>
7 7
8 8 <div id="add-news" style="display:none;">
9 9 <h2><%=l(:label_news_new)%></h2>
10 10 <% labelled_tabular_form_for :news, @news, :url => { :controller => 'news', :action => 'new', :project_id => @project },
11 11 :html => { :id => 'news-form' } do |f| %>
12 12 <%= render :partial => 'news/form', :locals => { :f => f } %>
13 13 <%= submit_tag l(:button_create) %>
14 14 <%= link_to_remote l(:label_preview),
15 15 { :url => { :controller => 'news', :action => 'preview', :project_id => @project },
16 16 :method => 'post',
17 17 :update => 'preview',
18 18 :with => "Form.serialize('news-form')"
19 19 }, :accesskey => accesskey(:preview) %> |
20 20 <%= link_to l(:button_cancel), "#", :onclick => 'Element.hide("add-news")' %>
21 21 <% end if @project %>
22 22 <div id="preview" class="wiki"></div>
23 23 </div>
24 24
25 25 <h2><%=l(:label_news_plural)%></h2>
26 26
27 27 <% if @newss.empty? %>
28 28 <p class="nodata"><%= l(:label_no_data) %></p>
29 29 <% else %>
30 30 <% @newss.each do |news| %>
31 31 <h3><%= link_to(h(news.project.name), :controller => 'projects', :action => 'show', :id => news.project) + ': ' unless news.project == @project %>
32 32 <%= link_to h(news.title), :controller => 'news', :action => 'show', :id => news %>
33 33 <%= "(#{news.comments_count} #{lwr(:label_comment, news.comments_count).downcase})" if news.comments_count > 0 %></h3>
34 34 <p class="author"><%= authoring news.created_on, news.author %></p>
35 35 <div class="wiki">
36 36 <%= textilizable(news.description) %>
37 37 </div>
38 38 <% end %>
39 39 <% end %>
40 40 <p class="pagination"><%= pagination_links_full @news_pages %></p>
41 41
42 42 <p class="other-formats">
43 43 <%= l(:label_export_to) %>
44 44 <span><%= link_to 'Atom', {:format => 'atom', :key => User.current.rss_key}, :class => 'feed' %></span>
45 45 </p>
46 46
47 47 <% content_for :header_tags do %>
48 48 <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
49 49 <% end %>
50 50
51 51 <% html_title(l(:label_news_plural)) -%>
@@ -1,16 +1,17
1 1 <h2><%=l(:label_project_new)%></h2>
2 2
3 3 <% labelled_tabular_form_for :project, @project, :url => { :action => "add" } do |f| %>
4 4 <%= render :partial => 'form', :locals => { :f => f } %>
5 5
6 6 <fieldset class="box"><legend><%= l(:label_module_plural) %></legend>
7 7 <% Redmine::AccessControl.available_project_modules.each do |m| %>
8 8 <label class="floating">
9 9 <%= check_box_tag 'enabled_modules[]', m, @project.module_enabled?(m) %>
10 10 <%= (l_has_string?("project_module_#{m}".to_sym) ? l("project_module_#{m}".to_sym) : m.to_s.humanize) %>
11 11 </label>
12 12 <% end %>
13 13 </fieldset>
14 14
15 15 <%= submit_tag l(:button_save) %>
16 <%= javascript_tag "Form.Element.focus('project_name');" %>
16 17 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now