Project

General

Profile

Patch #23946 » 1.news_appearance.patch

Andrey Lobanov (RedSoft), 2016-09-28 08:14

View differences:

app/views/messages/show.html.erb (revision fc236075754c3f9f7180269a1c48aa06f608e238)
22 22
         ) if @message.destroyable_by?(User.current) %>
23 23
</div>
24 24

  
25
<div class="box">
25
<h2><%= avatar(@topic.author, :size => "24") %><%= @topic.subject %></h2>
26
  <h2><%= avatar(@topic.author, :size => "24") %><%= @topic.subject %></h2>
26

  
27
<div class="message">
27
  <div class="message">
28
<p><span class="author"><%= authoring @topic.created_on, @topic.author %></span></p>
28
    <p><h4 class="author"><span class="author"><%= authoring @topic.created_on, @topic.author %></span></h4></p>
29
<div class="wiki">
30
<%= textilizable(@topic, :content) %>
31
</div>
32
<%= link_to_attachments @topic, :author => false %>
33
</div>
34
<br />
29
    <div class="wiki">
30
      <%= textilizable(@topic, :content) %>
31
    </div>
32
    <%= link_to_attachments @topic, :author => false %>
33
  </div>
34
  <br />
35
</div>
36

  
35 37

  
36 38
<% unless @replies.empty? %>
37 39
<h3 class="comments"><%= l(:label_reply_plural) %> (<%= @reply_count %>)</h3>
app/views/news/_news.html.erb (revision 6d0770c6d6fc57fb53cac49876f122485b20f47b)
1 1
<p><%= link_to_project(news.project) + ': ' unless @project %>
2
<%= link_to news.title, news_path(news) %>
2
  <%= link_to news.title, news_path(news) %>
3
<% if news.comments_count > 0 %><span class="comments">(<%= l(:label_x_comments, :count => news.comments_count) %>)</span><% end %>
3
  <% if news.comments_count > 0 %>
4
      <span class="comments">(<%= l(:label_x_comments, :count => news.comments_count) %>)</span>
5
  <% end %>
4
<br />
6
  <br/>
5
<% unless news.summary.blank? %><span class="summary"><%= news.summary %></span><br /><% end %>
7
  <% unless news.summary.blank? %><span class="summary"><%= news.summary %></span><br/>
8
  <% end %>
6
<span class="author"><%= authoring news.created_on, news.author %></span></p>
9
  <span class="author"><%= authoring news.created_on, news.author %></span></p>
app/views/news/index.html.erb (revision 6d0770c6d6fc57fb53cac49876f122485b20f47b)
1 1
<div class="contextual">
2
<%= link_to(l(:label_news_new),
3
            new_project_news_path(@project),
4
            :class => 'icon icon-add',
5
            :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
6
<%= watcher_link(@project.enabled_module('news'), User.current) if @project && User.current.logged? %>
2
  <%= link_to(l(:label_news_new),
3
              new_project_news_path(@project),
4
              :class => 'icon icon-add',
5
              :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %>
6
  <%= watcher_link(@project.enabled_module('news'), User.current) if @project && User.current.logged? %>
7 7
</div>
8 8

  
9 9
<div id="add-news" style="display:none;">
10
<h2><%=l(:label_news_new)%></h2>
10
  <h2><%= l(:label_news_new) %></h2>
11
<%= labelled_form_for @news, :url => project_news_index_path(@project),
11
  <%= labelled_form_for @news, :url => project_news_index_path(@project),
12
                                           :html => { :id => 'news-form', :multipart => true } do |f| %>
12
                        :html => {:id => 'news-form', :multipart => true} do |f| %>
13
<%= render :partial => 'news/form', :locals => { :f => f } %>
13
      <%= render :partial => 'news/form', :locals => {:f => f} %>
14
<%= submit_tag l(:button_create) %>
15
<%= preview_link preview_news_path(:project_id => @project), 'news-form' %> |
16
<%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' %>
17
<% end if @project %>
18
<div id="preview" class="wiki"></div>
14
      <%= submit_tag l(:button_create) %>
15
      <%= preview_link preview_news_path(:project_id => @project), 'news-form' %> |
16
      <%= link_to l(:button_cancel), "#", :onclick => '$("#add-news").hide()' %>
17
  <% end if @project %>
18
  <div id="preview" class="wiki"></div>
19 19
</div>
20 20

  
21
<h2><%=l(:label_news_plural)%></h2>
21
<h2><%= l(:label_news_plural) %></h2>
22 22

  
23 23
<% if @newss.empty? %>
24
<p class="nodata"><%= l(:label_no_data) %></p>
24
    <p class="nodata"><%= l(:label_no_data) %></p>
25 25
<% else %>
26
<% @newss.each do |news| %>
26
    <% @newss.each do |news| %>
27
        <div class="box">
27
    <article class="news-article">
28
      <header>
29
        <h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
30
        <%= link_to h(news.title), news_path(news) %>
31
        <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
32
        <h4 class="author"><%= authoring news.created_on, news.author %></h4>
33
        </h3>
34
      </header>
35
      <div class="wiki">
36
      <%= textilizable(news, :description) %>
37
      </div>
38
    </article>
28
          <article class="news-article">
29
            <header>
30
              <h3><%= avatar(news.author, :size => "24") %><%= link_to_project(news.project) + ': ' unless news.project == @project %>
31
                <%= link_to h(news.title), news_path(news) %>
32
                <%= "(#{l(:label_x_comments, :count => news.comments_count)})" if news.comments_count > 0 %>
33
                <h4 class="author"><%= authoring news.created_on, news.author %></h4>
34
              </h3>
35
            </header>
36
            <div class="wiki">
37
              <%= textilizable(news, :description) %>
38
            </div>
39
          </article>
40
        </div>
39
<% end %>
41
    <% end %>
40 42
<% end %>
41 43
<span class="pagination"><%= pagination_links_full @news_pages %></span>
42 44

  
43 45
<% other_formats_links do |f| %>
44
  <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
46
    <%= f.link_to 'Atom', :url => {:project_id => @project, :key => User.current.rss_key} %>
45 47
<% end %>
46 48

  
47 49
<% content_for :header_tags do %>
48
  <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
49
  <%= stylesheet_link_tag 'scm' %>
50
    <%= auto_discovery_link_tag(:atom, params.merge({:format => 'atom', :page => nil, :key => User.current.rss_key})) %>
51
    <%= stylesheet_link_tag 'scm' %>
50 52
<% end %>
51 53

  
52 54
<% html_title(l(:label_news_plural)) -%>
app/views/news/show.html.erb (revision fc236075754c3f9f7180269a1c48aa06f608e238)
1 1
<div class="contextual">
2
<%= watcher_link(@news, User.current) %>
3
<%= link_to(l(:button_edit),
4
      edit_news_path(@news),
5
      :class => 'icon icon-edit',
6
      :accesskey => accesskey(:edit),
7
      :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %>
8
<%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
2
  <%= watcher_link(@news, User.current) %>
3
  <%= link_to(l(:button_edit),
4
              edit_news_path(@news),
5
              :class => 'icon icon-edit',
6
              :accesskey => accesskey(:edit),
7
              :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %>
8
  <%= delete_link news_path(@news) if User.current.allowed_to?(:manage_news, @project) %>
9 9
</div>
10 10

  
11
<h2><%= avatar(@news.author, :size => "24") %><%=h @news.title %></h2>
12 11

  
12

  
13 13
<% if authorize_for('news', 'edit') %>
14
<div id="edit-news" style="display:none;">
15
<%= labelled_form_for :news, @news, :url => news_path(@news),
14
    <div id="edit-news" style="display:none;">
15
      <%= labelled_form_for :news, @news, :url => news_path(@news),
16
                                           :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %>
16
                            :html => {:id => 'news-form', :multipart => true, :method => :put} do |f| %>
17
<%= render :partial => 'form', :locals => { :f => f } %>
17
          <%= render :partial => 'form', :locals => {:f => f} %>
18
<%= submit_tag l(:button_save) %>
19
<%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form' %> |
20
<%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
21
<% end %>
22
<div id="preview" class="wiki"></div>
23
</div>
18
          <%= submit_tag l(:button_save) %>
19
          <%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form' %> |
20
          <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %>
21
      <% end %>
22
      <div id="preview" class="wiki"></div>
23
    </div>
24 24
<% end %>
25 25

  
26
<p><% unless @news.summary.blank? %><em><%= @news.summary %></em><br /><% end %>
27
<span class="author"><%= authoring @news.created_on, @news.author %></span></p>
26
<div class="box">
27
  <h2><%= avatar(@news.author, :size => "24") %><%= h @news.title %></h2>
28
  <p><h4 class="author">
29
  <% unless @news.summary.blank? %><em><%= @news.summary %></em><br/>
30
  <% end %>
31
  <span class="author"><%= authoring @news.created_on, @news.author %></span></h4></p>
28
<div class="wiki">
29
<%= textilizable(@news, :description) %>
30
</div>
31
<%= link_to_attachments @news %>
32
  <div class="wiki">
33
    <%= textilizable(@news, :description) %>
34
  </div>
35
  <%= link_to_attachments @news %>
32
<br />
36
  <br/>
37
</div>
33 38

  
34 39
<div id="comments" style="margin-bottom:16px;">
35
<h3 class="comments"><%= l(:label_comment_plural) %></h3>
36
<% @comments.each do |comment| %>
37
    <% next if comment.new_record? %>
38
    <div class="contextual">
39
    <%= link_to_if_authorized l(:button_delete), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
40
                              :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,
41
                              :title => l(:button_delete),
42
                              :class => 'icon-only icon-del' %>
43
    </div>
44
    <h4><%= avatar(comment.author, :size => "24") %><%= authoring comment.created_on, comment.author %></h4>
45
    <div class="wiki">
46
    <%= textilizable(comment.comments) %>
47
    </div>
48
<% end if @comments.any? %>
40
  <h3 class="comments"><%= l(:label_comment_plural) %></h3>
41
  <% @comments.each do |comment| %>
42
      <% next if comment.new_record? %>
43
      <div class="contextual">
44
        <%= link_to_if_authorized l(:button_delete), {:controller => 'comments', :action => 'destroy', :id => @news, :comment_id => comment},
45
                                  :data => {:confirm => l(:text_are_you_sure)}, :method => :delete,
46
                                  :title => l(:button_delete),
47
                                  :class => 'icon-only icon-del' %>
48
      </div>
49
      <h4><%= avatar(comment.author, :size => "24") %><%= authoring comment.created_on, comment.author %></h4>
50
      <div class="wiki">
51
        <%= textilizable(comment.comments) %>
52
      </div>
53
  <% end if @comments.any? %>
49 54
</div>
50 55

  
51 56
<% if @news.commentable? %>
52
<p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
53
<%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
54
<div class="box">
55
    <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
56
    <%= wikitoolbar_for 'comment_comments' %>
57
</div>
58
<p><%= submit_tag l(:button_add) %></p>
59
<% end %>
57
    <p><%= toggle_link l(:label_comment_add), "add_comment_form", :focus => "comment_comments" %></p>
58
    <%= form_tag({:controller => 'comments', :action => 'create', :id => @news}, :id => "add_comment_form", :style => "display:none;") do %>
59
        <div class="box">
60
          <%= text_area 'comment', 'comments', :cols => 80, :rows => 15, :class => 'wiki-edit' %>
61
          <%= wikitoolbar_for 'comment_comments' %>
62
        </div>
63
        <p><%= submit_tag l(:button_add) %></p>
64
    <% end %>
60 65
<% end %>
61 66

  
62 67
<% html_title @news.title -%>
63 68

  
64 69
<% content_for :header_tags do %>
65
  <%= stylesheet_link_tag 'scm' %>
70
    <%= stylesheet_link_tag 'scm' %>
66 71
<% end %>
public/stylesheets/application.css (revision 6d0770c6d6fc57fb53cac49876f122485b20f47b)
10 10
pre, code {font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace;}
11 11

  
12 12
/***** Layout *****/
13
/***** Layout *****/
13 14
#wrapper {background: white;overflow: hidden;}
14 15

  
15 16
#top-menu {background: #3E5B76; color: #fff; height:1.8em; font-size: 0.8em; padding: 2px 2px 0px 6px;}
(3-3/4)