Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -r e995403ee648 app/assets/javascripts/search.js.coffee
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/app/assets/javascripts/search.js.coffee Thu Aug 30 22:55:27 2012 +0800
- @@ -0,0 +1,3 @@
- +# Place all the behaviors and hooks related to the matching controller here.
- +# All this logic will automatically be available in application.js.
- +# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
- diff -r e995403ee648 app/assets/stylesheets/scaffolds.css.scss
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/app/assets/stylesheets/scaffolds.css.scss Thu Aug 30 22:55:27 2012 +0800
- @@ -0,0 +1,56 @@
- +body {
- + background-color: #fff;
- + color: #333;
- + font-family: verdana, arial, helvetica, sans-serif;
- + font-size: 13px;
- + line-height: 18px; }
- +
- +p, ol, ul, td {
- + font-family: verdana, arial, helvetica, sans-serif;
- + font-size: 13px;
- + line-height: 18px; }
- +
- +pre {
- + background-color: #eee;
- + padding: 10px;
- + font-size: 11px; }
- +
- +a {
- + color: #000;
- + &:visited {
- + color: #666; }
- + &:hover {
- + color: #fff;
- + background-color: #000; } }
- +
- +div {
- + &.field, &.actions {
- + margin-bottom: 10px; } }
- +
- +#notice {
- + color: green; }
- +
- +.field_with_errors {
- + padding: 2px;
- + background-color: red;
- + display: table; }
- +
- +#error_explanation {
- + width: 450px;
- + border: 2px solid red;
- + padding: 7px;
- + padding-bottom: 0;
- + margin-bottom: 20px;
- + background-color: #f0f0f0;
- + h2 {
- + text-align: left;
- + font-weight: bold;
- + padding: 5px 5px 5px 15px;
- + font-size: 12px;
- + margin: -7px;
- + margin-bottom: 0px;
- + background-color: #c00;
- + color: #fff; }
- + ul li {
- + font-size: 12px;
- + list-style: square; } }
- diff -r e995403ee648 app/assets/stylesheets/search.css.scss
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/app/assets/stylesheets/search.css.scss Thu Aug 30 22:55:27 2012 +0800
- @@ -0,0 +1,3 @@
- +// Place all the styles related to the Search controller here.
- +// They will automatically be included in application.css.
- +// You can use Sass (SCSS) here: http://sass-lang.com/
- diff -r e995403ee648 app/controllers/chapters_controller.rb
- --- a/app/controllers/chapters_controller.rb Wed Aug 29 18:00:36 2012 +0800
- +++ b/app/controllers/chapters_controller.rb Thu Aug 30 22:55:27 2012 +0800
- @@ -38,6 +38,9 @@
- end
- def watch_video
- + @words = Word.joins(:types).where('types.name' => "arabmelayu")
- + @words = @words.shuffle
- + @words = @words[0,10]
- @chapter = Chapter.find(params[:id])
- # current_user.activities.find_or_create_by_key(:key => "watch_first_video" , :value => "true" , :remote_ip => request.env["HTTP_X_FORWARDED_FOR"])
- current_user.activities.find_or_create_by_key!(:key => "motivation1" , :value => params[:motivation] , :remote_ip => request.env["HTTP_X_FORWARDED_FOR"])
- diff -r e995403ee648 app/controllers/search_controller.rb
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/app/controllers/search_controller.rb Thu Aug 30 22:55:27 2012 +0800
- @@ -0,0 +1,10 @@
- +
- +class SearchController < ApplicationController
- +
- + def index
- + @words = Word.joins(:types).where('types.name' => "arabmelayu")
- + # @words = @words.shuffle
- + # @words = @words[0,5]
- + end
- +
- +end
- \ No newline at end of file
- diff -r e995403ee648 app/helpers/search_helper.rb
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/app/helpers/search_helper.rb Thu Aug 30 22:55:27 2012 +0800
- @@ -0,0 +1,2 @@
- +module SearchHelper
- +end
- diff -r e995403ee648 app/views/chapters/_video.html.erb
- --- a/app/views/chapters/_video.html.erb Wed Aug 29 18:00:36 2012 +0800
- +++ b/app/views/chapters/_video.html.erb Thu Aug 30 22:55:27 2012 +0800
- @@ -11,66 +11,12 @@
- <div class="span6 well chapter-card">
- <h3>Beberapa Perkataan Arab Melayu </h3><hr>
- <table class="table table-bordered table-striped tarab-melayu">
- + <% @words.each do |word|%>
- <tr>
- - <th class="thmalay">Masjid</th>
- - <th class="tharabic">مَسْجِد</th>
- + <th class="thmalay"><%= word.malay.titlecase %></th>
- + <th class="tharabic"><%= word.arabic.titlecase %></th>
- </tr>
- - <tr>
- - <th class="thmalay">Jumlah</th>
- - <th class="tharabic">جُمْلَة</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Kitab</th>
- - <th class="tharabic">كِتَاب</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Nisbah</th>
- - <th class="tharabic">نِسْبَة</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Syarat</th>
- - <th class="tharabic">شَرْط</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Sujud</th>
- - <th class="tharabic">سُجُوْد</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Wuduk</th>
- - <th class="tharabic">وُضُوْء</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Taat</th>
- - <th class="tharabic">طَاعَة</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Maksiat</th>
- - <th class="tharabic">مَعْصِيَة</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Sebab</th>
- - <th class="tharabic">سَبَب</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Kursi</th>
- - <th class="tharabic">كُرْسِي</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Khabar</th>
- - <th class="tharabic">خَبَر</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Misal</th>
- - <th class="tharabic">مِثَال</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Mimbar</th>
- - <th class="tharabic">مِمْبَر</th>
- - </tr>
- - <tr>
- - <th class="thmalay">Tabib</th>
- - <th class="tharabic">طَبِيْب</th>
- - </tr>
- + <% end %>
- </table>
- <br>
- diff -r e995403ee648 app/views/search/index.html.erb
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/app/views/search/index.html.erb Thu Aug 30 22:55:27 2012 +0800
- @@ -0,0 +1,14 @@
- +<center>
- + <form name="input" action="" method="get">
- + <input type="text" name="word" /><input type="submit" value="Submit" />
- + </form>
- + <h3>Beberapa Perkataan Arab Melayu </h3><hr>
- + <table class="table table-bordered table-striped tarab-melayu">
- + <% @words.each do |word|%>
- + <tr>
- + <th class="thmalay"><%= word.malay.titlecase %></th>
- + <th class="tharabic"><%= word.arabic.titlecase %></th>
- + </tr>
- + <% end %>
- + </table>
- +</center>
- \ No newline at end of file
- diff -r e995403ee648 config/routes.rb
- --- a/config/routes.rb Wed Aug 29 18:00:36 2012 +0800
- +++ b/config/routes.rb Thu Aug 30 22:55:27 2012 +0800
- @@ -32,6 +32,7 @@
- get "/classroom/running" => "home#classroom"
- get "/parts/2/beta" => "parts#beta"
- get "/parts/:id/tutorial_video" => "parts#tutorial_video"
- + get "search" => "search#index"
- resources :chapters, :only => [:show, :index] , :constraints => {:format => /(html)/}
- diff -r e995403ee648 spec/controllers/search_controller_spec.rb
- --- /dev/null Thu Jan 01 00:00:00 1970 +0000
- +++ b/spec/controllers/search_controller_spec.rb Thu Aug 30 22:55:27 2012 +0800
- @@ -0,0 +1,5 @@
- +require 'spec_helper'
- +
- +describe SearchController do
- +
- +end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement