[logaling-commit] logaling/logaling-server [apply-design] Fix link text

Back to archive index

SHIMADA Koji null+****@clear*****
Thu Sep 27 00:24:21 JST 2012


SHIMADA Koji	2012-09-27 00:24:21 +0900 (Thu, 27 Sep 2012)

  New Revision: aeaeee2b645d04f14c9c6aa8e359beb94e1fb3da
  https://github.com/logaling/logaling-server/commit/aeaeee2b645d04f14c9c6aa8e359beb94e1fb3da

  Log:
    Fix link text

  Added files:
    app/decorators/user_glossary_decorator.rb
  Modified files:
    app/models/additional_information_as_search_results.rb
    app/views/dashboard/show.html.haml
    app/views/shared/_term.html.haml
    app/views/terms/edit.html.haml
    app/views/terms/new.html.haml
    app/views/user_glossaries/show.html.haml

  Added: app/decorators/user_glossary_decorator.rb (+7 -0) 100644
===================================================================
--- /dev/null
+++ app/decorators/user_glossary_decorator.rb    2012-09-27 00:24:21 +0900 (ad09614)
@@ -0,0 +1,7 @@
+# coding: utf-8
+module UserGlossaryDecorator
+  def title_text
+    "#{name} #{source_language} #{target_language}"
+  end
+  alias_method :link_text, :title_text
+end

  Modified: app/models/additional_information_as_search_results.rb (+2 -0)
===================================================================
--- app/models/additional_information_as_search_results.rb    2012-09-26 23:57:34 +0900 (5052c06)
+++ app/models/additional_information_as_search_results.rb    2012-09-27 00:24:21 +0900 (c98540a)
@@ -17,4 +17,6 @@ module AdditionalInformationAsSearchResults
   def glossary_name_without_user_id
     split_glossary_name_to_user_id_and_name[1]
   end
+
+  alias_method :glossary_name_without_github, :glossary_name_without_user_id
 end

  Modified: app/views/dashboard/show.html.haml (+2 -2)
===================================================================
--- app/views/dashboard/show.html.haml    2012-09-26 23:57:34 +0900 (5c91640)
+++ app/views/dashboard/show.html.haml    2012-09-27 00:24:21 +0900 (1b914ea)
@@ -10,7 +10,7 @@
   %ul.glossariesList
     - @user_glossaries.each do |user_glossary|
       %li
-        = link_to "#{user_glossary.glossary_name} #{user_glossary.source_language} #{user_glossary.target_language}", user_glossary_path(current_user, user_glossary)
+        = link_to user_glossary.link_text, user_glossary_path(current_user, user_glossary)
         %span.btn-group.actions
           = form_for @user_config, url: @user_config.submit_path_for(current_user), :html => { :class => "btn btn-mini" } do |f|
             = f.hidden_field :glossary_name, value: user_glossary.glossary_name
@@ -43,7 +43,7 @@
           - github_project.glossaries.each_with_index do |glossary, i|
             %li
               - bilingual_pair = [glossary.source_language, glossary.target_language].join('-')
-              = link_to "#{glossary}", github_project_glossary_path(:id => bilingual_pair, :github_project_id => github_project)
+              = link_to "#{glossary.source_language} #{glossary.target_language}", github_project_glossary_path(:id => bilingual_pair, :github_project_id => github_project)
               %span.btn-group.actions
                 = form_for @user_config, url: @user_config.submit_path_for(current_user), :html => { :class => "btn btn-mini" } do |f|
                   = f.hidden_field :glossary_name, value: glossary.name

  Modified: app/views/shared/_term.html.haml (+1 -1)
===================================================================
--- app/views/shared/_term.html.haml    2012-09-26 23:57:34 +0900 (025f758)
+++ app/views/shared/_term.html.haml    2012-09-27 00:24:21 +0900 (32f6278)
@@ -14,7 +14,7 @@
     .span2.property
       - if github_project?(term.glossary_name)
         %p.githubProject
-          = link_to term.glossary_name, '#'
+          = link_to term.glossary_name_without_github, '#'
       - else
         - user_glossary = UserGlossary.find_by_term_and_user(term, current_user)
         %p.logalingProject

  Modified: app/views/terms/edit.html.haml (+1 -3)
===================================================================
--- app/views/terms/edit.html.haml    2012-09-26 23:57:34 +0900 (46ed91d)
+++ app/views/terms/edit.html.haml    2012-09-27 00:24:21 +0900 (a68817b)
@@ -1,8 +1,6 @@
 .container
   %h1
-    = @user_glossary.glossary_name
-    = @user_glossary.source_language
-    = @user_glossary.target_language
+    = @user_glossary.title_text
   %h2
     用語の編集
   .well

  Modified: app/views/terms/new.html.haml (+2 -0)
===================================================================
--- app/views/terms/new.html.haml    2012-09-26 23:57:34 +0900 (0aed196)
+++ app/views/terms/new.html.haml    2012-09-27 00:24:21 +0900 (3620117)
@@ -1,4 +1,6 @@
 .container
+  %h1
+    = @user_glossary.title_text
   %h2 用語を登録
   .well
     = render 'form'

  Modified: app/views/user_glossaries/show.html.haml (+2 -4)
===================================================================
--- app/views/user_glossaries/show.html.haml    2012-09-26 23:57:34 +0900 (2561bf3)
+++ app/views/user_glossaries/show.html.haml    2012-09-27 00:24:21 +0900 (8e808eb)
@@ -1,8 +1,6 @@
 .container
   %h1
-    = @user_glossary.glossary_name
-    = @user_glossary.source_language
-    = @user_glossary.target_language
+    = @user_glossary.title_text
   %h2
     用語を登録
   .well
@@ -24,7 +22,7 @@
           = term.note
         .span2.property
           %p.logalingProject
-            (プロジェクト名)
+            = @user_glossary.link_text
           %p.btn-group.actions
             = link_to raw("<i class=icon-pencil></i>"), edit_user_glossary_term_path(current_user, @user_glossary, term.id), :class => 'btn btn-mini'
             = link_to raw("<i class=icon-trash></i>"), user_glossary_term_path(current_user, @user_glossary, term.id), method: :delete, :class => 'btn btn-mini'
-------------- next part --------------
An HTML attachment was scrubbed...
下载 



More information about the logaling-commit mailing list
Back to archive index