[logaling-commit] logaling/logaling-server [show-terms-of-glossary] Show specified glossary's terms

Back to archive index

null+****@clear***** null+****@clear*****
Thu Jul 12 20:16:19 JST 2012


SUZUKI Miho	2012-07-12 20:16:19 +0900 (Thu, 12 Jul 2012)

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

  Log:
    Show specified glossary's terms

  Modified files:
    app/controllers/glossaries_controller.rb
    app/models/github_project.rb
    app/views/glossaries/show.html.haml

  Modified: app/controllers/glossaries_controller.rb (+3 -0)
===================================================================
--- app/controllers/glossaries_controller.rb    2012-07-12 20:15:16 +0900 (bc89ca3)
+++ app/controllers/glossaries_controller.rb    2012-07-12 20:16:19 +0900 (63ff08b)
@@ -1,4 +1,7 @@
 class GlossariesController < ApplicationController
   def show
+    @github_project = GithubProject.of(params[:github_project_id])
+    source_language, target_language = params[:id].split("-")
+    @glossary = @github_project.glossary(source_language, target_language)
   end
 end

  Modified: app/models/github_project.rb (+4 -0)
===================================================================
--- app/models/github_project.rb    2012-07-12 20:15:16 +0900 (9bbfcdb)
+++ app/models/github_project.rb    2012-07-12 20:16:19 +0900 (3031db8)
@@ -37,6 +37,10 @@ class GithubProject < ActiveRecord::Base
     registered_project.glossaries
   end
 
+  def glossary(source_language, target_language)
+    registered_project.glossary(source_language, target_language)
+  end
+
   private
   def registered_project
     LogalingServer.repository.find_project(logaling_name)

  Modified: app/views/glossaries/show.html.haml (+11 -2)
===================================================================
--- app/views/glossaries/show.html.haml    2012-07-12 20:15:16 +0900 (c4fb80f)
+++ app/views/glossaries/show.html.haml    2012-07-12 20:16:19 +0900 (24fe0fc)
@@ -1,2 +1,11 @@
-%h1 Glossaries#show
-%p Find me in app/views/glossaries/show.html.haml
\ No newline at end of file
+%p#notice= notice
+
+.well
+  %h2= @github_project.full_name
+  %p= @github_project.remote_repository_url
+  %p
+    = "%s-%s" % [@glossary.source_language, @glossary.target_language]
+
+-****@gloss***** do |term|
+  = render :partial => 'shared/term', :locals => {:term => term}
+
-------------- next part --------------
An HTML attachment was scrubbed...
다운로드 



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