diff --git a/Gemfile b/Gemfile
old mode 100644
new mode 100755
diff --git a/Gemfile.lock b/Gemfile.lock
old mode 100644
new mode 100755
diff --git a/Rakefile b/Rakefile
old mode 100644
new mode 100755
diff --git a/app/assets/images/glyphicons-halflings-white.png b/app/assets/images/glyphicons-halflings-white.png
old mode 100644
new mode 100755
diff --git a/app/assets/images/glyphicons-halflings.png b/app/assets/images/glyphicons-halflings.png
old mode 100644
new mode 100755
diff --git a/app/assets/images/rails.png b/app/assets/images/rails.png
old mode 100644
new mode 100755
diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js
old mode 100644
new mode 100755
diff --git a/app/assets/javascripts/bootstrap.min.js b/app/assets/javascripts/bootstrap.min.js
old mode 100644
new mode 100755
diff --git a/app/assets/javascripts/mailr.js b/app/assets/javascripts/mailr.js
new file mode 100755
index 0000000..ff47b09
--- /dev/null
+++ b/app/assets/javascripts/mailr.js
@@ -0,0 +1,10 @@
+$(function() {
+ console.log("ready");
+ $("#toggleall").click(function() {
+ var checked_status = this.checked;
+ jQuery("input[type='checkbox']").each(function() {
+ this.checked = checked_status;
+ });
+ });
+
+});
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
old mode 100644
new mode 100755
diff --git a/app/assets/stylesheets/bootstrap-responsive.min.css b/app/assets/stylesheets/bootstrap-responsive.min.css
old mode 100644
new mode 100755
diff --git a/app/assets/stylesheets/bootstrap.min.css b/app/assets/stylesheets/bootstrap.min.css
old mode 100644
new mode 100755
index 30dcae0..731a1b1
--- a/app/assets/stylesheets/bootstrap.min.css
+++ b/app/assets/stylesheets/bootstrap.min.css
@@ -220,8 +220,8 @@ table .span9{float:none;width:684px;margin-left:0;}
table .span10{float:none;width:764px;margin-left:0;}
table .span11{float:none;width:844px;margin-left:0;}
table .span12{float:none;width:924px;margin-left:0;}
-[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;}[class^="icon-"]:last-child,[class*=" icon-"]:last-child{*margin-left:0;}
-.icon-white{background-image:url("../img/glyphicons-halflings-white.png");}
+[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;line-height:14px;vertical-align:text-top;background-image:url("/assets/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat;*margin-right:.3em;}[class^="icon-"]:last-child,[class*=" icon-"]:last-child{*margin-left:0;}
+.icon-white{background-image:url("/assets/glyphicons-halflings-white.png");}
.icon-glass{background-position:0 0;}
.icon-music{background-position:-24px 0;}
.icon-search{background-position:-48px 0;}
diff --git a/app/assets/stylesheets/mailr.css.sass b/app/assets/stylesheets/mailr.css.sass
old mode 100644
new mode 100755
index 6dca155..32b115a
--- a/app/assets/stylesheets/mailr.css.sass
+++ b/app/assets/stylesheets/mailr.css.sass
@@ -1,7 +1,33 @@
body.simple
margin-top: 20px
margin-bottom: 20px
+
#footer-simple
text-align: center
+
.top-pix18
margin-top: 18px
+
+body.application
+ margin-top: 10px
+ margin-bottom: 10px
+
+#sidebar
+ .logo
+ img
+ margin-bottom: 10px
+
+p.version
+ text-align: center
+
+tr.unseen
+ font-weight: bold
+
+.bottom-pix18
+ margin-bottom: 18px
+
+table.header
+ td.field_name
+ text-align: right
+ font-weight: bold
+ padding-right: 10px
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index e38947f..8384d89 100755
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -2,8 +2,9 @@ require 'yaml'
class ApplicationController < ActionController::Base
- protect_from_forgery
-
+ #logger.custom("session",session.inspect)
+ #protect_from_forgery
+
before_filter :load_settings,:current_user,:set_locale
#before_filter :plugins_configuration
@@ -32,13 +33,14 @@ class ApplicationController < ActionController::Base
end
def current_user
- @current_user ||= User.find(session[:user_id]) if session[:user_id]
+ @current_user ||= User.find(session[:user_id]) if session[:user_id]
+ logger.custom("current_user",@current_user.inspect)
end
def check_current_user
if @current_user.nil?
session["return_to"] = request.fullpath
- redirect_to :controller => 'user', :action => 'login'
+ redirect_to :controller => 'user', :action => 'login'
return false
end
end
diff --git a/app/controllers/folders_controller.rb b/app/controllers/folders_controller.rb
index a0717af..88bcbb5 100755
--- a/app/controllers/folders_controller.rb
+++ b/app/controllers/folders_controller.rb
@@ -3,16 +3,16 @@ require 'imap_session'
class FoldersController < ApplicationController
- include ImapMailboxModule
+ include ImapMailboxModule
include ImapSessionModule
- before_filter :check_current_user,:selected_folder, :get_current_folders
+ before_filter :check_current_user,:selected_folder, :get_current_folders
before_filter :open_imap_session, :except => [:index,:show_hide,:system]
after_filter :close_imap_session, :except => [:index,:show_hide,:system]
before_filter :get_folders
- before_filter :prepare_buttons_to_folders
+ #before_filter :prepare_buttons_to_folders
#theme :theme_resolver
@@ -153,16 +153,16 @@ class FoldersController < ApplicationController
protected
- def prepare_buttons_to_folders
- @buttons = []
- @buttons << {:text => 'show_hide',:scope=>'folder',:image => 'flag.png'}
- @buttons << {:text => 'refresh',:scope=>'folder',:image => 'refresh.png'}
- end
+ #def prepare_buttons_to_folders
+ #@buttons = []
+ #@buttons << {:text => 'show_hide',:scope=>'folder',:image => 'flag.png'}
+ #@buttons << {:text => 'refresh',:scope=>'folder',:image => 'refresh.png'}
+ #end
def get_folders
@folders = @current_user.folders
@folders_shown = @current_user.folders.shown
- #@folders_system = @current_user.folders.sys
+ @folders_system = @current_user.folders.sys
@current_user.folders.inbox.first.nil? ? @folder_inbox = "" : @folder_inbox = @current_user.folders.inbox.first.id
@current_user.folders.drafts.first.nil? ? @folder_drafts = "" : @folder_drafts = @current_user.folders.drafts.first.id
@current_user.folders.sent.first.nil? ? @folder_sent = "" : @folder_sent = @current_user.folders.sent.first.id
diff --git a/app/controllers/internal_controller.rb b/app/controllers/internal_controller.rb
index 431b9d2..c257d6f 100755
--- a/app/controllers/internal_controller.rb
+++ b/app/controllers/internal_controller.rb
@@ -9,13 +9,14 @@ class InternalController < ApplicationController
ERRORS = [
:internal_server_error,
:not_found,
- :unprocessable_entity
+ :unprocessable_entity,
+ :allready_configured
].freeze
ERRORS.each do |e|
define_method e do
@title = t(e,:scope=>:internal)
- @error = t(e,:scope=>:internal)
+ flash[:error] = t(e,:scope=>:internal)
render 'error'
end
end
@@ -29,7 +30,7 @@ class InternalController < ApplicationController
@title = t(:imap_error,:scope => :internal)
@error = params[:error] || t(:unspecified_error, :scope => :internal)
logger.error "!!! InternalControllerImapError: " + @error
- render 'error'
+ render 'error'
end
def loginfailure
@@ -39,12 +40,19 @@ class InternalController < ApplicationController
redirect_to :controller=>'user', :action => 'login'
end
- def onlycanlogins
- reset_session
- flash[:error] = t(:only_can_logins,:scope=>:user)
- @current_user = nil
- redirect_to :controller=>'user', :action => 'login'
- end
+ #def onlycanlogins
+ #reset_session
+ #flash[:error] = t(:only_can_logins,:scope=>:user)
+ #@current_user = nil
+ #redirect_to :controller=>'user', :action => 'login'
+ #end
+
+ #def onlycanlogins
+ #reset_session
+ #flash[:error] = t(:allready_configured,:scope=>:user)
+ #@current_user = nil
+ #redirect_to :controller=>'user', :action => 'login'
+ #end
def about
render 'internal/about', :layout => 'application'
diff --git a/app/controllers/messages_controller.rb b/app/controllers/messages_controller.rb
index 9ac0bed..9259d87 100755
--- a/app/controllers/messages_controller.rb
+++ b/app/controllers/messages_controller.rb
@@ -16,9 +16,9 @@ class MessagesController < ApplicationController
before_filter :prepare_compose_buttons, :only => [:compose]
before_filter :get_system_folders, :only => [:index]
before_filter :create_message_with_params, :only => [:compose]
- before_filter :prepare_multi1_buttons, :only => [:index,:show]
- before_filter :prepare_multi2_buttons, :only => [:index]
- before_filter :prepare_multi3_buttons, :only => [:show]
+ #before_filter :prepare_multi1_buttons, :only => [:index,:show]
+ #before_filter :prepare_multi2_buttons, :only => [:index]
+ #before_filter :prepare_multi3_buttons, :only => [:show]
after_filter :close_imap_session
#theme :theme_resolver
@@ -129,7 +129,9 @@ class MessagesController < ApplicationController
end
end
else
- part = Mail::Part.new(mail)
+ logger.custom('mail',mail.inspect)
+ part = mail
+ #part = Mail::Part.new(mail)
part.idx = 0
part.parent_id = @message.uid
if part.isText?
@@ -175,7 +177,8 @@ class MessagesController < ApplicationController
if mail.multipart? == true
attachments = mail.attachments
else
- attachments << Mail::Part.new(mail)
+ #attachments << Mail::Part.new(mail)
+ attachments << mail
end
a = attachments[params[:idx].to_i]
headers['Content-type'] = a.main_type + "/" + a.sub_type
@@ -188,23 +191,23 @@ class MessagesController < ApplicationController
protected
- def prepare_multi2_buttons
- @multi2_buttons = []
- @multi2_buttons << {:text => 'trash',:scope=>:message,:image => 'trash.png'}
- @multi2_buttons << {:text => 'set_unread',:scope=>:message,:image => 'unseen.png'}
- @multi2_buttons << {:text => 'set_read',:scope=>:message,:image => 'seen.png'}
- end
+ #def prepare_multi2_buttons
+ #@multi2_buttons = []
+ #@multi2_buttons << {:text => 'trash',:scope=>:message,:image => 'trash.png'}
+ #@multi2_buttons << {:text => 'set_unread',:scope=>:message,:image => 'unseen.png'}
+ #@multi2_buttons << {:text => 'set_read',:scope=>:message,:image => 'seen.png'}
+ #end
- def prepare_multi1_buttons
- @multi1_buttons = []
- @multi1_buttons << {:text => 'copy',:scope=>:message,:image => 'copy.png'}
- @multi1_buttons << {:text => 'move',:scope=>:message,:image => 'move.png'}
- end
+ #def prepare_multi1_buttons
+ #@multi1_buttons = []
+ #@multi1_buttons << {:text => 'copy',:scope=>:message,:image => 'copy.png'}
+ #@multi1_buttons << {:text => 'move',:scope=>:message,:image => 'move.png'}
+ #end
- def prepare_multi3_buttons
- @multi3_buttons = []
- @multi3_buttons << {:text => 'show_header',:scope=>:show,:image => 'zoom.png'}
- @multi3_buttons << {:text => 'trash',:scope=>:show,:image => 'trash.png'}
- @multi3_buttons << {:text => 'reply',:scope=>:show,:image => 'reply.png'}
- end
+ #def prepare_multi3_buttons
+ #@multi3_buttons = []
+ #@multi3_buttons << {:text => 'show_header',:scope=>:show,:image => 'zoom.png'}
+ #@multi3_buttons << {:text => 'trash',:scope=>:show,:image => 'trash.png'}
+ #@multi3_buttons << {:text => 'reply',:scope=>:show,:image => 'reply.png'}
+ #end
end
diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb
index d8de62c..5e88477 100755
--- a/app/controllers/user_controller.rb
+++ b/app/controllers/user_controller.rb
@@ -4,6 +4,12 @@ class UserController < ApplicationController
layout "simple"
def login
+ # database empty redirect to setup screen
+ users = User.all
+ if users.count.zero?
+ redirect_to :controller => 'user', :action => 'setup'
+ return false
+ end
end
def logout
@@ -14,29 +20,31 @@ class UserController < ApplicationController
def authenticate
- users = User.all
- if users.count.zero?
- redirect_to :controller => 'user', :action => 'setup'
- return false
- end
-
+ # check if user can use application
if not $defaults["only_can_logins"].nil?
if not $defaults["only_can_logins"].include?(params[:user][:login])
- redirect_to :controller => 'internal', :action => 'onlycanlogins'
+ flash[:error] = t(:only_can_logins,:scope=>:user)
+ redirect_to :action => 'login'
return false
end
end
user = User.find_by_login(params[:user][:login])
if user.nil?
- redirect_to :action => 'unknown' ,:login=> params[:user][:login]
+
+ flash[:error] = t(:login_failure,:scope=>:user)
+ redirect_to :action => 'login'
+ return false
+
else
- session[:user_id] = user.id
+
+ session[:user_id] = user.id
user.set_cached_password(session,params[:user][:password])
if session["return_to"]
- redirect_to(session["return_to"])
+ redirect = session["return_to"]
session["return_to"] = nil
+ redirect_to(redirect)
else
redirect_to :controller=> 'messages', :action=> 'index'
end
@@ -44,17 +52,19 @@ class UserController < ApplicationController
end
end
- def loginfailure
- end
+ #def loginfailure
+ #end
def setup
+ users = User.all
+ if !users.count.zero?
+ redirect_to :controller => 'internal', :action => 'allready_configured'
+ return false
+ end
@user = User.new
@server = Server.new
end
- def unknown
- end
-
def create
@user = User.new
@@ -62,7 +72,7 @@ class UserController < ApplicationController
@user.first_name = params[:user][:first_name]
@user.last_name = params[:user][:last_name]
- @server = Server.new
+ @server = Server.new
@server.name = params[:server][:name]
if @user.valid? and @server.valid?
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 87fe879..be5f2ec 100755
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2,333 +2,333 @@ require 'iconv'
module ApplicationHelper
-def form_field(object,field,flabel,example,val)
- model_name = eval(object.class.model_name)
- html = ""
- html << "
+<%= link_to (t(:version,:scope=>:common) + " " + $defaults["version"]),about_path %>
+
+
diff --git a/app/views/internal/about.html.erb b/app/views/internal/about.html.erb
new file mode 100755
index 0000000..4698b30
--- /dev/null
+++ b/app/views/internal/about.html.erb
@@ -0,0 +1,33 @@
+<% content_for :title do %>
+- <%= t(:about,:scope=>:internal) %>
+<% end %>
+
+<% content_for :sidebar do %>
+<%= content_for_sidebar %>
+<% end %>
+
+
+
+<%= raw single_navigation(:about,:internal) %>
+
+
+
+
+<%= t(:current_version,:scope=>:internal) + ": " + $defaults["version"] %>
+
+
+
+<%= raw BlueCloth::new(render :file => 'README.markdown').to_html %>
+
+
+
+<%= raw BlueCloth::new(render :file => 'CHANGES').to_html %>
+
+
+
+<%= raw BlueCloth::new(render :file => 'TODO').to_html %>
+
+
+
+
+
diff --git a/app/views/internal/error.html.haml b/app/views/internal/error.html.haml
new file mode 100755
index 0000000..e69de29
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
new file mode 100755
index 0000000..628e512
--- /dev/null
+++ b/app/views/layouts/application.html.haml
@@ -0,0 +1,30 @@
+!!!
+%html
+ %head
+ %title
+ =t(:mailr,:scope=>:common)
+ = yield :title
+ = stylesheet_link_tag "application", :media => "all"
+ = javascript_include_tag "application"
+ = csrf_meta_tags
+ %body{:class=>"application"}
+ .container
+ .row
+ .span3#sidebar
+ = yield :sidebar
+ .span9#main
+ - if flash[:error]
+ .alert.alert-error
+ = flash[:error]
+ - elsif flash[:info]
+ .alert.alert-info
+ = flash[:info]
+ - elsif flash[:success]
+ .alert.alert-success
+ = flash[:success]
+ = yield
+ %hr/
+ .row
+ #footer-simple
+ %a{:href=>"https://github.com/musashimm/mailr"} MailR
+ \- open source web mail client
diff --git a/app/views/links/index.html.haml b/app/views/links/index.html.haml
new file mode 100755
index 0000000..33af4a1
--- /dev/null
+++ b/app/views/links/index.html.haml
@@ -0,0 +1,8 @@
+= content_for :sidebar do
+ = render :partial => "sidebar/sidebar"
+
+= content_for :title do
+ \-
+ = t(:links,:scope=>:link)
+
+= render :partial => 'common/main_navigation', :locals => { :links => :active }
diff --git a/app/views/messages/_attachment.html.erb b/app/views/messages/_attachment.html.erb
new file mode 100755
index 0000000..0ff539b
--- /dev/null
+++ b/app/views/messages/_attachment.html.erb
@@ -0,0 +1,19 @@
+
+<%= link_to attachment.filename_charseted, attachment_download_path(attachment.parent_id,attachment.idx) %>
+
+
+<%= attachment.main_type %>/<%= attachment.sub_type %>
+
+
+<%= attachment.charset %>
+
+
+<%= attachment.content_transfer_encoding %>
+
+
+<%= size_formatter(attachment.getSize) %>
+
+
+<%= link_to image_tag(current_theme_image_path('download.png')), attachment_download_path(attachment.parent_id,attachment.idx) %>
+
+
diff --git a/app/views/messages/_attachment.html.haml b/app/views/messages/_attachment.html.haml
new file mode 100755
index 0000000..61e0a63
--- /dev/null
+++ b/app/views/messages/_attachment.html.haml
@@ -0,0 +1,14 @@
+%td
+ = attachment.filename_charseted
+%td
+ = attachment.main_type
+ \/
+ = attachment.sub_type
+%td
+ = attachment.charset
+%td
+ = attachment.content_transfer_encoding
+%td
+ = size_formatter(attachment.getSize)
+%td
+ = link_to "
".html_safe, attachment_download_path(attachment.parent_id,attachment.idx)
diff --git a/app/views/messages/_attachments.html.erb b/app/views/messages/_attachments.html.erb
new file mode 100755
index 0000000..5d051a7
--- /dev/null
+++ b/app/views/messages/_attachments.html.erb
@@ -0,0 +1,13 @@
+
+
<%= t(:attachments,:scope=>:message) %>
+
+
+<% trclass = :even %>
+<% for idx in 0..@attachments.size-1 %>
+
+ <%= render :partial => 'attachment', :object => @attachments[idx] %>
+
+<% trclass == :even ? trclass = :odd : trclass = :even %>
+<% end %>
+
+
diff --git a/app/views/messages/_attachments.html.haml b/app/views/messages/_attachments.html.haml
new file mode 100755
index 0000000..ee41c72
--- /dev/null
+++ b/app/views/messages/_attachments.html.haml
@@ -0,0 +1,9 @@
+%h1
+ %small
+ = t(:attachments,:scope=>:message)
+%table{:class=>"table table-bordered"}
+ %tbody
+ - for idx in 0..@attachments.size-1
+ %tr
+ = render :partial => 'attachment', :locals => { :attachment => @attachments[idx] }
+
diff --git a/app/views/messages/_file_attach.html.erb b/app/views/messages/_file_attach.html.erb
new file mode 100755
index 0000000..a809654
--- /dev/null
+++ b/app/views/messages/_file_attach.html.erb
@@ -0,0 +1,4 @@
+
<%= check_box_tag "files[]", file_attach[:name] %>
+
<%= file_attach[:name] %>
+
<%= size_formatter(file_attach[:size]) %>
+
diff --git a/app/views/messages/_file_attachs.html.erb b/app/views/messages/_file_attachs.html.erb
new file mode 100755
index 0000000..683b1f8
--- /dev/null
+++ b/app/views/messages/_file_attachs.html.erb
@@ -0,0 +1,16 @@
+
+
<%= t(:attachments,:scope=>:message) %>
+<% if not @attachments.size.zero? %>
+<% trclass = :even %>
+
+<% @attachments.each do |a| %>
+
+<%= render :partial => 'messages/file_attach', :object => a %>
+
+<% trclass == :even ? trclass = :odd : trclass = :even %>
+<% end %>
+
+<%= raw single_action('delete_marked','compose','minus.png') %>
+<% end %>
+
+
diff --git a/app/views/messages/_file_select.html.erb b/app/views/messages/_file_select.html.erb
new file mode 100755
index 0000000..3279115
--- /dev/null
+++ b/app/views/messages/_file_select.html.erb
@@ -0,0 +1,9 @@
+
+<%= t(:select_file,:scope=>:compose) %> :
+<%= file_field 'file', 'data' %>
+<%= raw single_action('upload','compose','up.png') %>
+
+
+
+
+
diff --git a/app/views/messages/_header.html.erb b/app/views/messages/_header.html.erb
new file mode 100755
index 0000000..1017ea1
--- /dev/null
+++ b/app/views/messages/_header.html.erb
@@ -0,0 +1,14 @@
+
diff --git a/app/views/messages/_header.html.haml b/app/views/messages/_header.html.haml
new file mode 100755
index 0000000..993919f
--- /dev/null
+++ b/app/views/messages/_header.html.haml
@@ -0,0 +1,39 @@
+%table{:class=>"header bottom-pix18"}
+ %tbody
+ %tr
+ %td{:class=>"field_name"}
+ = humanize_attr(@message,'from_addr') + ':'
+ %td
+ = address_formatter(@from,:show)
+ %tr
+ %td{:class=>"field_name"}
+ = humanize_attr(@message,'to_addr') + ':'
+ %td
+ = address_formatter(@to,:show)
+ - if not @cc.nil?
+ %tr
+ %td{:class=>"field_name"}
+ = humanize_attr(@message,'cc_addr') + ':'
+ %td
+ "CC jest"
+ - if not @bcc.nil?
+ %tr
+ %td{:class=>"field_name"}
+ = humanize_attr(@message,'bcc_addr') + ':'
+ %td
+ "BCC jest"
+ %tr
+ %td{:class=>"field_name"}
+ = humanize_attr(@message,'subject') + ':'
+ %td
+ = subject_formatter(@message,:show)
+ %tr
+ %td{:class=>"field_name"}
+ = humanize_attr(@message,'date') + ':'
+ %td
+ = date_formatter(@date)
+
+= hidden_field_tag 'uids[]', @message.uid
+= hidden_field_tag 'source', 'show'
+%pre{:class=>"header_raw",:style=>"display: none;"}
+ = @plain_header
diff --git a/app/views/messages/_html_part.html.erb b/app/views/messages/_html_part.html.erb
new file mode 100755
index 0000000..7beb3d0
--- /dev/null
+++ b/app/views/messages/_html_part.html.erb
@@ -0,0 +1,3 @@
+
+
diff --git a/app/views/messages/_image.html.erb b/app/views/messages/_image.html.erb
new file mode 100755
index 0000000..f9cc663
--- /dev/null
+++ b/app/views/messages/_image.html.erb
@@ -0,0 +1,8 @@
+
+<%= image_tag(attachment_download_path(image.parent_id,image.idx), :size => @current_user.prefs.msg_image_thumbnail_size, :alt=>image.filename, :title=>image.filename) %>
+
+<%= link_to (image.filename,attachment_download_path(image.parent_id,image.idx)) %>
+<%= size_formatter(image.getSize) %>
+
+
+
diff --git a/app/views/messages/_images.html.erb b/app/views/messages/_images.html.erb
new file mode 100755
index 0000000..afeea6d
--- /dev/null
+++ b/app/views/messages/_images.html.erb
@@ -0,0 +1,8 @@
+
+
+<% for idx in 0..@images.size-1 %>
+<%= render :partial => 'image', :object => @images[idx] %>
+<% end %>
+
+
+
diff --git a/app/views/messages/_message.html.haml b/app/views/messages/_message.html.haml
new file mode 100755
index 0000000..bd5cdbd
--- /dev/null
+++ b/app/views/messages/_message.html.haml
@@ -0,0 +1,38 @@
+%td
+ = check_box_tag "uids[]", message.uid
+%td
+ = raw attachment_formatter(message)
+%td
+ - if @current_folder == @sent_folder || @current_folder == @drafts_folder
+ = address_formatter(message.to_addr,:index)
+ - else
+ = address_formatter(message.from_addr,:index)
+%td
+ = subject_formatter(message,:index)
+%td
+ = date_formatter(message.date)
+%td
+ = size_formatter(message.size)
+%td
+ - if @current_folder == @drafts_folder
+ = link_to(t(:edit,:scope=>:message),edit_path(message.uid))
+ - else
+
+
+
+-#
+
<%= check_box_tag "uids[]", message.uid %>
+
<%= attachment_formatter(message) %>
+ <% if @current_folder == @sent_folder || @current_folder == @drafts_folder %>
+
<%= address_formatter(message.to_addr,:index) %>
+ <% else %>
+
<%= address_formatter(message.from_addr,:index) %>
+ <% end %>
+
<%= subject_formatter(message,:index) %>
+
<%= date_formatter(message.date) %>
+
<%= size_formatter(message.size) %>
+ <% if @current_folder == @drafts_folder %>
+
<%= link_to(t(:edit,:scope=>:message),edit_path(message.uid)) %>
+ <% else %>
+
<%= raw(' ') %>
+ <% end %>
diff --git a/app/views/messages/_messages.html.haml b/app/views/messages/_messages.html.haml
new file mode 100755
index 0000000..3ac2ed8
--- /dev/null
+++ b/app/views/messages/_messages.html.haml
@@ -0,0 +1,32 @@
+.well{:style=>"padding: 5px 3pt;"}
+ %h3
+ = t(:current,:scope=>:folder)
+ \:
+ = pretty_folder_name(@current_folder)
+ %h5
+ = t(:total,:scope=>:message)
+ \:
+ = @messages.total_entries
+
+= will_paginate @messages
+
+%table{:class=>"table table-bordered"}
+ %thead
+ %tr
+ %th
+ %input{:id=>"toggleall",:type=>"checkbox",:name=>"allbox"}
+ %th
+ %i{:class=>"icon-file"}
+ = raw headers_links
+ %th
+
+ %tbody
+ - @messages.each do |m|
+ - m.unseen == true ? unseen = "unseen" : unseen = ""
+ %tr{:class=>"#{unseen}"}
+ = render :partial => 'messages/message', :locals => {:message => m}
+
+
+= will_paginate @messages
+
+
diff --git a/app/views/messages/_multi_ops.html.haml b/app/views/messages/_multi_ops.html.haml
new file mode 100755
index 0000000..5980d61
--- /dev/null
+++ b/app/views/messages/_multi_ops.html.haml
@@ -0,0 +1,20 @@
+%p
+ = render :partial => "common/button", :locals => {:name=>'copy',
+ :caption=>t('copy',:scope=>'message'),
+ :icon=>'icon-tags icon-white'}
+ = render :partial => "common/button", :locals => {:name=>'move',
+ :caption=>t('move',:scope=>'message'),
+ :icon=>'icon-chevron-right icon-white'}
+
+ = t(:to_folder,:scope=>:folder) + " "
+ = raw simple_select_for_folders("folder","target",@folders_shown,'',true)
+%p
+ = render :partial => "common/button", :locals => {:name=>'trash',
+ :caption=>t('trash',:scope=>'message'),
+ :icon=>'icon-trash icon-white'}
+ = render :partial => "common/button", :locals => {:name=>'set_unread',
+ :caption=>t('set_unread',:scope=>'message'),
+ :icon=>'icon-eye-close icon-white'}
+ = render :partial => "common/button", :locals => {:name=>'set_read',
+ :caption=>t('set_read',:scope=>'message'),
+ :icon=>'icon-eye-open icon-white'}
diff --git a/app/views/messages/_new.html.erb b/app/views/messages/_new.html.erb
new file mode 100755
index 0000000..8ec1896
--- /dev/null
+++ b/app/views/messages/_new.html.erb
@@ -0,0 +1,27 @@
+
+<%= raw form_field( @message,
+ "to_addr",
+ nil,
+ "joe@domain.com"+', '+ t(:not_contain_at,:scope=>:compose),
+ address_formatter(@message.to_addr,@operation)
+ ) %>
+<%= raw form_field( @message,
+ "subject",
+ nil,
+ t(:subject_of_the_message,:scope=>:compose),
+ subject_formatter(@message.subject,@operation)
+ ) %>
+<%= raw area_field( @message,
+ "body",
+ nil,
+ t(:write_your_message_here,:scope=>:compose),
+ body_formatter(@message.body,@operation),
+ 80,
+ 20
+ ) %>
+
+<% if !@olduid.nil? %>
+<%= hidden_field_tag 'olduid', @olduid %>
+<% end %>
+<%= raw group_action(@buttons) %>
+
diff --git a/app/views/messages/_search.html.erb b/app/views/messages/_search.html.erb
new file mode 100755
index 0000000..cee5c10
--- /dev/null
+++ b/app/views/messages/_search.html.erb
@@ -0,0 +1,10 @@
+
+
+ <%= t(:search) %>
+ <%= t(:in_message_field) %>
+ <%= options_for_select($defaults["msg_search_fields"])%>
+ <%= t(:string) %>
+
+ <%= submit_tag(t(:search), :name=>'search')%>
+
+
diff --git a/app/views/messages/_single_ops.html.erb b/app/views/messages/_single_ops.html.erb
new file mode 100755
index 0000000..d38a73a
--- /dev/null
+++ b/app/views/messages/_single_ops.html.erb
@@ -0,0 +1,10 @@
+
+<%= raw group_action_text(@multi1_buttons,t(:to_folder,:scope=>:folder)+ " " + simple_select_for_folders("folder","target",@folders_shown,'',true)) %>
+<%= raw group_action(@multi3_buttons) %>
+
+
+
diff --git a/app/views/messages/_single_ops.html.haml b/app/views/messages/_single_ops.html.haml
new file mode 100755
index 0000000..6388357
--- /dev/null
+++ b/app/views/messages/_single_ops.html.haml
@@ -0,0 +1,25 @@
+%p
+ = render :partial => "common/button", :locals => {:name=>'copy',
+ :caption=>t('copy',:scope=>'message'),
+ :icon=>'icon-tags icon-white'}
+ = render :partial => "common/button", :locals => {:name=>'move',
+ :caption=>t('move',:scope=>'message'),
+ :icon=>'icon-chevron-right icon-white'}
+
+ = t(:to_folder,:scope=>:folder) + " "
+ = raw simple_select_for_folders("folder","target",@folders_shown,'',true)
+
+%p
+ = render :partial => "common/button", :locals => {:name=>'show_header',
+ :caption=>t('show_header',:scope=>'show'),
+ :icon=>'icon-zoom-in icon-white'}
+ = render :partial => "common/button", :locals => {:name=>'trash',
+ :caption=>t('trash',:scope=>'show'),
+ :icon=>'icon-trash icon-white'}
+ = render :partial => "common/button", :locals => {:name=>'reply',
+ :caption=>t('reply',:scope=>'show'),
+ :icon=>'icon-arrow-left icon-white'}
+ = render :partial => "common/button", :locals => {:name=>'forward',
+ :caption=>t('forward',:scope=>'show'),
+ :icon=>'icon-arrow-right icon-white'}
+
diff --git a/app/views/messages/compose.html.erb b/app/views/messages/compose.html.erb
new file mode 100755
index 0000000..510cbbe
--- /dev/null
+++ b/app/views/messages/compose.html.erb
@@ -0,0 +1,23 @@
+<% content_for :sidebar do %>
+<%= content_for_sidebar %>
+<% end %>
+
+<% content_for :title do %>
+- <%= t(:compose,:scope=>:compose) %>
+<% end %>
+
+
+
+ <%= raw main_navigation(:compose_tab) %>
+
+
+
<%= t(:new_message,:scope=>:compose) %>
+
+ <%= form_tag(composed_path, :multipart => true) %>
+ <%= render :partial => 'messages/new' %>
+ <%= render :partial=> 'messages/file_attachs' %>
+ <%= render :partial => 'messages/file_select' %>
+
+
+
+
diff --git a/app/views/messages/compose.html.haml b/app/views/messages/compose.html.haml
new file mode 100755
index 0000000..4a69de1
--- /dev/null
+++ b/app/views/messages/compose.html.haml
@@ -0,0 +1,44 @@
+= content_for :sidebar do
+ = render :partial => "sidebar/sidebar"
+
+= content_for :title do
+ = t(:compose,:scope=>:compose)
+
+= render :partial => 'common/main_navigation', :locals => { :compose => :active }
+
+%form{:multipart => 'true',:class=>"form-horizontal",:action=>composed_path,:method=>"post"}
+ .well{:style=>"padding: 5px 3pt;"}
+ %h3
+ = t(:new_message,:scope=>:compose)
+ %fieldset
+ = render :partial => "common/input_form_desc_field",:locals => {:object => @user,:attr => 'login',:label => nil,:example => 'joe.doe',:value => params[:user] ? params[:user][:login] : "" }
+
+
+
+-#
+
+ <%= raw form_field( @message,
+ "to_addr",
+ nil,
+ "joe@domain.com"+', '+ t(:not_contain_at,:scope=>:compose),
+ address_formatter(@message.to_addr,@operation)
+ ) %>
+ <%= raw form_field( @message,
+ "subject",
+ nil,
+ t(:subject_of_the_message,:scope=>:compose),
+ subject_formatter(@message.subject,@operation)
+ ) %>
+ <%= raw area_field( @message,
+ "body",
+ nil,
+ t(:write_your_message_here,:scope=>:compose),
+ body_formatter(@message.body,@operation),
+ 80,
+ 20
+ ) %>
+
+ <% if !@olduid.nil? %>
+ <%= hidden_field_tag 'olduid', @olduid %>
+ <% end %>
+ <%= raw group_action(@buttons) %>
diff --git a/app/views/messages/html_body.html.erb b/app/views/messages/html_body.html.erb
new file mode 100755
index 0000000..b1f0d7c
--- /dev/null
+++ b/app/views/messages/html_body.html.erb
@@ -0,0 +1,2 @@
+<%= raw @body -%>
+
diff --git a/app/views/messages/index.html.haml b/app/views/messages/index.html.haml
new file mode 100755
index 0000000..d7e7d84
--- /dev/null
+++ b/app/views/messages/index.html.haml
@@ -0,0 +1,20 @@
+= content_for :sidebar do
+ = render :partial => "sidebar/sidebar"
+
+= content_for :title do
+ \-
+ = t(:messages,:scope=>:message)
+
+= render :partial => 'common/main_navigation', :locals => { :messages => :active }
+
+%form{:class=>"form-horizontal top-pix18",:action=>"#{messages_ops_multi_path}",:method=>"post"}
+ - if @current_folder.nil?
+ .alert
+ = t(:no_selected,:scope=>:folder)
+
+ - if @messages.size.zero?
+ .alert
+ = t(:no_in,:scope=>:message)
+ - else
+ = render :partial => 'multi_ops'
+ = render :partial => 'messages'
diff --git a/app/views/messages/index2.html.erb b/app/views/messages/index2.html.erb
new file mode 100755
index 0000000..d93e092
--- /dev/null
+++ b/app/views/messages/index2.html.erb
@@ -0,0 +1,33 @@
+<% content_for :sidebar do %>
+<%= content_for_sidebar %>
+<% end %>
+
+<% content_for :title do %>
+- <%= t(:messages,:scope=>:message) %>
+<% end %>
+
+
+
+ <%= raw main_navigation(:messages_tab) %>
+
+
+ <%= form_tag({:controller=>'messages_ops', :action=>'multi'},{:name=>'messages'})%>
+
+ <% if @current_folder.nil? %>
+
<%= t(:no_selected,:scope=>:folder) %>
+ <% end %>
+
+ <% if @messages.size.zero? %>
+
+
+
+ <% else %>
+ <%= render :partial => 'multi_ops' %>
+ <%= render :partial => 'messages' %>
+ <% end %>
+
+
+
+
+
+
diff --git a/app/views/messages/show.html.erb b/app/views/messages/show.html.erb
new file mode 100755
index 0000000..1718862
--- /dev/null
+++ b/app/views/messages/show.html.erb
@@ -0,0 +1,43 @@
+<% content_for :sidebar do %>
+<%= content_for_sidebar %>
+<% end %>
+
+<% content_for :title do %>
+- <%= subject_formatter(@message,:show) %>
+<% end %>
+
+
+
+ <%= raw main_navigation(:show) %>
+
+
+ <%= form_tag(messages_ops_single_path)%>
+ <%= render :partial => 'header' %>
+ <%= render :partial => 'single_ops' %>
+
+ <% if not @attachments.size.zero? %>
+ <%= render :partial => 'attachments' %>
+ <% end %>
+
+ <% if not @images.size.zero? %>
+ <%= render :partial => 'images' %>
+ <% end %>
+
+ <% if not @html_part.nil? %>
+ <%= render :partial => 'html_part' %>
+ <% else %>
+
+ <% if @text_part.nil? %>
+
+ <%= t(:no_content,:scope => :message) %>
+
+ <% else %>
+ <%= raw content_text_plain_for_render(@text_part) %>
+ <% end %>
+
+ <% end %>
+
+
+
+
+
diff --git a/app/views/messages/show.html.haml b/app/views/messages/show.html.haml
new file mode 100755
index 0000000..f37fb8b
--- /dev/null
+++ b/app/views/messages/show.html.haml
@@ -0,0 +1,29 @@
+= content_for :sidebar do
+ = render :partial => "sidebar/sidebar"
+
+= content_for :title do
+ \-
+ = subject_formatter(@message,:show)
+
+= render :partial => 'common/main_navigation', :locals => { :show => :active }
+
+%form{:class=>"form-horizontal top-pix18",:action=>"#{messages_ops_multi_path}",:method=>"post"}
+ = render :partial => 'header'
+ = render :partial => 'single_ops'
+ - if not @attachments.size.zero?
+ = render :partial => 'attachments'
+ - if not @images.size.zero?
+ render :partial => 'images'
+ - if not @html_part.nil?
+ = render :partial => 'html_part'
+ - else
+ - if @text_part.nil?
+ .alert
+ = t(:no_content,:scope => :message)
+ - else
+ %pre
+ = @text_part
+
+
+
+
diff --git a/app/views/prefs/look.html.haml b/app/views/prefs/look.html.haml
new file mode 100755
index 0000000..6c3ae77
--- /dev/null
+++ b/app/views/prefs/look.html.haml
@@ -0,0 +1,8 @@
+= content_for :sidebar do
+ = render :partial => "sidebar/sidebar"
+
+= content_for :title do
+ \-
+ = t(:look,:scope=>:prefs)
+
+= render :partial => 'common/main_navigation', :locals => { :prefs => :active }
diff --git a/app/views/sidebar/_calendar_view.html.haml b/app/views/sidebar/_calendar_view.html.haml
new file mode 100755
index 0000000..e69de29
diff --git a/app/views/sidebar/_sidebar.html.haml b/app/views/sidebar/_sidebar.html.haml
new file mode 100755
index 0000000..a02943f
--- /dev/null
+++ b/app/views/sidebar/_sidebar.html.haml
@@ -0,0 +1,11 @@
+= render :partial => "common/logo"
+= render :partial => "common/version"
+= render :partial => "folders/list"
+%p
+ = render :partial => "common/button", :locals => {:name=>'logout',
+ :type=>"btn-danger",
+ :caption=>t('logout',:scope=>'user'),
+ :icon=>'icon-off icon-white',
+ :onclick=>"window.location='#{user_logout_path}'"}
+= render :partial => "sidebar/calendar_view"
+
diff --git a/app/views/user/login.html.haml b/app/views/user/login.html.haml
old mode 100644
new mode 100755
index cd4ae34..4a39651
--- a/app/views/user/login.html.haml
+++ b/app/views/user/login.html.haml
@@ -5,8 +5,10 @@
%form{:class=>"form-horizontal top-pix18",:action=>"#{url_for(:controller => 'user', :action => 'authenticate')}",:method=>"post"}
%fieldset
= render :partial => "common/input_form_field",:locals => { :model => 'user',:attr => 'login'}
- = render :partial => "common/input_form_field",:locals => { :model => 'user',:attr => 'password'}
- = render :partial => "common/form_button",:locals => { :text => t(:please_login,:scope=>:user)}
+ = render :partial => "common/input_password_form_field",:locals => { :model => 'user',:attr => 'password'}
+ .control-group
+ .controls
+ = render :partial => "common/button",:locals => { :name=>'login', :caption => t(:please_login,:scope=>:user), :icon =>'icon-lock icon-white'}
diff --git a/app/views/user/setup.html.haml b/app/views/user/setup.html.haml
index d354d65..50bf954 100755
--- a/app/views/user/setup.html.haml
+++ b/app/views/user/setup.html.haml
@@ -2,8 +2,14 @@
\-
= t(:setup,:scope=>:user)
+%div{:class=>"alert alert-info"}
+ = t(:no_config,:scope=>:user)
%form{:class=>"form-horizontal top-pix18",:action=>"#{url_for(:controller => 'user', :action => 'create')}",:method=>"post"}
%legend
= t(:setup,:scope=>:user)
%fieldset
- = render :partial => "common/input_form_desc_field",:locals => {:object => @user,:attr => 'login',:label => nil,:example => 'joe doe',:value => params[:user].nil? ? params[:login] : params[:user][:login]}
+ = render :partial => "common/input_form_desc_field",:locals => {:object => @user,:attr => 'login',:label => nil,:example => 'joe.doe',:value => params[:user] ? params[:user][:login] : "" }
+ = render :partial => "common/input_form_desc_field",:locals => {:object => @user,:attr => 'first_name',:label => nil,:example => 'Joe',:value => params[:user] ? params[:user][:first_name] : ""}
+ = render :partial => "common/input_form_desc_field",:locals => {:object => @user,:attr => 'last_name',:label => nil,:example => 'Doe',:value => params[:user] ? params[:user][:last_name] : ""}
+ = render :partial => "common/input_form_desc_field",:locals => {:object => @server,:attr => 'name',:label => nil,:example => 'server.domain',:value => params[:server] ? params[:server][:name] : ""}
+ = render :partial => "common/form_button_icon",:locals => { :text => t(:send_config,:scope=>:user), :icon_class =>'icon-ok icon-white'}
diff --git a/app/views/user/unknown.html.erb b/app/views/user/unknown.html.erb
deleted file mode 100755
index 0ef78a8..0000000
--- a/app/views/user/unknown.html.erb
+++ /dev/null
@@ -1,16 +0,0 @@
-<% content_for :title do %>
- <%= t(:unknown_title,:scope=>:user) %>
-<% end %>
-
-
-
-
-
-
<%= t(:unknown_title,:scope=>:user) %>
-
-
<%= t(:unknown_flash,:scope=>:user) %>
-
<%= t(:unknown_login,:scope=>:user) %> -> <%= link_to t(:login,:scope=>:user),user_login_path %>
-
<%= t(:unknown_setup,:scope=>:user) %> -> <%= link_to t(:setup,:scope=>:user),:controller => "user",:action => "setup",:login => params[:login] %>
-
-
-
diff --git a/config.ru b/config.ru
old mode 100644
new mode 100755
diff --git a/config/application.rb b/config/application.rb
old mode 100644
new mode 100755
diff --git a/config/boot.rb b/config/boot.rb
old mode 100644
new mode 100755
diff --git a/config/environment.rb b/config/environment.rb
old mode 100644
new mode 100755
diff --git a/config/environments/development.rb b/config/environments/development.rb
old mode 100644
new mode 100755
diff --git a/config/environments/production.rb b/config/environments/production.rb
old mode 100644
new mode 100755
diff --git a/config/environments/test.rb b/config/environments/test.rb
old mode 100644
new mode 100755
diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb
old mode 100644
new mode 100755
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
old mode 100644
new mode 100755
diff --git a/config/initializers/mime_types.rb b/config/initializers/mime_types.rb
old mode 100644
new mode 100755
diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb
old mode 100644
new mode 100755
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
old mode 100644
new mode 100755
diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb
old mode 100644
new mode 100755
diff --git a/config/locales/pl.yml b/config/locales/pl.yml
index f54c166..42b02e6 100755
--- a/config/locales/pl.yml
+++ b/config/locales/pl.yml
@@ -60,6 +60,9 @@ pl:
for_imap: IMAP?
for_smtp: SMTP?
auth: Metoda autoryzacji
+ folder:
+ name: Nazwa folderu
+
contact:
compose_to_selected: Napisz do wybranych
@@ -99,7 +102,7 @@ pl:
folder:
folder: Folder
folders: Foldery
- no_shown: Nie prezentowany jest żaden folder. Skonfiguruj widok folderów w zakładce
+ no_shown: Nie jest prezentowany żaden folder. Skonfiguruj widok folderów w zakładce
parent: Folder nadrzędny
to_create: Folder do utworzenia
to_delete: Folder do usunięcia
@@ -127,6 +130,7 @@ pl:
not_configured_inbox: Folder Odebrane nie został przypisany
show_hide: Pokaż/Ukryj
refresh: Odśwież
+ presentation: Prezentacja folderów
message:
messages: Wiadomości
@@ -171,9 +175,10 @@ pl:
delete: Usuń
reply_string: "Odp: "
trash: Usuń
+ forward: Przekaż
user:
- login_failure: Nieudane logowanie. Podano błędny e-mail lub hasło.
+ login_failure: Nieudane logowanie. Podano błędny login lub hasło.
logged_out: Użytkownik wylogowany
setup_done: Konfiguracja zakończona. Proszę się zalogować.
please_login: Logowanie
@@ -186,6 +191,8 @@ pl:
only_can_logins: Podany identyfikator użytkownika nie uprawnia do korzystania z aplikacji
logout: Wyloguj
has_no_domain: Użytkownik nie ma ustawionej domeny
+ send_config: Wyślij
+ no_config: W bazie nie znaleziono żadnego użytkownika. Prawdopodobnie aplikacja nie została jeszcze skonfigurowana. Wypełnij poniższy formularz, aby dokonać podtsawowej konfiguracji.
internal:
imap_error: Błąd protokołu IMAP
@@ -196,6 +203,7 @@ pl:
about: Informacje o programie
current_version: Aktualna wersja
general_error: Błąd aplikacji
+ allready_configured: Podstawowe parametry aplikacji zostały już skonfigurowane. Zaloguj się na utworzonego użytkownika i dokonaj dodatkowej konfiguracji.
common:
false_answer: Nie
@@ -204,7 +212,7 @@ pl:
no_tmp_dir: Brak katalogu tymczasowego
must_be_unique: musi być unikalny
some_add_info: jakieś dodatkowe informacje
- example: przykład
+ example: "przykład:"
create: Utwórz
delete: Usuń
mailr: MailR
diff --git a/config/routes.rb b/config/routes.rb
index 9d2bf2d..755460a 100755
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -43,11 +43,12 @@ Mailr::Application.routes.draw do
get "imaperror"
get "loginfailure"
get "onlycanlogins"
+ get "allready_configured"
end
match "/internal/about" => 'internal#about' ,:as => :about
match "/messages_ops/single" => 'messages_ops#single'
- match "/messages_ops/multi" => 'messages_ops#multi'
+ match "/messages_ops/multi" => 'messages_ops#multi', :as => :messages_ops_multi
match "/messages_ops/sendout_or_save" => 'messages_ops#sendout_or_save' ,:as =>:sendout_or_save
match "/messages_ops/upload" => 'messages_ops#upload',:as => :upload
match "/messages_ops/edit/:id" => 'messages_ops#edit', :as => :edit
diff --git a/config/settings.yml.example b/config/settings.yml.example
old mode 100644
new mode 100755
diff --git a/db/migrate/20120303202800_create_all_tables.rb b/db/migrate/20120303202800_create_all_tables.rb
old mode 100644
new mode 100755
diff --git a/db/schema.rb b/db/schema.rb
old mode 100644
new mode 100755
diff --git a/db/seeds.rb b/db/seeds.rb
old mode 100644
new mode 100755
diff --git a/doc/README_FOR_APP b/doc/README_FOR_APP
old mode 100644
new mode 100755
diff --git a/lib/assets/.gitkeep b/lib/assets/.gitkeep
old mode 100644
new mode 100755
diff --git a/lib/mail_plugin_extension.rb b/lib/mail_plugin_extension.rb
index 3f71520..efd44bd 100755
--- a/lib/mail_plugin_extension.rb
+++ b/lib/mail_plugin_extension.rb
@@ -2,28 +2,24 @@ require 'iconv'
module Mail
- class Message
+ class Message
+ attr_accessor :idx,:parent_id
+
- def decoded_and_charseted
- begin
- if not charset.upcase == 'UTF-8'
- charset.nil? ? source_charset = $defaults["msg_unknown_charset"] : source_charset = charset
- charseted = Iconv.iconv("UTF-8",source_charset,decoded).first
- else
- charseted = decoded
- end
- rescue
- decoded
- end
-
- end
-
- end
-
- class Part
-
- attr_accessor :idx,:parent_id
+ #def decoded_and_charseted
+ #begin
+ #if not charset.upcase == 'UTF-8'
+ #charset.nil? ? source_charset = $defaults["msg_unknown_charset"] : source_charset = charset
+ #charseted = Iconv.iconv("UTF-8",source_charset,decoded).first
+ #else
+ #charseted = decoded
+ #end
+ #rescue
+ #decoded
+ #end
+ #end
+
def isImage?
not (content_type =~ /^image/).nil?
end
@@ -39,61 +35,7 @@ module Mail
def getSize
body.raw_source.size
end
-
- def decoded_and_charseted
- begin
- if not charset.upcase == 'UTF-8'
- charset.nil? ? source_charset = $defaults["msg_unknown_charset"] : source_charset = charset
- charseted = Iconv.iconv("UTF-8",source_charset,decoded).first
- else
- charseted = decoded
- end
- rescue
- decoded
- end
-
- end
-
-
- end
-
- class Field
- def charseted
- begin
- if value =~ /\=\?([\w\-]+)\?/
- source_charset = $1
- if source_charset.upcase == 'UTF-8'
- return decoded
- end
- else
- source_charset = $defaults["msg_unknown_charset"]
- end
- Iconv.iconv("UTF-8",source_charset,decoded).first
- rescue
- decoded
- end
- end
- end
-
- class Address
- def charseted
- begin
- if value =~ /\=\?([\w\-]+)\?/
- source_charset = $1
- if source_charset.upcase == 'UTF-8'
- return decoded
- end
- else
- source_charset = $defaults["msg_unknown_charset"]
- end
- Iconv.iconv("UTF-8",source_charset,decoded).first
- rescue
- decoded
- end
- end
- end
-
- class Part
+
def filename_charseted
begin
if content_type =~ /\=\?([\w\-]+)\?/
@@ -109,6 +51,98 @@ module Mail
filename
end
end
+
end
+ class Part
+
+ attr_accessor :idx,:parent_id
+
+ #def isImage?
+ #not (content_type =~ /^image/).nil?
+ #end
+
+ #def isText?
+ #not (content_type =~ /^text\/plain/).nil?
+ #end
+
+ #def isHtml?
+ #not (content_type =~ /^text\/html/).nil?
+ #end
+
+ #def getSize
+ #body.raw_source.size
+ #end
+
+ #def decoded_and_charseted
+ #begin
+ #if not charset.upcase == 'UTF-8'
+ #charset.nil? ? source_charset = $defaults["msg_unknown_charset"] : source_charset = charset
+ #charseted = Iconv.iconv("UTF-8",source_charset,decoded).first
+ #else
+ #charseted = decoded
+ #end
+ #rescue
+ #decoded
+ #end
+
+ #end
+
+
+ end
+
+ #class Field
+ #def charseted
+ #begin
+ #if value =~ /\=\?([\w\-]+)\?/
+ #source_charset = $1
+ #if source_charset.upcase == 'UTF-8'
+ #return decoded
+ #end
+ #else
+ #source_charset = $defaults["msg_unknown_charset"]
+ #end
+ #Iconv.iconv("UTF-8",source_charset,decoded).first
+ #rescue
+ #decoded
+ #end
+ #end
+ #end
+
+ #class Address
+ #def charseted
+ #begin
+ #if value =~ /\=\?([\w\-]+)\?/
+ #source_charset = $1
+ #if source_charset.upcase == 'UTF-8'
+ #return decoded
+ #end
+ #else
+ #source_charset = $defaults["msg_unknown_charset"]
+ #end
+ #Iconv.iconv("UTF-8",source_charset,decoded).first
+ #rescue
+ #decoded
+ #end
+ #end
+ #end
+
+ #class Part
+ #def filename_charseted
+ #begin
+ #if content_type =~ /\=\?([\w\-]+)\?/
+ #source_charset = $1
+ #if source_charset.upcase == 'UTF-8'
+ #return filename
+ #end
+ #else
+ #source_charset = $defaults["msg_unknown_charset"]
+ #end
+ #Iconv.iconv("UTF-8",source_charset,filename).first
+ #rescue
+ #filename
+ #end
+ #end
+ #end
+
end
diff --git a/lib/tasks/.gitkeep b/lib/tasks/.gitkeep
old mode 100644
new mode 100755
diff --git a/lib/tasks/clear_db.rake b/lib/tasks/clear_db.rake
new file mode 100755
index 0000000..b12913c
--- /dev/null
+++ b/lib/tasks/clear_db.rake
@@ -0,0 +1,23 @@
+namespace :db do
+
+ desc "Removes all users data from db"
+ task :remove_all_data => :environment do
+ users = User.all
+ puts "Number of users in db: #{users.size}"
+ puts "Deleting data....."
+ User.destroy_all
+ puts "Done"
+ end
+
+ desc "Deletes users data (messages,folders,contacts)"
+ task :remove_users_data => :environment do
+ users = User.all
+ users.each do |u|
+ puts "Removing folders & messages for user #{u.email}"
+ u.folders.destroy_all
+ puts "Removing contacts for user #{u.email}"
+ u.contacts.destroy_all
+ end
+ end
+
+end
diff --git a/log/.gitkeep b/log/.gitkeep
old mode 100644
new mode 100755
diff --git a/public/404.html b/public/404.html
old mode 100644
new mode 100755
diff --git a/public/422.html b/public/422.html
old mode 100644
new mode 100755
diff --git a/public/500.html b/public/500.html
old mode 100644
new mode 100755
diff --git a/public/favicon.ico b/public/favicon.ico
old mode 100644
new mode 100755
diff --git a/public/robots.txt b/public/robots.txt
old mode 100644
new mode 100755
diff --git a/test/fixtures/.gitkeep b/test/fixtures/.gitkeep
old mode 100644
new mode 100755
diff --git a/test/functional/.gitkeep b/test/functional/.gitkeep
old mode 100644
new mode 100755
diff --git a/test/integration/.gitkeep b/test/integration/.gitkeep
old mode 100644
new mode 100755
diff --git a/test/performance/browsing_test.rb b/test/performance/browsing_test.rb
old mode 100644
new mode 100755
diff --git a/test/test_helper.rb b/test/test_helper.rb
old mode 100644
new mode 100755
diff --git a/test/unit/.gitkeep b/test/unit/.gitkeep
old mode 100644
new mode 100755
diff --git a/vendor/assets/javascripts/.gitkeep b/vendor/assets/javascripts/.gitkeep
old mode 100644
new mode 100755
diff --git a/vendor/assets/stylesheets/.gitkeep b/vendor/assets/stylesheets/.gitkeep
old mode 100644
new mode 100755
diff --git a/vendor/plugins/.gitkeep b/vendor/plugins/.gitkeep
old mode 100644
new mode 100755