SHIMADA Koji
null+****@clear*****
Sun Sep 30 19:08:11 JST 2012
SHIMADA Koji 2012-09-30 19:08:11 +0900 (Sun, 30 Sep 2012) New Revision: 9e6b9185a9b2f8993bdeb5008cfc18496fae39e1 https://github.com/logaling/logaling-server/commit/9e6b9185a9b2f8993bdeb5008cfc18496fae39e1 Log: Fix glossary icon for import glossary Modified files: app/models/additional_information_as_search_results.rb app/views/shared/_term.html.haml Modified: app/models/additional_information_as_search_results.rb (+5 -0) =================================================================== --- app/models/additional_information_as_search_results.rb 2012-09-30 19:04:31 +0900 (20e30ce) +++ app/models/additional_information_as_search_results.rb 2012-09-30 19:08:11 +0900 (4a3375a) @@ -9,6 +9,11 @@ module AdditionalInformationAsSearchResults glossary_name =~ /^github/ end + def user_glossary? + user_id = split_glossary_name_to_user_id_and_name[0] + user_id =~ /\d{5}/ + end + def split_glossary_name_to_user_id_and_name glossary_name.split("-", 2) end Modified: app/views/shared/_term.html.haml (+5 -2) =================================================================== --- app/views/shared/_term.html.haml 2012-09-30 19:04:31 +0900 (1bd5bd2) +++ app/views/shared/_term.html.haml 2012-09-30 19:08:11 +0900 (0480198) @@ -15,7 +15,7 @@ - if term.github_project? %p.githubProject = link_to term.glossary_name_without_github, '#' - - else + - elsif term.user_glossary? %p.logalingProject = link_to term.glossary_name, '#' - if signed_in? @@ -24,4 +24,7 @@ %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' - + - else + %p + %i.icon-folder-open + = term.glossary_name -------------- next part -------------- An HTML attachment was scrubbed... 다운로드