Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add source and 26 field

  • Loading branch information...
commit 2b9e9c155098c5b01ad9e9d817e73ee7310beed4 1 parent 593621f
Олег Шлыков authored
View
BIN  app/assets/images/karik_logo.gif
Deleted file not rendered
View
2  app/controllers/protocols_controller.rb
@@ -53,9 +53,11 @@ def destroy
end
def update
+ #ИСПРАВИТЬ если протокол проверен, то щапрет редактирования
@protocol = Protocol.find_by_id!(params[:id])
uik_protocol = @protocol.commission.protocols.first
commission = @protocol.commission
+ @protocol.source = params[:source]
conflict = false
@protocol.votings.each_with_index do |v,i|
@protocol.send("v#{i+1}=", params["#{i+1}"])
View
4 app/helpers/application_helper.rb
@@ -13,4 +13,8 @@ def suckerfish(node)
end
fuc.call(node.descendants.arrange)
end
+
+ def vds(i=0)
+ VOTING_DICTIONARY_SHORT[1][i]
+ end
end
View
3  app/helpers/commissions_helper.rb
@@ -6,6 +6,7 @@ module CommissionsHelper
# end
def vote_class(c, p, index)
+ return 'green' if index == 26
if c.state[:uik][index-1] == p.votings[index-1]
'green'
else
@@ -16,6 +17,7 @@ def vote_class(c, p, index)
def vote_class_uik(commission, index)
#СДЕЛАТЬ Оптимизировать
return 'gray' unless commission.votes_taken
+ return 'green' if index == 26
if commission.state[:checked] and commission.state[:uik][index-1] == commission.state[:checked][index-1]
'green'
else
@@ -26,6 +28,7 @@ def vote_class_uik(commission, index)
def vote_color_uik(commission, index)
#СДЕЛАТЬ Оптимизировать
return 'gray' unless commission.votes_taken
+ return 'green' if index == 26
if commission.state[:checked] and commission.state[:uik][index-1] == commission.state[:checked][index-1]
'green'
else
View
6 app/views/commissions/_commissions_uik.html.haml
@@ -12,6 +12,12 @@
.row
.span12
%table.voting-table
+ %tr
+ %td{:width => "100px"}
+ %td{:colspan => 18}
+ - 7.times do |i|
+ %td
+ %small{"title"=>Protocol.voting_name(i+19, 1)}= vds(i+19)
- @checked.each do |p|
- if p == @checked.first
%tr
View
6 app/views/commissions/show.html.haml
@@ -6,6 +6,12 @@
= render :partial => 'commissions_region'
- else
%table.voting-table
+ %tr
+ %td{:width => "100px"}
+ %td{:colspan => 18}
+ - 7.times do |i|
+ %td
+ %small{"title"=>Protocol.voting_name(i+19, 1)}= vds(i+19)
- @commission.children.each do |c|
%tr
%td
View
2  app/views/layouts/application.html.haml
@@ -22,7 +22,7 @@
- flash.each do |name, msg|
= content_tag :div, msg, :id => "flash_\#{name}" if msg.is_a?(String)
%a{:href => "http://kapuk.info", :style => "position: fixed;top: 00px;right: 100px;z-index: 1130;float:right;"}
- %img{:src=>'/assets/karik_logo.gif'}
+ %img{:src=>'/assets/karik_logo.png'}
#container.container
-#main{:role => "main"}
= yield
View
12 app/views/protocols/_form.html.haml
@@ -10,9 +10,19 @@
-#%form{:action => commission_protocols_path(@protocol.commission.id)+'/'+@protocol.id.to_s, :method => 'post', :id => 'protocol_update'}
=form_for @protocol do |form|
%table
+ -#%tr
+ %td
+ = form.input('Сохранить') if can? :update, @protocol
+ %tr
+ %td
+ %td{:colspan => 2}
+ %input{ :name => :source, :id => :source, :value => @protocol.source, :class =>'span3'}
+ Откуда получен протокол (сайт, партия или организация)
- @protocol.votings.each_with_index do |v,i|
%tr
%td
+ = "#{i+1}. #{vds(i+1)}"
+ %td
- if can? :update, @protocol
%input{ :name =>i+1, :id => i+1, :value => v, :class =>'span1'}
- else
@@ -21,7 +31,7 @@
-#%td
-#= v.votes
%td
- = @protocol.voting_name(i+1)
+ = "#{@protocol.voting_name(i+1)}"
-#%td
-#= link_to 'Показать', trip
-#%td
View
31 config/initializers/voting_dictionary.rb
@@ -26,4 +26,35 @@
23: Политическая партия Российская объединенная демократическая партия ЯБЛОКО
24: Всероссийская политическая партия ЕДИНАЯ РОССИЯ
25: Всероссийская политическая партия ПРАВОЕ ДЕЛО
+ 26: Число зафиксированных заявлениями нарушений
YAML_TEXT
+
+VOTING_DICTIONARY_SHORT = YAML::load <<YAML_TEXT2
+1:
+ 1: изб
+ 2: пол
+ 3: дос
+ 4: выд
+ 5: вне
+ 6: пгш
+ 7: ящк
+ 8: стц
+ 9: ндтв
+ 10: дтв
+ 11: опл
+ 12: овд
+ 13: опр
+ 14: пго
+ 15: овт
+ 16: уту
+ 17: утб
+ 18: бне
+ 19: СР
+ 20: ЛДПР
+ 21: ПР
+ 22: КПРФ
+ 23: ЯБЛ
+ 24: ЕР
+ 25: ПД
+ 26: ЧН
+YAML_TEXT2
View
5 db/migrate/20120210183520_add_source_to_protocol.rb
@@ -0,0 +1,5 @@
+class AddSourceToProtocol < ActiveRecord::Migration
+ def change
+ add_column :protocols, :source, :string
+ end
+end
View
3  db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20120208175922) do
+ActiveRecord::Schema.define(:version => 20120210183520) do
create_table "comments", :force => true do |t|
t.string "body"
@@ -91,6 +91,7 @@
t.integer "v28", :default => 0
t.integer "v29", :default => 0
t.integer "v30", :default => 0
+ t.string "source"
end
add_index "protocols", ["priority"], :name => "index_protocols_on_priority"
Please sign in to comment.
Something went wrong with that request. Please try again.