OSDN Git Service

relates menu design adjust
authorAkira Saito <akrstjp@users.sourceforge.jp>
Sat, 23 Aug 2014 10:28:24 +0000 (19:28 +0900)
committerAkira Saito <akrstjp@users.sourceforge.jp>
Sat, 23 Aug 2014 10:28:24 +0000 (19:28 +0900)
app/views/hooks/_context.erb
config/locales/en.yml
config/locales/ja.yml

index 9e03ed7..0147921 100644 (file)
       <li><%= link_to l(:label_add_relates_to, :id=>second_issue.id),
                       issue_relations_path(:issue_id => first_issue.id,
                         :relation => {:relation_type => :relates, :issue_to_id => second_issue.id} ),
+                      :remote => false,
                       :method => :post,
                       :action => :create,
+                      :data => {:confirm => l(:text_are_you_sure)},
+                      :title => l(:label_relation_new),
                       :class => 'icon',
                       :style => 'background-image: url("/images/link.png")' %></li>
       <% end %>
 
-      <% first_issue.relations.each do |relation| %>
-      <hr>
-        <% other_issue = relation.other_issue(first_issue) %>
-        <li><%= link_to "#{other_issue.subject}",
-                                  relation_path(relation, :back_url => @back),
-                                  :remote => false,
-                                  :method => :delete,
-                                  :data => {:confirm => l(:text_are_you_sure)},
-                                  :title => l(:label_relation_delete),
-                                  :class => 'icon',
-                                  :style => 'background-image: url("/images/link_break.png");' if User.current.allowed_to?(:manage_issue_relations, @project) %></li>
+      <% if @issues.size == 1 && first_issue.relations.any? %>
+        <hr>
+        <% first_issue.relations.each do |relation| %>
+          <% other_issue = relation.other_issue(first_issue) %>
+          <% if User.current.allowed_to?(:manage_issue_relations, @project) %>
+            <li><%= link_to l(relation.label_for(first_issue)) + " \##{other_issue.id}",
+                            relation_path(relation),
+                            :remote => false,
+                            :method => :delete,
+                            :data => {:confirm => l(:text_are_you_sure)},
+                            :title => l(:label_relation_delete),
+                            :class => 'icon',
+                            :style => 'background-image: url("/images/link_break.png");' %></li>
+          <% end %> 
+        <% end %>
       <% end %>
    </ul>
   </li>
index 004bb13..6eadf4c 100644 (file)
@@ -6,7 +6,7 @@ en:
 
   button_quick_edit: Quick Edit
   label_edit_subject: Subject
-  label_add_relates_to: 'Relates : #%{id}'
+  label_add_relates_to: 'Relate #%{id}'
   text_edit_confirm: Please, input a new value.
   text_is_required: can't be empty.
   text_none_is_invalid: can't specify the 'none'.its a special value.
index df6cc46..cf79551 100644 (file)
@@ -5,7 +5,7 @@ ja:
 
   button_quick_edit: Quick Edit
   label_edit_subject: 題名
-  label_add_relates_to: '関連 #%{id}'
+  label_add_relates_to: '関連 #%{id}'
   text_edit_confirm: 新しい値を入力してください。
   text_is_required: 値の入力が必要です。
   text_none_is_invalid: noneは特別な意味を持つため指定できません。