[logaling-commit] logaling/logaling-server [apply-design] Apply design

Zurück zum Archiv-Index

SHIMADA Koji null+****@clear*****
Wed Sep 26 17:07:02 JST 2012


SHIMADA Koji	2012-09-26 17:07:02 +0900 (Wed, 26 Sep 2012)

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

  Log:
    Apply design
    
    /user_glossaries/show.html.haml

  Modified files:
    app/controllers/user_glossaries_controller.rb
    app/views/terms/_form.html.haml
    app/views/user_glossaries/show.html.haml

  Modified: app/controllers/user_glossaries_controller.rb (+1 -0)
===================================================================
--- app/controllers/user_glossaries_controller.rb    2012-09-26 16:44:40 +0900 (4db6ac4)
+++ app/controllers/user_glossaries_controller.rb    2012-09-26 17:07:02 +0900 (287e8aa)
@@ -5,6 +5,7 @@ class UserGlossariesController < ApplicationController
 
   # GET /user_glossaries/1
   def show
+    @term = Term.new
     @user_glossary = UserGlossary.find(params[:id])
   rescue ActiveRecord::RecordNotFound
     render :file => 'public/404.html', :status => 404, :layout => false

  Modified: app/views/terms/_form.html.haml (+11 -7)
===================================================================
--- app/views/terms/_form.html.haml    2012-09-26 16:44:40 +0900 (a3b99de)
+++ app/views/terms/_form.html.haml    2012-09-26 17:07:02 +0900 (e15e808)
@@ -1,4 +1,4 @@
-= form_for @term, url: {action: 'create'} do |f|
+= form_for @term, url: {action: 'create'}, :html => { :class => 'form-horizontal' } do |f|
   -if****@term*****?
     #error_explanation
       %h2= "#{pluralize(@term.errors.count, "error")} prohibited this term from being saved:"
@@ -6,14 +6,18 @@
         -****@term*****_messages.each do |msg|
           %li= msg
 
-  .well
-    = f.label :source_term, "Source term:"
+  .control-group
+    = f.label :source_term, "Source term:", :class => 'control-label required'
     = f.text_field :source_term
-    = f.label :target_term, "Target term:"
+  .control-group
+    = f.label :target_term, "Target term:", :class => 'control-label required'
     = f.text_field :target_term
-    = f.label :note, "Note:"
+  .control-group
+    = f.label :note, "Note:", :class => 'control-label'
     = f.text_field :note
 
-  .actions
-    = f.submit 'Save', :class => 'btn btn-primary'
+  .control-group
+    .controls
+      .btn-group.actions
+        = f.submit '登録して公開する', :class => 'btn btn-large'
 

  Modified: app/views/user_glossaries/show.html.haml (+27 -12)
===================================================================
--- app/views/user_glossaries/show.html.haml    2012-09-26 16:44:40 +0900 (8b530f2)
+++ app/views/user_glossaries/show.html.haml    2012-09-26 17:07:02 +0900 (2561bf3)
@@ -1,15 +1,30 @@
-.well
-  %h2
+.container
+  %h1
     = @user_glossary.glossary_name
     = @user_glossary.source_language
     = @user_glossary.target_language
-  %p
-    = link_to 'Add new term', new_user_glossary_term_path(user_id: current_user.id, glossary_id: @user_glossary.id), :class => 'btn btn-large btn-primary'
-  %p
-    - @user_glossary.terms.each do |term|
-      %li
-        = term.source_term
-        = term.target_term
-        = term.note
-        = link_to "Edit", edit_user_glossary_term_path(current_user, @user_glossary, term.id)
-        = link_to "Delete", user_glossary_term_path(current_user, @user_glossary, term.id), method: :delete
+  %h2
+    用語を登録
+  .well
+    = render 'terms/form'
+  %h2
+    登録されてる用語一覧
+  - @user_glossary.terms.each do |term|
+    .term
+      .row
+        .span9
+          %span.label<>
+            en
+          = term.source_term
+          %span.label<>
+            ja
+          = term.target_term
+          %span.label<>
+            note
+          = term.note
+        .span2.property
+          %p.logalingProject
+            (プロジェクト名)
+          %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...
Download 



More information about the logaling-commit mailing list
Zurück zum Archiv-Index