servers view

master
Wojciech Todryk 2011-09-24 22:13:45 +02:00
parent 9e31ca239d
commit 9bb5f3a20f
9 changed files with 65 additions and 12 deletions

View File

@ -1,10 +1,15 @@
## Changes
#### Version 0.8.4
#### 0.8.5 candidate
* servers view
* identity modification
#### 0.8.4
* calendar view as separate gem
* adding bluecloth for rendering markdown text
#### Version 0.8.3
#### 0.8.3
* export, imports of contact

View File

@ -1,6 +1,6 @@
source 'http://rubygems.org'
gem 'rails', '~>3.0.7'
gem 'rails', '~>3.0.9'
gem 'mysql2' , '~>0.2.7'
gem 'will_paginate', '~> 3.0.beta'

View File

@ -325,5 +325,8 @@ def content_for_sidebar
s
end
def boolean_answer(answer)
answer == true ? t(:true_answer,:scope=>:common) : t(:false_answer,:scope=>:common)
end
end

View File

@ -1,2 +1,16 @@
module PrefsHelper
def servers_table_header
html = ""
$defaults["servers_table_fields"].each do |f|
html << "<th>"
if params[:sort_field] == f
params[:sort_dir].nil? ? dir = 'desc' : dir = nil
end
html << link_to(Server.human_attribute_name(f), {:controller => 'prefs',:action => 'servers',:sort_field => f,:sort_dir => dir}, {:class=>"header"})
html << "</th>"
end
html
end
end

View File

@ -13,6 +13,8 @@ msg_image_thumbnail_size: [128x128, 128x96, 192x192, 192x144, 256x256, 256x192]
contacts_table_fields: [nick, first_name, last_name, email, info]
contacts_per_page: 25
servers_table_fields: [name, port, use_ssl, use_tls, for_imap, for_smtp, auth]
msgs_per_page: 20
msgs_refresh_time: 300
msgs_send_type: html

View File

@ -17,6 +17,7 @@ pl:
record_invalid: Nieprawidłowy format danych
models:
contact: Kontakt
server: Serwer
attributes:
contact:
nick: Pseudonim
@ -47,6 +48,12 @@ pl:
last_name: Nazwisko
server:
name: Nazwa serwera
port: Port
use_ssl: SSL?
use_tls: TLS?
for_imap: IMAP?
for_smtp: SMTP?
auth: Metoda autoryzacji
contact:
compose_to_selected: Napisz do wybranych
@ -175,6 +182,8 @@ pl:
current_version: Aktualna wersja
common:
false_answer: Nie
true_answer: Tak
file_format_error: Błędny format pliku
no_tmp_dir: Brak katalogu tymczasowego
must_be_unique: musi być unikalny

View File

@ -0,0 +1,9 @@
<td><%= check_box_tag "cids[]", server.id %></td>
<td nowrap="nowrap"><%= server.name %></td>
<td nowrap="nowrap"><%= server.port %></td>
<td nowrap="nowrap"><%= boolean_answer(server.use_ssl) %></td>
<td nowrap="nowrap"><%= boolean_answer(server.use_tls) %></td>
<td nowrap="nowrap"><%= boolean_answer(server.for_imap) %></td>
<td nowrap="nowrap"><%= boolean_answer(server.for_smtp) %></td>
<td nowrap="nowrap"><%= server.auth %></td>
<td nowrap="nowrap">&nbsp;</td>

View File

@ -0,0 +1,16 @@
<table class="table">
<tbody>
<tr>
<th class="first"><input id="toggleall" class="checkbox toggle" type="checkbox" name="allbox"/></th>
<%= raw servers_table_header %>
<th class="last"></th>
</tr>
<% trclass = :even %>
<% @servers.each do |s| %>
<tr class="<%= trclass.to_s %>">
<%= render :partial => 'prefs/server', :object => s %>
</tr>
<% trclass == :even ? trclass = :odd : trclass = :even %>
<% end %>
</tbody>
</table>

View File

@ -13,15 +13,10 @@
<div class="content"><div class="secondary-navigation">
<%= raw prefs_navigation(:servers_tab) %>
</div>
<div class="inner"> <%= form_tag(prefs_update_servers_path,:name=>'prefs') %>
<div class="columns wat-cf">
<div class="column left">
<%= render :partial => 'prefs/servers_left' %>
</div>
<div class="column right">
<%= render :partial => 'prefs/servers_right' %>
</div>
</div></form>
<div class="inner">
<%= form_tag(prefs_update_servers_path,:name=>'prefs') %>
<%= render :partial => 'prefs/servers_list' %>
</form>
</div>
</div>
</div>