Advertisement
zaidhuda

diff

Aug 30th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.95 KB | None | 0 0
  1. diff -r e995403ee648 app/assets/javascripts/search.js.coffee
  2. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
  3. +++ b/app/assets/javascripts/search.js.coffee Thu Aug 30 22:55:27 2012 +0800
  4. @@ -0,0 +1,3 @@
  5. +# Place all the behaviors and hooks related to the matching controller here.
  6. +# All this logic will automatically be available in application.js.
  7. +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
  8. diff -r e995403ee648 app/assets/stylesheets/scaffolds.css.scss
  9. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
  10. +++ b/app/assets/stylesheets/scaffolds.css.scss Thu Aug 30 22:55:27 2012 +0800
  11. @@ -0,0 +1,56 @@
  12. +body {
  13. + background-color: #fff;
  14. + color: #333;
  15. + font-family: verdana, arial, helvetica, sans-serif;
  16. + font-size: 13px;
  17. + line-height: 18px; }
  18. +
  19. +p, ol, ul, td {
  20. + font-family: verdana, arial, helvetica, sans-serif;
  21. + font-size: 13px;
  22. + line-height: 18px; }
  23. +
  24. +pre {
  25. + background-color: #eee;
  26. + padding: 10px;
  27. + font-size: 11px; }
  28. +
  29. +a {
  30. + color: #000;
  31. + &:visited {
  32. + color: #666; }
  33. + &:hover {
  34. + color: #fff;
  35. + background-color: #000; } }
  36. +
  37. +div {
  38. + &.field, &.actions {
  39. + margin-bottom: 10px; } }
  40. +
  41. +#notice {
  42. + color: green; }
  43. +
  44. +.field_with_errors {
  45. + padding: 2px;
  46. + background-color: red;
  47. + display: table; }
  48. +
  49. +#error_explanation {
  50. + width: 450px;
  51. + border: 2px solid red;
  52. + padding: 7px;
  53. + padding-bottom: 0;
  54. + margin-bottom: 20px;
  55. + background-color: #f0f0f0;
  56. + h2 {
  57. + text-align: left;
  58. + font-weight: bold;
  59. + padding: 5px 5px 5px 15px;
  60. + font-size: 12px;
  61. + margin: -7px;
  62. + margin-bottom: 0px;
  63. + background-color: #c00;
  64. + color: #fff; }
  65. + ul li {
  66. + font-size: 12px;
  67. + list-style: square; } }
  68. diff -r e995403ee648 app/assets/stylesheets/search.css.scss
  69. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
  70. +++ b/app/assets/stylesheets/search.css.scss Thu Aug 30 22:55:27 2012 +0800
  71. @@ -0,0 +1,3 @@
  72. +// Place all the styles related to the Search controller here.
  73. +// They will automatically be included in application.css.
  74. +// You can use Sass (SCSS) here: http://sass-lang.com/
  75. diff -r e995403ee648 app/controllers/chapters_controller.rb
  76. --- a/app/controllers/chapters_controller.rb Wed Aug 29 18:00:36 2012 +0800
  77. +++ b/app/controllers/chapters_controller.rb Thu Aug 30 22:55:27 2012 +0800
  78. @@ -38,6 +38,9 @@
  79. end
  80.  
  81. def watch_video
  82. + @words = Word.joins(:types).where('types.name' => "arabmelayu")
  83. + @words = @words.shuffle
  84. + @words = @words[0,10]
  85. @chapter = Chapter.find(params[:id])
  86. # current_user.activities.find_or_create_by_key(:key => "watch_first_video" , :value => "true" , :remote_ip => request.env["HTTP_X_FORWARDED_FOR"])
  87. current_user.activities.find_or_create_by_key!(:key => "motivation1" , :value => params[:motivation] , :remote_ip => request.env["HTTP_X_FORWARDED_FOR"])
  88. diff -r e995403ee648 app/controllers/search_controller.rb
  89. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
  90. +++ b/app/controllers/search_controller.rb Thu Aug 30 22:55:27 2012 +0800
  91. @@ -0,0 +1,10 @@
  92. +
  93. +class SearchController < ApplicationController
  94. +
  95. + def index
  96. + @words = Word.joins(:types).where('types.name' => "arabmelayu")
  97. + # @words = @words.shuffle
  98. + # @words = @words[0,5]
  99. + end
  100. +
  101. +end
  102. \ No newline at end of file
  103. diff -r e995403ee648 app/helpers/search_helper.rb
  104. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
  105. +++ b/app/helpers/search_helper.rb Thu Aug 30 22:55:27 2012 +0800
  106. @@ -0,0 +1,2 @@
  107. +module SearchHelper
  108. +end
  109. diff -r e995403ee648 app/views/chapters/_video.html.erb
  110. --- a/app/views/chapters/_video.html.erb Wed Aug 29 18:00:36 2012 +0800
  111. +++ b/app/views/chapters/_video.html.erb Thu Aug 30 22:55:27 2012 +0800
  112. @@ -11,66 +11,12 @@
  113. <div class="span6 well chapter-card">
  114. <h3>Beberapa Perkataan Arab Melayu </h3><hr>
  115. <table class="table table-bordered table-striped tarab-melayu">
  116. + <% @words.each do |word|%>
  117. <tr>
  118. - <th class="thmalay">Masjid</th>
  119. - <th class="tharabic">مَسْجِد</th>
  120. + <th class="thmalay"><%= word.malay.titlecase %></th>
  121. + <th class="tharabic"><%= word.arabic.titlecase %></th>
  122. </tr>
  123. - <tr>
  124. - <th class="thmalay">Jumlah</th>
  125. - <th class="tharabic">جُمْلَة</th>
  126. - </tr>
  127. - <tr>
  128. - <th class="thmalay">Kitab</th>
  129. - <th class="tharabic">كِتَاب</th>
  130. - </tr>
  131. - <tr>
  132. - <th class="thmalay">Nisbah</th>
  133. - <th class="tharabic">نِسْبَة</th>
  134. - </tr>
  135. - <tr>
  136. - <th class="thmalay">Syarat</th>
  137. - <th class="tharabic">شَرْط</th>
  138. - </tr>
  139. - <tr>
  140. - <th class="thmalay">Sujud</th>
  141. - <th class="tharabic">سُجُوْد</th>
  142. - </tr>
  143. - <tr>
  144. - <th class="thmalay">Wuduk</th>
  145. - <th class="tharabic">وُضُوْء</th>
  146. - </tr>
  147. - <tr>
  148. - <th class="thmalay">Taat</th>
  149. - <th class="tharabic">طَاعَة</th>
  150. - </tr>
  151. - <tr>
  152. - <th class="thmalay">Maksiat</th>
  153. - <th class="tharabic">مَعْصِيَة</th>
  154. - </tr>
  155. - <tr>
  156. - <th class="thmalay">Sebab</th>
  157. - <th class="tharabic">سَبَب</th>
  158. - </tr>
  159. - <tr>
  160. - <th class="thmalay">Kursi</th>
  161. - <th class="tharabic">كُرْسِي</th>
  162. - </tr>
  163. - <tr>
  164. - <th class="thmalay">Khabar</th>
  165. - <th class="tharabic">خَبَر</th>
  166. - </tr>
  167. - <tr>
  168. - <th class="thmalay">Misal</th>
  169. - <th class="tharabic">مِثَال</th>
  170. - </tr>
  171. - <tr>
  172. - <th class="thmalay">Mimbar</th>
  173. - <th class="tharabic">مِمْبَر</th>
  174. - </tr>
  175. - <tr>
  176. - <th class="thmalay">Tabib</th>
  177. - <th class="tharabic">طَبِيْب</th>
  178. - </tr>
  179. + <% end %>
  180. </table>
  181.  
  182. <br>
  183. diff -r e995403ee648 app/views/search/index.html.erb
  184. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
  185. +++ b/app/views/search/index.html.erb Thu Aug 30 22:55:27 2012 +0800
  186. @@ -0,0 +1,14 @@
  187. +<center>
  188. + <form name="input" action="" method="get">
  189. + <input type="text" name="word" /><input type="submit" value="Submit" />
  190. + </form>
  191. + <h3>Beberapa Perkataan Arab Melayu </h3><hr>
  192. + <table class="table table-bordered table-striped tarab-melayu">
  193. + <% @words.each do |word|%>
  194. + <tr>
  195. + <th class="thmalay"><%= word.malay.titlecase %></th>
  196. + <th class="tharabic"><%= word.arabic.titlecase %></th>
  197. + </tr>
  198. + <% end %>
  199. + </table>
  200. +</center>
  201. \ No newline at end of file
  202. diff -r e995403ee648 config/routes.rb
  203. --- a/config/routes.rb Wed Aug 29 18:00:36 2012 +0800
  204. +++ b/config/routes.rb Thu Aug 30 22:55:27 2012 +0800
  205. @@ -32,6 +32,7 @@
  206. get "/classroom/running" => "home#classroom"
  207. get "/parts/2/beta" => "parts#beta"
  208. get "/parts/:id/tutorial_video" => "parts#tutorial_video"
  209. + get "search" => "search#index"
  210.  
  211. resources :chapters, :only => [:show, :index] , :constraints => {:format => /(html)/}
  212.  
  213. diff -r e995403ee648 spec/controllers/search_controller_spec.rb
  214. --- /dev/null Thu Jan 01 00:00:00 1970 +0000
  215. +++ b/spec/controllers/search_controller_spec.rb Thu Aug 30 22:55:27 2012 +0800
  216. @@ -0,0 +1,5 @@
  217. +require 'spec_helper'
  218. +
  219. +describe SearchController do
  220. +
  221. +end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement