From 1bc8796b5f8bf40c6e9bf89f0d9742b6d84400a5 Mon Sep 17 00:00:00 2001 From: Arpit Goyal Date: Tue, 8 Jul 2014 22:29:55 +0530 Subject: [PATCH] changes to make bootstrap compatible with webapps plugin --- app/views/webapps/_form.html.slim | 18 ++++----- app/views/webapps/_list.html.slim | 2 +- app/views/webapps/_name.html.slim | 4 +- app/views/webapps/_path.html.slim | 4 +- .../webapps/_permission_webapp.html.slim | 6 +-- app/views/webapps/_user_permissions.html.slim | 8 ++-- app/views/webapps/_webapp.html.slim | 38 +++++-------------- app/views/webapps/_webapp_aliases.html.slim | 4 +- app/views/webapps/permissions.html.slim | 2 +- lib/webapps/engine.rb | 8 +--- 10 files changed, 35 insertions(+), 59 deletions(-) diff --git a/app/views/webapps/_form.html.slim b/app/views/webapps/_form.html.slim index 7a2173a..45f5961 100755 --- a/app/views/webapps/_form.html.slim +++ b/app/views/webapps/_form.html.slim @@ -5,21 +5,21 @@ :ok_icon_path => theme_image_path('ok.png'), \ :error_icon_path => theme_image_path('stop.png') \ }, \ - :class => 'webapp create-form', \ + :class => 'webapp create-form form-horizontal', \ :id => 'webapp-new' \ } do |f| fieldset legend   #{t 'create_a_new_webapp'}   .create-inside - .control-group - .controls= f.text_field :name, :size => 16, :maxlength => 20, :value=>'', :placeholder => t('name') + .control-group.form-group + .controls= f.text_field :name, :size => 16, :maxlength => 20, :value=>'', :placeholder => t('name'), :class=>'form-control' - .control-group - .controls= f.text_field :path, :size => 16, :maxlength => 64, :value=>'', :placeholder => t('root_path').html_safe + .control-group.form-group + .controls= f.text_field :path, :size => 16, :maxlength => 64, :value=>'', :placeholder => t('root_path').html_safe, :class=>'form-control' b="/html" - .control-group.create-btn - .controls + .control-group.form-group.create-btn + .controls.col-xs-offset-2.col-xs-10 = spinner - = button_tag t('create'), :type => 'submit', :id => 'webapp_create_button', :class => 'btn btn-create' - = link_to t('cancel'), '#', :class => 'close-area cancel-link', :data => {:related => '#new-webapp-to-step1'} + = button_tag t('create'), :type => 'submit', :id => 'webapp_create_button', :class => 'btnn btn-create btn btn-info' + = link_to t('cancel'), '#', :class => 'close-area cancel-link btn btn-primary left-margin-10', :data => {:related => '#new-webapp-to-step1'} diff --git a/app/views/webapps/_list.html.slim b/app/views/webapps/_list.html.slim index 9511270..df95fcc 100755 --- a/app/views/webapps/_list.html.slim +++ b/app/views/webapps/_list.html.slim @@ -1,7 +1,7 @@ #webapps-table .settings-table - if @webapps.size > 0 - table.settings + table.settings.table thead tr th.settings-col1.webapps-col1 scope="col" = t 'name' diff --git a/app/views/webapps/_name.html.slim b/app/views/webapps/_name.html.slim index 44b51e5..2e7ecc4 100644 --- a/app/views/webapps/_name.html.slim +++ b/app/views/webapps/_name.html.slim @@ -8,5 +8,5 @@ a.click_change = h(@webapp.name) :name => :name, :method => :put, :remote => true, - :form_css_class => "edit_form form_hidden", - :cancel_class => "cancel_link" \ No newline at end of file + :form_css_class => "edit_form form_hidden form-horizontal", + :cancel_class => "cancel_link btn-primary btn left-margin-10 btn-sm " \ No newline at end of file diff --git a/app/views/webapps/_path.html.slim b/app/views/webapps/_path.html.slim index eaa606c..f39e48f 100644 --- a/app/views/webapps/_path.html.slim +++ b/app/views/webapps/_path.html.slim @@ -8,5 +8,5 @@ a.click_change = h(@webapp.path) :name => :path, :method => :put, :remote => true, - :form_css_class => "edit_form form_hidden", - :cancel_class => "cancel_link" \ No newline at end of file + :form_css_class => "edit_form form_hidden form-horizontal", + :cancel_class => "cancel_link btn-primary btn left-margin-10 btn-sm" \ No newline at end of file diff --git a/app/views/webapps/_permission_webapp.html.slim b/app/views/webapps/_permission_webapp.html.slim index a2970ab..047bf70 100644 --- a/app/views/webapps/_permission_webapp.html.slim +++ b/app/views/webapps/_permission_webapp.html.slim @@ -3,9 +3,9 @@ - uid = @webapp.id.to_s - @users_allowed = WebappAccess.find_or_create(@webapp.id).getUsers div.webapp[id="whole_webapp_#{uid}"] - table.settings.stretchtoggle id="webapp_row_#{uid}" + table.settings.table.stretchtoggle id="webapp_row_#{uid}" tr - td.settings-col1.webapps-col1 + td.settings-col1.webapps-col1.settings-col1-pad = link_to(@webapp.name, '') td.settings-col2.webapps-col2 id="webapp_url_#{uid}" a href=("http://#{webapp.name}") target="_blank" @@ -18,7 +18,7 @@ div.webapp[id="whole_webapp_#{uid}"] b= h(@webapp.name) |   .settings-fields - table + table.table -for item in @users -@user = item tr[id="permission_webapp#{@webapp.id}_user#{@user.id}"] diff --git a/app/views/webapps/_user_permissions.html.slim b/app/views/webapps/_user_permissions.html.slim index 442a6ef..e0e4b5f 100644 --- a/app/views/webapps/_user_permissions.html.slim +++ b/app/views/webapps/_user_permissions.html.slim @@ -7,11 +7,11 @@ td = link_to("[x]",webapps_engine.remove_permission_webapp_path(:id => @user.id,:webapp_id=>@webapp.id), {:remote=>true, :method=>:delete, :class=>'edit_form user_access_delete_icon'}) - else a.click_change Add access password - form.edit_form.form_hidden action=webapps_engine.add_permission_webapp_path(:id => @user.id,:webapp_id=>@webapp.id) data-remote="true" method="post" style=("display: none;") - input name="password" type="password" placeholder="Enter User login password" - button.btn.btn-create.margin-for-message type="submit" + form.edit_form.form_hidden.form-inline action=webapps_engine.add_permission_webapp_path(:id => @user.id,:webapp_id=>@webapp.id) data-remote="true" method="post" style=("display: none;") + input.form-control.input-sm name="password" type="password" placeholder="Enter User login password" + button.btn.btn-create.margin-for-message.btn-info.left-margin-10.btn-sm type="submit" span = t('add') - a.cancel_link Cancel + a.cancel_link.btn-primary.btn.left-margin-10.btn-sm Cancel span.spinner.theme-image style=("display: none") .messages diff --git a/app/views/webapps/_webapp.html.slim b/app/views/webapps/_webapp.html.slim index 9071ea3..29b0dff 100644 --- a/app/views/webapps/_webapp.html.slim +++ b/app/views/webapps/_webapp.html.slim @@ -3,9 +3,9 @@ - uid = webapp.id.to_s - return if webapp.nil? div.webapp[id="whole_webapp_#{uid}"] - table.settings.stretchtoggle id="webapp_row_#{uid}" + table.settings.table.stretchtoggle.table-condensed id="webapp_row_#{uid}" tr - td.settings-col1.webapps-col1 + td.settings-col1.webapps-col1.settings-col1-pad = link_to(webapp.name, '') td.settings-col2.webapps-col2 id="webapp_url_#{uid}" a href=("http://#{webapp.name}") target="_blank" @@ -27,9 +27,9 @@ div.webapp[id="whole_webapp_#{uid}"] :method => :delete, :id => "delete-webapp-#{webapp.id}", :data => { :confirm => "Are you sure you want to delete "+ webapp.name}, - :class => 'btn-delete delete_webapp remote-btn' + :class => 'btn btn-primary btn-sm btn-delete navbar-right delete_webapp remote-btn' .settings-fields - table + table.table.table-condensed tr td = t 'name' @@ -41,10 +41,7 @@ div.webapp[id="whole_webapp_#{uid}"] - else = h webapp.name - tr - td   - td   - td   + tr td = t 'aliases' @@ -52,10 +49,7 @@ div.webapp[id="whole_webapp_#{uid}"] td = render :partial => 'webapp_aliases', :locals => { :@webapp => webapp } td - tr - td   - td   - td   + tr td = t('root_path').html_safe @@ -67,10 +61,7 @@ div.webapp[id="whole_webapp_#{uid}"] - else = h(webapp.path) | /html/ - tr - td   - td   - td   + tr td = t 'logs' @@ -79,10 +70,7 @@ div.webapp[id="whole_webapp_#{uid}"] td = h(webapp.path) | /logs/ - tr - td   - td   - td   + tr td = t 'url' @@ -91,10 +79,7 @@ div.webapp[id="whole_webapp_#{uid}"] td a href=("http://#{h webapp.name}") target="_" | http://#{h webapp.name} - tr - td   - td   - td   + tr td = t 'access' @@ -102,10 +87,7 @@ div.webapp[id="whole_webapp_#{uid}"] td   td valign="top" = render :partial => 'login_required', :locals => { :webapp => webapp } - tr - td   - td   - td   + tr td = t 'created' diff --git a/app/views/webapps/_webapp_aliases.html.slim b/app/views/webapps/_webapp_aliases.html.slim index 343faf2..3e536b3 100644 --- a/app/views/webapps/_webapp_aliases.html.slim +++ b/app/views/webapps/_webapp_aliases.html.slim @@ -11,8 +11,8 @@ div id="webapp_aliases_#{uid}" :name => :name, :method => :post, :remote => true, - :form_css_class => "edit_form form_hidden", - :cancel_class => "cancel_link" + :form_css_class => "edit_form form_hidden form-horizontal", + :cancel_class => "cancel_link btn-primary btn left-margin-10 btn-sm" .messages diff --git a/app/views/webapps/permissions.html.slim b/app/views/webapps/permissions.html.slim index f106f24..669b0cf 100644 --- a/app/views/webapps/permissions.html.slim +++ b/app/views/webapps/permissions.html.slim @@ -1,7 +1,7 @@ #webapps-table .settings-table - if @webapps.size > 0 - table.settings + table.settings.table thead tr th.settings-col1.webapps-col1 scope="col" = t 'name' diff --git a/lib/webapps/engine.rb b/lib/webapps/engine.rb index ef9685f..5f955ce 100755 --- a/lib/webapps/engine.rb +++ b/lib/webapps/engine.rb @@ -7,12 +7,6 @@ class Engine < ::Rails::Engine initializer :assets do |config| Rails.application.config.assets.paths << root.join("app", "assets", "images") end - initializer :append_migrations do |app| - unless app.root.to_s.match root.to_s - config.paths["db/migrate"].expanded.each do |expanded_path| - app.config.paths["db/migrate"] << expanded_path - end - end - end + end end