diff --git a/.gitignore b/.gitignore
old mode 100644
new mode 100755
diff --git a/Gemfile b/Gemfile
index 2039c7d..2c314f4 100755
--- a/Gemfile
+++ b/Gemfile
@@ -44,3 +44,4 @@ gem "calendar_view"
gem 'bluecloth'
gem 'sass'
gem 'haml'
+#gem 'twitter_bootstrap_form_for'
diff --git a/Gemfile.lock b/Gemfile.lock
old mode 100755
new mode 100644
index c3b2bc4..22f4382
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -31,7 +31,7 @@ GEM
arel (3.0.2)
bluecloth (2.2.0)
builder (3.0.0)
- calendar_view (0.0.6)
+ calendar_view (0.0.7)
rails (>= 3.0.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb
index 1dfd436..679a5ca 100755
--- a/app/controllers/contacts_controller.rb
+++ b/app/controllers/contacts_controller.rb
@@ -6,34 +6,10 @@ class ContactsController < ApplicationController
before_filter :get_contacts, :only => [:index]
- before_filter :prepare_ops_buttons, :prepare_export_import_buttons,:only => [:index]
-
- #theme :theme_resolver
-
def index
end
- def ops
- if params["create_new"]
- redirect_to(new_contact_path)
- return
- end
- if !params["cids"]
- flash[:warning] = t(:no_selected,:scope=>:contact)
- else
- if params["delete_selected"]
- params["cids"].each do |id|
- @current_user.contacts.find_by_id(id).destroy
- end
- elsif params["compose_to_selected"]
- redirect_to :controller=>'messages',:action=>'compose',:cids=>params["cids"]
- return
- end
- end
- redirect_to(contacts_path)
- end
-
#problem http://binary10ve.blogspot.com/2011/05/migrating-to-rails-3-got-stuck-with.html
#def destroy
# @current_user.contacts.find(params[:id]).destroy
@@ -50,6 +26,21 @@ class ContactsController < ApplicationController
end
def create
+ if params["compose_to_selected"]
+ if params["items_ids"]
+ redirect_to compose_path(:cids => params["items_ids"])
+ return
+ end
+ end
+ if params["delete_selected"]
+ if params["items_ids"]
+ params["items_ids"].each do |id|
+ @current_user.contacts.find_by_id(id).destroy
+ end
+ end
+ redirect_to(contacts_path)
+ return
+ end
@contact = @current_user.contacts.build(params[:contact])
if @contact.valid?
@contact.save
@@ -69,10 +60,17 @@ class ContactsController < ApplicationController
end
end
- def external
+ def import_export
if params["export"]
- redirect_to :action => 'export'
- return
+ contacts = @current_user.contacts
+ s = ""
+ contacts.each do |c|
+ s += c.export + "\r\n"
+ end
+ headers['Content-type'] = "text/csv"
+ headers['Content-Disposition'] = %(attachment; filename="contacts.csv")
+ render :text => s
+ return
elsif params["import"]
begin
raise t(:no_file_chosen,:scope=>:common) if not params[:upload]
@@ -82,8 +80,8 @@ class ContactsController < ApplicationController
tmp_file.flush
tmp_file.rewind
tmp_file.readlines.each do |line|
- next if line =~ /^#/
- Contact.import(@current_user,line)
+ next if line =~ /^#/
+ Contact.import(@current_user,line)
end
rescue ActiveRecord::RecordInvalid => e
flash[:error] = {:title => e.to_s,:info => e.record.inspect + e.record.errors.inspect}
@@ -96,34 +94,10 @@ class ContactsController < ApplicationController
redirect_to :action => 'index'
end
- def export
- contacts = @current_user.contacts
- s = ""
- contacts.each do |c|
- s += c.export + "\r\n"
- end
- headers['Content-type'] = "text/csv"
- headers['Content-Disposition'] = %(attachment; filename="contacts.csv")
- render :text => s
- end
-
####################################### protected section ################################
protected
- def prepare_ops_buttons
- @buttons = []
- @buttons << {:text => 'compose_to_selected',:scope=> 'contact', :image => 'email.png'}
- @buttons << {:text => 'create_new',:scope=> 'contact', :image => 'plus.png'}
- @buttons << {:text => 'delete_selected',:scope=>'contact',:image => 'minus.png'}
- end
-
- def prepare_export_import_buttons
- @ei_buttons = []
- @ei_buttons << {:text => 'import',:scope=>'contact',:image => 'right.png'}
- @ei_buttons << {:text => 'export',:scope=>'contact',:image => 'left.png'}
- end
-
####################################### private section ##################################
private
diff --git a/app/controllers/links_controller.rb b/app/controllers/links_controller.rb
index 36c11ca..11fe22a 100755
--- a/app/controllers/links_controller.rb
+++ b/app/controllers/links_controller.rb
@@ -6,39 +6,10 @@ class LinksController < ApplicationController
before_filter :get_links, :only => [:index]
- before_filter :prepare_ops_buttons, :only => [:index]
-
- #, :prepare_export_import_buttons,:only => [:index]
-
- #theme :theme_resolver
-
def index
end
- def ops
- if params["create_new"]
- redirect_to(new_link_path)
- return
- end
- if !params["ids"]
- flash[:warning] = t(:no_selected,:scope=>:link)
- else
- if params["delete_selected"]
- params["ids"].each do |id|
- @current_user.links.find_by_id(id).destroy
- end
- end
- end
- redirect_to(links_path)
- end
-
- #problem http://binary10ve.blogspot.com/2011/05/migrating-to-rails-3-got-stuck-with.html
- #def destroy
- # @current_user.contacts.find(params[:id]).destroy
- # redirect_to(contacts_path)
- #end
-
def new
@link = Link.new
end
@@ -49,6 +20,15 @@ class LinksController < ApplicationController
end
def create
+ if params["delete_selected"]
+ if params["items_ids"]
+ params["items_ids"].each do |id|
+ @current_user.links.find_by_id(id).destroy
+ end
+ end
+ redirect_to(links_path)
+ return
+ end
@link = @current_user.links.build(params[:link])
if @link.valid?
@link.save
@@ -68,10 +48,17 @@ class LinksController < ApplicationController
end
end
- def external
+ def import_export
if params["export"]
- redirect_to :action => 'export'
- return
+ links = @current_user.links
+ s = ""
+ links.each do |l|
+ s += l.export + "\r\n"
+ end
+ headers['Content-type'] = "text/csv"
+ headers['Content-Disposition'] = %(attachment; filename="links.csv")
+ render :text => s
+ return
elsif params["import"]
begin
raise t(:no_file_chosen,:scope=>:common) if not params[:upload]
@@ -81,47 +68,24 @@ class LinksController < ApplicationController
tmp_file.flush
tmp_file.rewind
tmp_file.readlines.each do |line|
- next if line =~ /^#/
- Contact.import(@current_user,line)
+ next if line =~ /^#/
+ Link.import(@current_user,line)
end
rescue ActiveRecord::RecordInvalid => e
flash[:error] = {:title => e.to_s,:info => e.record.inspect + e.record.errors.inspect}
rescue Exception => e
flash[:error] = e.to_s
else
- flash[:success] = t(:were_imported,:scope=>:contact)
+ flash[:success] = t(:were_imported,:scope=>:link)
end
end
redirect_to :action => 'index'
end
- def export
- contacts = @current_user.contacts
- s = ""
- contacts.each do |c|
- s += c.export + "\r\n"
- end
- headers['Content-type'] = "text/csv"
- headers['Content-Disposition'] = %(attachment; filename="contacts.csv")
- render :text => s
- end
-
####################################### protected section ################################
protected
- def prepare_ops_buttons
- @buttons = []
- @buttons << {:text => 'create_new',:scope=> 'link', :image => 'plus.png'}
- @buttons << {:text => 'delete_selected',:scope=>'link',:image => 'minus.png'}
- end
-
- def prepare_export_import_buttons
- @ei_buttons = []
- @ei_buttons << {:text => 'import',:scope=>'link',:image => 'right.png'}
- @ei_buttons << {:text => 'export',:scope=>'link',:image => 'left.png'}
- end
-
####################################### private section ##################################
private
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index 9259d87..86a5b42 100755
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -103,8 +103,8 @@ class MessagesController < ApplicationController
#@to = mail.To.addrs.presence
@from = @message.from_addr
@to = @message.to_addr
- @cc = mail.Cc.presence
- @bcc = mail.Bcc.presence
+ @cc = mail.cc
+ @bcc = mail.bcc
#@subject = mail.Subject
@date = mail.date.presence
diff --git a/app/controllers/messages_ops_controller.rb b/app/controllers/messages_ops_controller.rb
index cf3a0de..656ae58 100755
--- a/app/controllers/messages_ops_controller.rb
+++ b/app/controllers/messages_ops_controller.rb
@@ -25,7 +25,7 @@ class MessagesOpsController < ApplicationController
############################################### single #####################################
def single
- if params[:reply]
+ if params[:reply] or params[:reply_all]
reply
return
elsif params[:trash]
@@ -281,11 +281,19 @@ class MessagesOpsController < ApplicationController
def reply
old_message = @current_user.messages.where('folder_id = ? and uid = ?',@current_folder,params[:uids].first).first
@message = Message.new
- @message.to_addr = old_message.from_addr
- @message.subject = old_message.subject
+ #@message.to_addr = old_message.from_addr
+ #@message.to_addr = old_message.from.first
+ #@message.subject = old_message.subject
imap_message = @mailbox.fetch_body(old_message.uid)
mail = Mail.new(imap_message)
+ @message.to_addr = mail.from.first
+ @message.subject = mail.subject
+
+ if params[:reply_all]
+ @message.cc_addr = mail.cc.join('; ')
+ end
+
if mail.multipart?
@message.body = mail.text_part.nil? ? "" : mail.text_part.decoded_and_charseted.gsub(/<\/?[^>]*>/, "")
else
@@ -295,6 +303,7 @@ class MessagesOpsController < ApplicationController
@operation = :reply
render 'messages/compose'
end
+
###################################### protected section #######################################
protected
@@ -315,6 +324,7 @@ class MessagesOpsController < ApplicationController
@mail.from = @current_user.full_id
#TODO check if email address is valid if not get address from contacts
@mail.to = params[:message][:to_addr]
+ @mail.cc = params[:message][:cc_addr]
@mail.body = params[:message][:body]
@attachments = Dir.glob(File.join($defaults["msg_upload_dir"],@current_user.username + "*"))
@attachments.each do |a|
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index be5f2ec..5e3f5d7 100755
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -327,8 +327,8 @@ module ApplicationHelper
#s
#end
-#def boolean_answer(answer)
- #answer == true ? t(:true_answer,:scope=>:common) : t(:false_answer,:scope=>:common)
-#end
+def boolean_answer(answer)
+ answer == true ? t(:true_answer,:scope=>:common) : t(:false_answer,:scope=>:common)
+end
end
diff --git a/app/helpers/messages_helper.rb b/app/helpers/messages_helper.rb
index 7a24395..801125c 100755
--- a/app/helpers/messages_helper.rb
+++ b/app/helpers/messages_helper.rb
@@ -16,11 +16,12 @@ module MessagesHelper
def address_formatter(addr,op)
s = ""
- return s if addr.nil?
+ return t(:no_address,:scope=>:message) if addr.empty?
length = $defaults["msg_address_length"].to_i
case op
when :index
+ logger.custom('addr',addr)
fs = addr.gsub(/\"/,"").split(/)
fs[0].size.zero? ? s = fs[1] : s = fs[0]
s.length >= length ? s = s[0,length]+"..." : s
@@ -42,13 +43,20 @@ module MessagesHelper
case op
when :reply
s = "\n\n\n"
- body.gsub(/^\s+/,"").split(/\n/).each do |line|
- s += ">" + line + "\n"
+ body.split(/\n/).each do |line|
+ s += '>' + line.strip + "\n"
end
s
when :edit
return body
- end
+ when :plain
+ safe_body = h(body)
+ s = ""
+ safe_body.split(/\n/).each do |line|
+ s += line.gsub(/^\s+/,"") + "
"
+ end
+ s.html_safe
+ end
end
def subject_formatter(message,op)
diff --git a/app/models/contact.rb b/app/models/contact.rb
index 4af64b7..a7a0279 100755
--- a/app/models/contact.rb
+++ b/app/models/contact.rb
@@ -1,12 +1,11 @@
class Contact < ActiveRecord::Base
- validates_length_of :nick, :within => 5..15
- validates_length_of :first_name,:last_name, :within => 3..20
+ validates_length_of :name, :within => 3..20
validates_length_of :email, :within => 5..50
validates_format_of :email, :with => /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\Z/i
validates_length_of :info, :maximum => 100
- validate :check_unique_nick, :on => :create
- default_scope :order => 'nick ASC'
+ validate :check_unique_name, :on => :create
+ default_scope :order => 'name ASC'
belongs_to :user
@@ -22,21 +21,15 @@ class Contact < ActiveRecord::Base
Contact.paginate :page => page , :per_page => $defaults["contacts_per_page"], :conditions=> ['user_id = ?', user.id],:order => order
end
- def full_name
- first_name + ' ' + last_name
- end
-
- def check_unique_nick
- if !Contact.where('upper(nick) = ? and user_id = ?',nick.upcase,user_id).size.zero?
- errors.add(:nick, :not_unique)
+ def check_unique_name
+ if !Contact.where('upper(name) = ? and user_id = ?',name.upcase,user_id).size.zero?
+ errors.add(:name, :not_unique)
end
end
def export
fields = []
- fields << nick.presence || ""
- fields << first_name || ""
- fields << last_name || ""
+ fields << name || ""
fields << email || ""
fields << info || ""
fields.join(';')
@@ -44,11 +37,9 @@ class Contact < ActiveRecord::Base
def self.import(user,line)
fields = line.split(/;/)
- contact = user.contacts.build( :nick => fields[0].strip,
- :first_name => fields[1].strip,
- :last_name => fields[2].strip,
- :email => fields[3].strip,
- :info => fields[4].strip)
+ contact = user.contacts.build( :name => fields[0].strip,
+ :email => fields[1].strip,
+ :info => fields[2].strip)
contact.save!
end
end
diff --git a/app/models/link.rb b/app/models/link.rb
index 30e75cb..290e50f 100755
--- a/app/models/link.rb
+++ b/app/models/link.rb
@@ -1,5 +1,4 @@
class Link < ActiveRecord::Base
- validates_length_of :name, :within => 5..30
validates_length_of :url, :within => 5..150
validates_length_of :info, :maximum => 50
belongs_to :user
@@ -16,4 +15,19 @@ class Link < ActiveRecord::Base
Link.paginate :page => page , :per_page => $defaults["links_per_page"], :conditions=> ['user_id = ?', user.id],:order => order
end
+
+ def export
+ fields = []
+ fields << url || ""
+ fields << info || ""
+ fields.join(';')
+ end
+
+ def self.import(user,line)
+ fields = line.split(/;/)
+ contact = user.links.build( :url => fields[0].strip,
+ :info => fields[1].strip)
+ contact.save!
+ end
+
end
diff --git a/app/views/common/_anchor.html.haml b/app/views/common/_anchor.html.haml
new file mode 100755
index 0000000..35ab6b7
--- /dev/null
+++ b/app/views/common/_anchor.html.haml
@@ -0,0 +1,8 @@
+- size ||= "btn-small"
+- type ||= "btn-primary"
+- icon ||= ""
+
+%a{:class=>"btn #{size} #{type}",:href=>"#{href}"}
+ - if !icon.empty?
+ %i{:class=>"#{icon}"}
+ = caption
diff --git a/app/views/common/_import_export.html.haml b/app/views/common/_import_export.html.haml
new file mode 100755
index 0000000..a64b0aa
--- /dev/null
+++ b/app/views/common/_import_export.html.haml
@@ -0,0 +1,12 @@
+%form{:enctype=>"multipart/form-data", :class=>"form-horizontal top-pix18",:action=>"#{im_ex_path}",:method=>"post"}
+ = render :partial => "common/file_select", :locals => { :model_label => "#{im_ex_label}",
+ :model_string => "upload",
+ :attr => "datafile"}
+ %p
+ = render :partial => "common/button", :locals => {:name=>'import',
+ :caption=>t('import',:scope=>'contact'),
+ :icon=>'icon-upload icon-white'}
+ - if !im_ex_size.zero?
+ = render :partial => "common/button", :locals => {:name=>'export',
+ :caption=>t('export',:scope=>'contact'),
+ :icon=>'icon-download icon-white'}
diff --git a/app/views/common/_main_header.html.haml b/app/views/common/_main_header.html.haml
new file mode 100755
index 0000000..3cd86bd
--- /dev/null
+++ b/app/views/common/_main_header.html.haml
@@ -0,0 +1 @@
+= calendar_window(:title=>t(:calendar,:scope=>:common))
diff --git a/app/views/common/_main_navigation.html.haml b/app/views/common/_main_navigation.html.haml
index ac338c7..9b4031f 100755
--- a/app/views/common/_main_navigation.html.haml
+++ b/app/views/common/_main_navigation.html.haml
@@ -7,16 +7,15 @@
%ul{:class=>"nav nav-pills"}
%li{:class=>"#{messages}"}
- %a{:href=>messages_path}
- = t(:messages,:scope=>:message)
+ = link_to( t(:messages,:scope=>:message), messages_path )
%li{:class=>"#{compose}"}
= link_to( t(:compose,:scope=>:compose), compose_path )
%li{:class=>"#{folders}"}
= link_to( t(:folders,:scope=>:folder), folders_path )
%li{:class=>"#{contacts}"}
= link_to( t(:contacts,:scope=>:contact), contacts_path )
- %li{:class=>"#{prefs}"}
- = link_to( t(:prefs,:scope=>:prefs), prefs_look_path )
%li{:class=>"#{links}"}
= link_to( t(:links,:scope=>:link), links_path )
+ %li{:class=>"#{prefs}"}
+ = link_to( t(:prefs,:scope=>:prefs), prefs_look_path )
diff --git a/app/views/common/_prefs_navigation.html.haml b/app/views/common/_prefs_navigation.html.haml
new file mode 100755
index 0000000..1256186
--- /dev/null
+++ b/app/views/common/_prefs_navigation.html.haml
@@ -0,0 +1,11 @@
+- look ||= ""
+- identity ||= ""
+- servers ||= ""
+
+%ul{:class=>"nav nav-pills"}
+ %li{:class=>"#{look}"}
+ = link_to( t(:look,:scope=>:prefs), prefs_look_path )
+ %li{:class=>"#{identity}"}
+ = link_to( t(:identity,:scope=>:prefs), prefs_identity_path )
+ %li{:class=>"#{servers}"}
+ = link_to( t(:servers,:scope=>:prefs), prefs_servers_path )
diff --git a/app/views/common/_select.html.haml b/app/views/common/_select.html.haml
new file mode 100755
index 0000000..8cfd814
--- /dev/null
+++ b/app/views/common/_select.html.haml
@@ -0,0 +1,22 @@
+- model = eval(object.class.model_name)
+- model_string = object.class.model_name.downcase
+- model_label = model.human_attribute_name(attr)
+- translation_scope ||= false
+
+.control-group
+ %label{:class=>"control-label",:for=>"#{attr}"}
+ = model_label
+ .controls
+ - if translation_scope
+ - t = []
+ - choices.each do |c|
+ - t << [t(c.to_sym,:scope=>translation_scope),c.to_s]
+ = select(model_string, attr, options_for_select(t,choice), {:include_blank => blank})
+ - else
+ = select(model_string, attr, options_for_select(choices,choice), {:include_blank => blank})
+
+
+
+
+-# select(model.downcase, attr, options_for_select(choices,choice), {:include_blank => blank})
+
diff --git a/app/views/contacts/_attrs.html.haml b/app/views/contacts/_attrs.html.haml
new file mode 100755
index 0000000..6a80444
--- /dev/null
+++ b/app/views/contacts/_attrs.html.haml
@@ -0,0 +1,18 @@
+= render :partial => "common/input_form_desc_field",:locals => {:object => @contact,
+ :attr => 'name',
+ :label => nil,
+ :example => 'Joe Doe',
+ :value => @contact.name,
+ :to_class=>"span6" }
+= render :partial => "common/input_form_desc_field",:locals => {:object => @contact,
+ :attr => 'email',
+ :label => nil,
+ :example => 'joe.doe@domain.com',
+ :value => @contact.email,
+ :to_class=>"span6" }
+= render :partial => "common/input_form_desc_field",:locals => {:object => @contact,
+ :attr => 'info',
+ :label => nil,
+ :example => t(:some_add_info,:scope=>:common),
+ :value => @contact.info,
+ :to_class=>"span6" }
diff --git a/app/views/contacts/_contact.html.haml b/app/views/contacts/_contact.html.haml
new file mode 100755
index 0000000..4bcd3c7
--- /dev/null
+++ b/app/views/contacts/_contact.html.haml
@@ -0,0 +1,11 @@
+%tr
+ %td
+ = check_box_tag "items_ids[]", contact.id
+ \/
+ = link_to "".html_safe,edit_contact_path(contact)
+ %td{:nowrap=>"nowrap"}
+ = link_to contact.name,compose_contact_path(contact.id)
+ %td{:nowrap=>"nowrap"}
+ = link_to contact.email, compose_contact_path(contact.id)
+ %td{:nowrap=>"nowrap"}
+ = contact.info
diff --git a/app/views/contacts/_list.html.haml b/app/views/contacts/_list.html.haml
new file mode 100755
index 0000000..73f7e57
--- /dev/null
+++ b/app/views/contacts/_list.html.haml
@@ -0,0 +1,13 @@
+= will_paginate @contacts
+
+%table{:class=>"table table-bordered records"}
+ %thead
+ %tr
+ %th
+ %input{:id=>"toggleall",:type=>"checkbox",:name=>"allbox"}
+ = raw contacts_table_header
+ %tbody
+ - @contacts.each do |c|
+ = render :partial => 'contact', :locals => {:contact => c}
+
+= will_paginate @contacts
diff --git a/app/views/contacts/edit.html.haml b/app/views/contacts/edit.html.haml
new file mode 100755
index 0000000..a556dfd
--- /dev/null
+++ b/app/views/contacts/edit.html.haml
@@ -0,0 +1,20 @@
+= content_for :sidebar do
+ = render :partial => "sidebar/sidebar"
+
+= content_for :title do
+ \-
+ = t(:contacts,:scope=>:contact)
+
+= render :partial => 'common/main_navigation', :locals => { :contacts => :active }
+
+.well{:style=>"padding: 5px 3pt;"}
+ %h3
+ = t(:modifying,:scope=>:contact)
+
+%form{:class=>"form-horizontal",:action=>url_for(@contact),:method=>"post"}
+ %input{:name=>"_method",:type=>"hidden",:value=>"put"}
+ %fieldset
+ = render :partial => "attrs"
+ .control-group
+ .controls
+ = render :partial => "common/button",:locals => { :name=>:save, :caption => t(:save,:scope=>:common), :icon =>'icon-cog icon-white'}
diff --git a/app/views/contacts/index.html.haml b/app/views/contacts/index.html.haml
index ead45f5..5868a7b 100755
--- a/app/views/contacts/index.html.haml
+++ b/app/views/contacts/index.html.haml
@@ -6,3 +6,33 @@
= t(:contacts,:scope=>:contact)
= render :partial => 'common/main_navigation', :locals => { :contacts => :active }
+
+%form{:class=>"form-horizontal top-pix18",:action=>url_for(@contact),:method=>"post"}
+ - if @contacts.size.zero?
+ .alert
+ = t(:no_entries,:scope=>:contact)
+ %p{:class=>"bottom-pix18"}
+ = render :partial => "common/anchor", :locals => {:caption=>t('create_new',:scope=>'contact'),
+ :icon=>'icon-plus icon-white',
+ :href=>new_contact_path}
+ - else
+ .well{:style=>"padding: 5px 3pt;"}
+ %h5
+ = t(:total_entries,:scope=>:contact)
+ \:
+ = @contacts.total_entries
+ %p{:class=>"bottom-pix18"}
+ = render :partial => "common/anchor", :locals => {:caption=>t('create_new',:scope=>'contact'),
+ :icon=>'icon-plus icon-white',
+ :href=>new_contact_path}
+ = render :partial => "common/button", :locals => {:name=>'delete_selected',
+ :caption=>t('delete_selected',:scope=>'contact'),
+ :icon=>'icon-minus icon-white'}
+ = render :partial => "common/button", :locals => {:name=>'compose_to_selected',
+ :caption=>t('compose_to_selected',:scope=>'contact'),
+ :icon=>'icon-envelope icon-white'}
+ = render :partial => 'list'
+
+= render :partial => 'common/import_export',:locals=>{:im_ex_path => contacts_import_export_path,
+ :im_ex_label => t(:select_file,:scope=>:compose),
+ :im_ex_size => @contacts.total_entries }
diff --git a/app/views/contacts/new.html.haml b/app/views/contacts/new.html.haml
new file mode 100755
index 0000000..5af1197
--- /dev/null
+++ b/app/views/contacts/new.html.haml
@@ -0,0 +1,19 @@
+= content_for :sidebar do
+ = render :partial => "sidebar/sidebar"
+
+= content_for :title do
+ \-
+ = t(:contacts,:scope=>:contact)
+
+= render :partial => 'common/main_navigation', :locals => { :contacts => :active }
+
+.well{:style=>"padding: 5px 3pt;"}
+ %h3
+ = t(:creating_new,:scope=>:contact)
+
+%form{:class=>"form-horizontal",:action=>url_for(@contact),:method=>"post"}
+ %fieldset
+ = render :partial => "attrs"
+ .control-group
+ .controls
+ = render :partial => "common/button",:locals => { :name=>:save, :caption => t(:save,:scope=>:common), :icon =>'icon-cog icon-white'}
diff --git a/app/views/internal/about.html.haml b/app/views/internal/about.html.haml
index bf55267..932f700 100755
--- a/app/views/internal/about.html.haml
+++ b/app/views/internal/about.html.haml
@@ -2,6 +2,7 @@
= render :partial => "sidebar/sidebar"
= content_for :title do
+ \-
= t(:about,:scope=>:internal)
= render :partial => 'common/main_navigation', :locals => { :about => :active }
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 628e512..c283f5e 100755
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -22,6 +22,7 @@
- elsif flash[:success]
.alert.alert-success
= flash[:success]
+ = render :partial => "common/main_header"
= yield
%hr/
.row
diff --git a/app/views/links/_attrs.html.haml b/app/views/links/_attrs.html.haml
new file mode 100755
index 0000000..3b18ed5
--- /dev/null
+++ b/app/views/links/_attrs.html.haml
@@ -0,0 +1,12 @@
+= render :partial => "common/input_form_desc_field",:locals => {:object => @link,
+ :attr => 'url',
+ :label => nil,
+ :example => 'www.example.com',
+ :value => @link.url,
+ :to_class=>"span6" }
+= render :partial => "common/input_form_desc_field",:locals => {:object => @link,
+ :attr => 'info',
+ :label => nil,
+ :example => t(:some_add_info,:scope=>:common),
+ :value => @link.info,
+ :to_class=>"span6" }
diff --git a/app/views/links/_link.html.haml b/app/views/links/_link.html.haml
new file mode 100755
index 0000000..470c1ee
--- /dev/null
+++ b/app/views/links/_link.html.haml
@@ -0,0 +1,9 @@
+%tr
+ %td
+ = check_box_tag "items_ids[]", link.id
+ \/
+ = link_to "".html_safe,edit_link_path(link)
+ %td{:nowrap=>"nowrap"}
+ = link_to link.url,"http://"+link.url
+ %td{:nowrap=>"nowrap"}
+ = link.info
diff --git a/app/views/links/_list.html.haml b/app/views/links/_list.html.haml
new file mode 100755
index 0000000..1d53d95
--- /dev/null
+++ b/app/views/links/_list.html.haml
@@ -0,0 +1,13 @@
+= will_paginate @links , :class => "custom_pagination bottom-pix18"
+
+%table{:class=>"table table-bordered records"}
+ %thead
+ %tr
+ %th
+ %input{:id=>"toggleall",:type=>"checkbox",:name=>"allbox"}
+ = raw links_table_header
+ %tbody
+ - @links.each do |l|
+ = render :partial => 'link', :locals => {:link => l}
+
+= will_paginate @links , :class => "custom_pagination bottom-pix18"
diff --git a/app/views/links/edit.html.haml b/app/views/links/edit.html.haml
new file mode 100755
index 0000000..3a68cc3
--- /dev/null
+++ b/app/views/links/edit.html.haml
@@ -0,0 +1,20 @@
+= content_for :sidebar do
+ = render :partial => "sidebar/sidebar"
+
+= content_for :title do
+ \-
+ = t(:links,:scope=>:link)
+
+= render :partial => 'common/main_navigation', :locals => { :links => :active }
+
+.well{:style=>"padding: 5px 3pt;"}
+ %h3
+ = t(:modifying,:scope=>:link)
+
+%form{:class=>"form-horizontal",:action=>url_for(@link),:method=>"post"}
+ %input{:name=>"_method",:type=>"hidden",:value=>"put"}
+ %fieldset
+ = render :partial => "attrs"
+ .control-group
+ .controls
+ = render :partial => "common/button",:locals => { :name=>:save, :caption => t(:save,:scope=>:common), :icon =>'icon-cog icon-white'}
diff --git a/app/views/links/index.html.haml b/app/views/links/index.html.haml
index 33af4a1..00f3098 100755
--- a/app/views/links/index.html.haml
+++ b/app/views/links/index.html.haml
@@ -6,3 +6,28 @@
= t(:links,:scope=>:link)
= render :partial => 'common/main_navigation', :locals => { :links => :active }
+
+%form{:class=>"form-horizontal top-pix18",:action=>url_for(@link),:method=>"post"}
+ - if @links.size.zero?
+ .alert
+ = t(:no_entries,:scope=>:link)
+ %p{:class=>"bottom-pix18"}
+ = render :partial => "common/anchor", :locals => {:caption=>t('create_new',:scope=>'link'),
+ :icon=>'icon-plus icon-white',
+ :href=>new_link_path}
+ - else
+ .well{:style=>"padding: 5px 3pt;"}
+ %h5
+ = t(:total_entries,:scope=>:link)
+ \:
+ = @links.total_entries
+ %p{:class=>"bottom-pix18"}
+ = render :partial => "common/anchor", :locals => {:caption=>t('create_new',:scope=>'link'),
+ :icon=>'icon-plus icon-white',
+ :href=>new_link_path}
+ = render :partial => "common/button", :locals => {:name=>'delete_selected',
+ :caption=>t('delete_selected',:scope=>'link'),
+ :icon=>'icon-minus icon-white'}
+ = render :partial => 'list'
+
+
diff --git a/app/views/links/new.html.haml b/app/views/links/new.html.haml
new file mode 100755
index 0000000..3b87d8b
--- /dev/null
+++ b/app/views/links/new.html.haml
@@ -0,0 +1,19 @@
+= content_for :sidebar do
+ = render :partial => "sidebar/sidebar"
+
+= content_for :title do
+ \-
+ = t(:links,:scope=>:link)
+
+= render :partial => 'common/main_navigation', :locals => { :links => :active }
+
+.well{:style=>"padding: 5px 3pt;"}
+ %h3
+ = t(:create_new,:scope=>:link)
+
+%form{:class=>"form-horizontal",:action=>url_for(@link),:method=>"post"}
+ %fieldset
+ = render :partial => "attrs"
+ .control-group
+ .controls
+ = render :partial => "common/button",:locals => { :name=>:save, :caption => t(:save,:scope=>:common), :icon =>'icon-cog icon-white'}
diff --git a/app/views/messages/_header.html.haml b/app/views/messages/_header.html.haml
index 993919f..a557f55 100755
--- a/app/views/messages/_header.html.haml
+++ b/app/views/messages/_header.html.haml
@@ -15,13 +15,13 @@
%td{:class=>"field_name"}
= humanize_attr(@message,'cc_addr') + ':'
%td
- "CC jest"
+ = @cc.join('; ')
- if not @bcc.nil?
%tr
%td{:class=>"field_name"}
= humanize_attr(@message,'bcc_addr') + ':'
%td
- "BCC jest"
+ = @bcc.join('; ')
%tr
%td{:class=>"field_name"}
= humanize_attr(@message,'subject') + ':'
diff --git a/app/views/messages/_image.html.haml b/app/views/messages/_image.html.haml
new file mode 100755
index 0000000..ab9f5cd
--- /dev/null
+++ b/app/views/messages/_image.html.haml
@@ -0,0 +1,22 @@
+%li{:class=>"span3"}
+ .thumbnail
+ %a{:href=>"#"}
+ %img{:alt=>image.filename,:src=>attachment_download_path(image.parent_id,image.idx),:size => @current_user.prefs.msg_image_thumbnail_size,:title=>image.filename}
+ .caption
+ %h5
+ = link_to "".html_safe, attachment_download_path(image.parent_id,image.idx)
+ = image.filename
+ %small
+ = size_formatter(image.getSize)
+
+
+-#
+