Skip to content

Commit

Permalink
Merge pull request #220 from cercomp/218_pequenos_ajustes
Browse files Browse the repository at this point in the history
218 pequenos ajustes
  • Loading branch information
marcello committed May 5, 2015
2 parents b3b522a + 36751dc commit a355e2a
Show file tree
Hide file tree
Showing 53 changed files with 605 additions and 260 deletions.
26 changes: 23 additions & 3 deletions app/assets/stylesheets/application.css.scss
Expand Up @@ -196,6 +196,14 @@ body.modal-open {
border-bottom-right-radius: 4px;
}

.tab-pane{
padding: 19px;
}

.optional{
margin-left: 0px !important;
}

.highlight:hover td{
background-color: #EEE !important;
}
Expand Down Expand Up @@ -233,6 +241,7 @@ body.modal-open {

#repo_list > div.row > div > div > a > img{
height: 160px;
background-color: #F5F5F5;
}


Expand Down Expand Up @@ -261,8 +270,10 @@ div#available_components div > div.thumbnail img {
background-color: #DFF0D8 !important;
}

input[type="checkbox"].toggle { margin-top: 0; }

input[type="checkbox"].toggle { margin-top: 0;}
input[type="checkbox"] {
margin: 3px 0 0;
}
.nav-header {
text-transform: uppercase;
font-size: 11px;
Expand All @@ -288,6 +299,11 @@ input[type="checkbox"].toggle { margin-top: 0; }
}
.form-group {
margin-top: 20px;
margin-left: 0px !important;
padding-right: 10px;
label{
font-weight: bold !important;
}
}

//Paginator
Expand All @@ -306,7 +322,11 @@ input[type="checkbox"].toggle { margin-top: 0; }
}

li .checkbox {
height: 20px;
height: 10px;
}

.checkbox label {
padding-left: 5px;
}

.center{
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/groupings/_form.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for [:admin, @grouping], html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:admin, @grouping] do |f| %>
<%= f.show_errors %>
<%= f.input :name %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/notifications/_form.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for [:admin, @notification], html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:admin, @notification] do |f| %>
<%= f.show_errors %>
<%= f.input :title %>
<%= f.input :body,
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/roles/_form.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for [:admin, @role], html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:admin, @role] do |f| %>
<%= f.show_errors %>
<%= f.input :name %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/sites/_form.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for [:admin, @site], html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:admin, @site] do |f| %>
<%= f.show_errors %>
<%= f.input :name, :hint => t("field_required"), :input_html => {:pattern => '^[a-z0-9_\-]+$'} %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/users/edit.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for [:admin, @user], :url => admin_user_path, html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:admin, @user], :url => admin_user_path do |f| %>
<%= f.show_errors %>
<%= render :partial => "form", :object => f %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/admin/users/new.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for [:admin, @user], html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:admin, @user] do |f| %>
<%= f.show_errors %>
<%= render :partial => "form", :object => f %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/profiles/edit.html.erb
@@ -1,5 +1,5 @@
<div id="profile">
<%= simple_form_for @profile, url: profile_path, html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for @profile, url: profile_path do |f| %>
<div class="row">
<div class="col-md-3">
<div class="avatar">
Expand Down
4 changes: 2 additions & 2 deletions app/views/sites/_form.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for @site, url: update_site_admin_path, html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for @site, url: update_site_admin_path do |f| %>
<%= f.show_errors %>
<%= repository_search t(".site_image"), "site_image",
Expand All @@ -17,7 +17,7 @@
<%= f.input :title, :input_html => {:maxlength => 50} %>
<%= f.input :description, :input_html => {:rows => 8}, :hint => t(".site_comments"), :as => :text %>
<%= f.input :view_desc_pages, :hint => t(".view_desc_pages_help"), :as => :boolean %>
<%= f.input :view_desc_pages, :hint => t(".view_desc_pages_help"), :as => :boolean, wrapper: :checkbox %>
<%= f.input :theme, :collection => @themes.collect{|name| [t("themes.#{name}.title"), name]} %>
<%= f.input :body_width, :hint => t(".example_width") %>
<%= f.input :per_page, :hint => t(".example_per_page") %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sites/admin/backups/index.html.erb
Expand Up @@ -9,7 +9,7 @@
</ul>
<div class="tab-content">
<div class="tab-pane <%= params["restore"] ? "" : "active" %>" id="backup">
<%= form_tag site_admin_generate_path, html: { class: 'form-horizontal' }, method: 'get' do %>
<%= form_tag site_admin_generate_path, method: 'get' do %>
<div class="row">
<div class="col-md-6">
<%= t('.output') %>
Expand Down
7 changes: 1 addition & 6 deletions app/views/sites/admin/components/_form.html.erb
Expand Up @@ -11,7 +11,7 @@
<%= render_component @component, 'form', locals: {f: f} %>
<hr/>

<%= f.input :publish , wrapper_html: { class: "side" }, as: :boolean, input_html: { class: "check-button" } %>
<%= f.input :publish, wrapper: :checkbox, wrapper_html: { class: "side" }, as: :boolean, input_html: { class: "check-button" } %>
<%= f.input :visibility, collection: [
[t(".always"),"0"],
Expand All @@ -22,10 +22,7 @@
%>

<div class="form-group">
<div class="col-md-3 control-label">
<label><%= t(".place") %></label>
</div>
<div class="col-md-7">
<% if params[:placeholder] %>
<% if params[:placeholder].match(/^\d*$/) %>
<% group = current_site.components.find_by(id: params[:placeholder].to_i) %>
Expand All @@ -44,8 +41,6 @@
<% end %>
<% end %>
<%= f.input :place_holder, as: :hidden, input_html: {id: "component_place_holder"} %>
</div>
</div>

<div class="form-actions">
<%= f.button :submit, class: 'btn btn-primary', disable_with: t("please_wait") %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sites/admin/layouts/settings.html.erb
@@ -1,6 +1,6 @@
<% breadcrumb :layout_settings %>
<%= simple_form_for current_site, url: settings_site_admin_layouts_path, html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for current_site, url: settings_site_admin_layouts_path do |f| %>
<%= f.input :head_html, input_html: { id: 'code' }, hint: t('.head_html_hint') %>

<div class="form-actions">
Expand Down
2 changes: 1 addition & 1 deletion app/views/sites/admin/menus/_form.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for [:site_admin, @menu], html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:site_admin, @menu] do |f| %>
<%= f.show_errors %>
<%= f.input :name,
Expand Down
8 changes: 4 additions & 4 deletions app/views/sites/admin/menus/menu_items/_form.html.erb
@@ -1,5 +1,5 @@
<% title ".menus" %>
<%= simple_form_for [:site_admin, @menu, @menu_item], html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:site_admin, @menu, @menu_item] do |f| %>
<%= f.show_errors %>
<% if @menu_item_parent %>
Expand All @@ -16,7 +16,7 @@
<%= each_i18n_tab available_locales(@menu_item) do |locale| %>
<%= f.i18ns_fields_for(locale) do |g| %>
<% unless g.object.id.blank? %>
<%= g.input :_destroy, as: :boolean %>
<%= g.input :_destroy, wrapper: :checkbox, as: :boolean %>
<% end %>
<%= g.input :title, placeholder: t(".title"),
Expand All @@ -31,12 +31,12 @@
<%= target_dialog_input(f, :target, true) %>
<div class="input">
<%= f.input :new_tab,
<%= f.input :new_tab, wrapper: :checkbox,
as: :boolean, input_html: { class: "check-button" } %>
</div>

<div class="input">
<%= f.input :publish,
<%= f.input :publish, wrapper: :checkbox,
as: :boolean, input_html: { class: "check-button" } %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/views/sites/admin/pages/_form.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for [:site_admin, @page], html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:site_admin, @page] do |f| %>
<%= f.show_errors %>
<%= render('translates_form', f: f) %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sites/admin/pages/_target_dialog_input.html.erb
Expand Up @@ -3,7 +3,7 @@

<div class="input target_select" id="inputs-for-<%= field_name.to_s %>">
<%= f.input field_name, :wrapper => :append do %>
<%= f.input_field field_name, as: :string,
<%= f.input_field field_name, as: :string,
disabled: !editable_url,
value: editable_url ? f.object.send(field_name) : f.object.send(field_name).try(:title),
placeholder: editable_url ? "" : t("target_dialog.none_selected"),
Expand Down
2 changes: 1 addition & 1 deletion app/views/sites/admin/pages/_translates_form.html.erb
@@ -1,6 +1,6 @@
<%= each_i18n_tab available_locales(@page) do |locale| %>
<%= f.i18ns_fields_for(locale) do |g| %>
<%= g.input :_destroy, as: :boolean if g.object.try(:id) %>
<%= g.input :_destroy, wrapper: :checkbox, as: :boolean if g.object.try(:id) %>
<%= g.input :title %>
<%= g.input :text,
input_html: {class: "mceAdvance", style: " height: 320px;"},
Expand Down
@@ -1,5 +1,5 @@
<div class="form-group">
<div class="input add-multiple-files col-md-7 col-md-offset-3">
<div class="input add-multiple-files">
<%= link_to link_title, "#",
{data: {:'place-name' => place_name, :'field-name' => field_name, :'multiple' => multiple, :'file-types' => file_types.to_s},
class: 'add-button btn btn-info'} %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/sites/admin/roles/_form.html.erb
@@ -1,4 +1,4 @@
<%= simple_form_for [:site_admin, @role], html: { class: 'form-horizontal' } do |f| %>
<%= simple_form_for [:site_admin, @role] do |f| %>
<%= f.show_errors %>
<%= f.input :site_id, :input_html => {:value => @site.id}, :as => :hidden if @site %>
Expand Down
46 changes: 23 additions & 23 deletions app/views/sites/admin/styles/_form.html.erb
Expand Up @@ -4,42 +4,42 @@
<%= f.input :name,
hint: t("field_required") %>
<%= f.input :publish , wrapper_html: { class: "side" }, as: :boolean, input_html: { class: "check-button" } %>
<%= f.input :publish, wrapper: :checkbox, wrapper_html: { class: "side" }, as: :boolean, input_html: { class: "check-button" } %>
<% unless @style.new_record? %>
<div class="form-group">
<div class="col-md-9 col-md-offset-3">
<div class="btn-toolbar">
<div class="btn-group">
<%= link_to t(".format"),"javascript:autoFormatSelection()", class: "btn btn-default btn-sm" %>
<%= link_to t(".comment"),"javascript:commentSelection(true)", class: "btn btn-default btn-sm" %>
<%= link_to t(".uncomment"),"javascript:commentSelection(false)", class: "btn btn-default btn-sm" %>
<%= link_to t(".insert_image"), "javascript:insertImage()", class: "btn btn-default btn-sm" %>
</div>
<%= f.button :button, t(".apply"), type: :button, disabled: :disabled, class: "btn-apply btn btn-primary btn-sm" unless @style.new_record? %>
</div>

<div class="btn-group">
<%= link_to t(".format"),"javascript:autoFormatSelection()", class: "btn btn-default btn-sm" %>
<%= link_to t(".comment"),"javascript:commentSelection(true)", class: "btn btn-default btn-sm" %>
<%= link_to t(".uncomment"),"javascript:commentSelection(false)", class: "btn btn-default btn-sm" %>
<%= link_to t(".insert_image"), "javascript:insertImage()", class: "btn btn-default btn-sm" %>
</div>
</div>
<%= f.button :button, t(".apply"), type: :button, disabled: :disabled, class: "btn-apply btn btn-primary btn-sm" unless @style.new_record? %>
<%= f.input :css,
as: :text,
wrapper_html: { class: 'nostyle' },
input_html: {class: 'style-editor', id: 'code' } %>

<div class="form-group">
<div class="col-md-7 col-md-offset-3">
<%= link_to icon('question-sign', text:t(".help_with_style")),
(current_settings.help_site || "/help"),
target: "_blank"%>
</div>
</div>
<%= link_to icon('question-sign', text:t(".help_with_style")),
(current_settings.help_site || "/help"),
target: "_blank" %>
<% content_for :stylesheets, stylesheet_link_tag("codeMirror/codemirror") %>
<% content_for :javascripts, javascript_include_tag("init/codemirror") %>
<% content_for :javascripts do %>
<script type="text/javascript">
var editor = CodeMirror.fromTextArea(document.getElementById("code"), {
mode: 'css',
lineNumbers: true,
mode: "css",
tabSize: 2,
extraKeys: {
"Ctrl-Space": "autocomplete",
"F11": function(cm) {
cm.setOption("fullScreen", !cm.getOption("fullScreen"));
},
"Esc": function(cm) {
if (cm.getOption("fullScreen")) cm.setOption("fullScreen", false);
}
},
onCursorActivity: function() {
editor.setLineClass(hlLine, null, null);
hlLine = editor.setLineClass(editor.getCursor().line, null, "activeline");
Expand All @@ -48,7 +48,7 @@
$('.btn-apply').prop('disabled',false);
}
});
var hlLine = editor.setLineClass(0, "activeline");
//var hlLine = editor.setLineClass(0, "activeline");
//CodeMirror.commands["selectAll"](editor);

$('.btn-apply').click(function(){
Expand Down
20 changes: 8 additions & 12 deletions config/initializers/simple_form.rb
Expand Up @@ -32,11 +32,10 @@ def input_html_classes
config.wrappers :append, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :placeholder
b.use :label, wrap_with: { class: 'col-md-3 control-label' }
b.wrapper tag: 'div', class: 'col-md-7' do |append|
b.use :label
b.wrapper tag: 'div', class: 'url' do |append|
append.use :input, wrap_with: { tag: 'div', class: 'input-group' }
end
b.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
b.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
end

Expand Down Expand Up @@ -65,11 +64,10 @@ def input_html_classes

config.wrappers :checkbox, tag: 'div', class: 'form-group', error_class: 'has-error' do |b|
b.use :html5
b.use :label, wrap_with: { class: 'col-md-3 control-label' }
b.wrapper tag: 'div', class: 'col-md-7' do |input_block|
input_block.use :input
input_block.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
b.wrapper tag: 'div', class: 'checkbox' do |ba|
ba.use :label_input
end
b.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
b.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
end

Expand All @@ -81,11 +79,9 @@ def input_html_classes
b.use :placeholder
b.optional :pattern
b.optional :readonly
b.use :label, wrap_with: { class: 'col-md-3 control-label' }
b.wrapper tag: 'div', class: 'col-md-7' do |input_block|
input_block.use :input
input_block.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
end
b.use :label
b.use :input
b.use :hint, wrap_with: { tag: 'span', class: 'help-block' }
b.use :error, wrap_with: { tag: 'span', class: 'help-block has-error' }
end

Expand Down
8 changes: 7 additions & 1 deletion lib/assets/javascripts/init/codemirror.js
Expand Up @@ -2,5 +2,11 @@
//=require codeMirror/formatting.min
//=require codeMirror/javascript.min
//=require codeMirror/css.min
//=require codeMirror/fullscreen.min
//=require codeMirror/xml.min
//=require codeMirror/htmlmixed.min
//=require codeMirror/htmlmixed.min
//=require codeMirror/javascript-hint.min
//=require codeMirror/show-hint.min
//=require codeMirror/dialog.min
//=require codeMirror/search.min
//=require codeMirror/searchcursor.min
6 changes: 4 additions & 2 deletions lib/assets/javascripts/init/tinymce.js
Expand Up @@ -93,7 +93,8 @@ $(document).ready(function() {
relative_urls: false,
toolbar_items_size: 'small',
file_browser_callback: callback,
setup: editorSetup
setup: editorSetup,
resize: "both"
});

$('textarea.mceSimple').tinymce({
Expand All @@ -109,7 +110,8 @@ $(document).ready(function() {
file_browser_callback: callback,
toolbar: "undo redo | bold italic underline strikethrough | forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist | link unlink image | removeformat | code preview fullscreen",
language : $("html").attr("lang"),
setup: editorSetup
setup: editorSetup,
resize: "both"
});

});
2 changes: 1 addition & 1 deletion lib/weby/components/image/views/_form.html.erb
Expand Up @@ -6,7 +6,7 @@
<%= target_dialog_input f, :target, true %>
<%= f.input :new_tab, as: :boolean %>
<%= f.input :new_tab, wrapper: :checkbox, as: :boolean %>
<%= f.input :html_class, :input_html => {:pattern => '^[A-Za-z0-9_\-]*$'} %>

0 comments on commit a355e2a

Please sign in to comment.