Skip to content

Commit

Permalink
reorder tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenische committed Dec 12, 2015
1 parent f9a96dd commit dcc428b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
8 changes: 7 additions & 1 deletion app/controllers/arguments_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ class ArgumentsController < ApplicationController
# GET /arguments
# GET /arguments.json
def index
active
end


def decided
@arguments = Argument.all.order("abs(validity) desc").page params[:page]
render :index
end

def newest
Expand All @@ -13,7 +19,7 @@ def newest
end

def active
@arguments = Argument.all.order("updated_at desc").page params[:page]
@arguments = Argument.all.order("updated_at desc, all_sum desc").page params[:page]
render :index
end

Expand Down
8 changes: 4 additions & 4 deletions app/views/arguments/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
- title "Vote with your Bitcoin signature"

/ AddThis Button BEGIN
.addthis_toolbox.addthis_default_style.addthis_32x32_style.pull-right addthis:data_track_clickback="false" addthis:data_track_addressbar="false" addthis:ui_language="#{I18n.locale}"
.addthis_toolbox.addthis_default_style.addthis_32x32_style.pull-right addthis:data_track_clickback="false" addthis:data_track_addressbar="false" addthis:ui_language="#{I18n.locale}" addthis:url="http://bitcoinocracy.com"
a.addthis_button_preferred_1
a.addthis_button_preferred_2
a.addthis_button_preferred_3
Expand All @@ -21,13 +21,13 @@ h1 =t '.title', :default => model_class.model_name.human.pluralize.titleize

div role="navigation"
ul.nav.nav-tabs
li class="#{action_name=='index' ? 'active' : ''}" =link_to "Decided", root_path
li class="#{action_name=='active' ? 'active' : ''}" =link_to "Active", active_arguments_path
li class="#{action_name=='decided' ? 'active' : ''}" =link_to "Decided", decided_arguments_path
li class="#{action_name=='popular' ? 'active' : ''}" =link_to "Popular", popular_arguments_path
li class="#{action_name=='controversial' ? 'active' : ''}" =link_to "Controversial", controversial_arguments_path
li class="#{action_name=='valid' ? 'active' : ''}" =link_to "Valid", valid_arguments_path
li class="#{action_name=='invalid' ? 'active' : ''}" =link_to "Invalid", invalid_arguments_path
li class="#{action_name=='controversial' ? 'active' : ''}" =link_to "Controversial", controversial_arguments_path
li class="#{action_name=='newest' ? 'active' : ''}" =link_to "Newest", newest_arguments_path
li class="#{action_name=='active' ? 'active' : ''}" =link_to "Active", active_arguments_path

table.table
- @arguments.each do |argument|
Expand Down
7 changes: 4 additions & 3 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# See how all your routes lay out with "rake routes".

# You can have the root of your site routed with "root"
root 'arguments#index'
root 'arguments#active'

# Example of regular route:
# get 'products/:id' => 'catalog#view'
Expand All @@ -14,12 +14,13 @@
# Example resource route (maps HTTP verbs to controller actions automatically):
resources :arguments, except: [:edit, :update, :destroy] do
collection do
get 'active'
get 'decided'
get 'popular'
get 'controversial'
get 'newest'
get 'active'
get 'valid'
get 'invalid'
get 'newest'
end
resources :signatures, except: [:edit, :update, :destroy]
end
Expand Down

0 comments on commit dcc428b

Please sign in to comment.