Move all modals into shared views/modal directory
This commit is contained in:
parent
3885c24825
commit
96309eb8ba
|
@ -45,7 +45,7 @@ class Ajax::GroupController < ApplicationController
|
|||
@status = :okay
|
||||
@success = true
|
||||
@message = I18n.t('messages.group.create.okay')
|
||||
@render = render_to_string(partial: 'user/modal_group_item', locals: { group: group, user: target_user })
|
||||
@render = render_to_string(partial: 'modal/group/item', locals: { group: group, user: target_user })
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
|
|
@ -29,6 +29,6 @@
|
|||
= nav_entry t('views.sessions.new'), new_user_registration_path
|
||||
|
||||
- if user_signed_in?
|
||||
= render 'shared/modal_ask_followers'
|
||||
= render 'modal/ask'
|
||||
%button.btn.btn-primary.btn-fab.d-block.d-sm-none{"data-target" => "#modal-ask-followers", "data-toggle" => "modal", :type => "button"}
|
||||
%i.fa.fa-pencil-square-o
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
.tab-pane.active{role:"tabpanel", id: "grouplist"}
|
||||
%ul.list-group.groups--list
|
||||
- current_user.groups.each do |group|
|
||||
= render 'user/modal_group_item', group: group, user: @user
|
||||
= render 'modal/group/item', group: group, user: @user
|
||||
.tab-pane{role:"tabpanel", id: "create"}
|
||||
.modal-body
|
||||
%input#new-group-name.form-control{type: :text, placeholder: t('views.modal.group.name')}
|
|
@ -0,0 +1,13 @@
|
|||
#modal-passwd.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-passwd-label", :role => "dialog", :tabindex => "-1"}
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
.modal-header
|
||||
%h5#modal-passwd-label.modal-title= t 'views.settings.account.modal.title'
|
||||
%button.close{"data-dismiss" => "modal", :type => "button"}
|
||||
%span{"aria-hidden" => "true"} ×
|
||||
%span.sr-only= t 'views.actions.close'
|
||||
.modal-body
|
||||
= f.password_field :current_password, autocomplete: "off", label: t('views.settings.account.password_current'), help: t('views.settings.account.password_current_help')
|
||||
.modal-footer
|
||||
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"}= t 'views.actions.cancel'
|
||||
%button.btn.btn-primary{:type => "submit"}= t 'views.actions.save'
|
|
@ -0,0 +1,19 @@
|
|||
#modal-privileges.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-privileges-label", :role => "dialog", :tabindex => "-1"}
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
.modal-header
|
||||
%h5#modal-privileges-label.modal-title
|
||||
= raw t('views.actions.privilege', user: @user.screen_name)
|
||||
%button.close{"data-dismiss" => "modal", :type => "button"}
|
||||
%span{"aria-hidden" => "true"} ×
|
||||
%span.sr-only= t 'views.actions.close'
|
||||
%ul.list-group.groups--list
|
||||
= render :partial 'modal/privileges/item', privilege: 'blogger', description: t('views.modal.privilege.blogger'), user: @user
|
||||
= render :partial 'modal/privileges/item', privilege: 'contributor', description: t('views.modal.privilege.contributor'), user: @user
|
||||
= render :partial 'modal/privileges/item', privilege: 'translator', description: t('views.modal.privilege.translator'), user: @user
|
||||
- if current_user.has_role?(:administrator)
|
||||
= render :partial 'modal/privileges/item', privilege: 'supporter', description: t('views.modal.privilege.supporter'), user: @user
|
||||
= render :partial 'modal/privileges/item', privilege: 'moderator', description: t('views.modal.privilege.moderator'),user: @user
|
||||
= render :partial 'modal/privileges/item', privilege: 'admin', description: t('views.modal.privilege.admin'), user: @user
|
||||
.modal-footer
|
||||
%button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'
|
|
@ -4,7 +4,7 @@
|
|||
%ul.comments
|
||||
- a.comments.order(:created_at).each do |comment|
|
||||
%li{data: { comment_id: comment.id }}
|
||||
%div{class: "ab-comment-smile-list", style: "height: 0; width: 0"}= render "shared/comment_smiles", comment: comment
|
||||
%div{class: "ab-comment-smile-list", style: "height: 0; width: 0"}= render "modal/comment_smiles", comment: comment
|
||||
.media.comments--media
|
||||
.pull-left
|
||||
%img.img-rounded.answerbox--img{src: gravatar_url(comment.user)}
|
||||
|
|
|
@ -7,20 +7,7 @@
|
|||
.card
|
||||
.card-body
|
||||
= bootstrap_form_for(resource, as: resource_name, url: '/settings/account', html: { method: :put }) do |f|
|
||||
/ Password field modal
|
||||
#modal-passwd.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-passwd-label", :role => "dialog", :tabindex => "-1"}
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
.modal-header
|
||||
%h5#modal-passwd-label.modal-title= t 'views.settings.account.modal.title'
|
||||
%button.close{"data-dismiss" => "modal", :type => "button"}
|
||||
%span{"aria-hidden" => "true"} ×
|
||||
%span.sr-only= t 'views.actions.close'
|
||||
.modal-body
|
||||
= f.password_field :current_password, autocomplete: "off", label: t('views.settings.account.password_current'), help: t('views.settings.account.password_current_help')
|
||||
.modal-footer
|
||||
%button.btn.btn-default{"data-dismiss" => "modal", :type => "button"}= t 'views.actions.cancel'
|
||||
%button.btn.btn-primary{:type => "submit"}= t 'views.actions.save'
|
||||
= render 'modal/password', f: f
|
||||
|
||||
= devise_error_messages!
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
#modal-privileges.modal.fade{"aria-hidden" => "true", "aria-labelledby" => "modal-privileges-label", :role => "dialog", :tabindex => "-1"}
|
||||
.modal-dialog
|
||||
.modal-content
|
||||
.modal-header
|
||||
%h5#modal-privileges-label.modal-title
|
||||
= raw t('views.actions.privilege', user: @user.screen_name)
|
||||
%button.close{"data-dismiss" => "modal", :type => "button"}
|
||||
%span{"aria-hidden" => "true"} ×
|
||||
%span.sr-only= t 'views.actions.close'
|
||||
%ul.list-group.groups--list
|
||||
= render 'user/modal_privileges_item', privilege: 'blogger', description: t('views.modal.privilege.blogger'), user: @user
|
||||
= render 'user/modal_privileges_item', privilege: 'contributor', description: t('views.modal.privilege.contributor'), user: @user
|
||||
= render 'user/modal_privileges_item', privilege: 'translator', description: t('views.modal.privilege.translator'), user: @user
|
||||
- if current_user.has_role?(:administrator)
|
||||
= render 'user/modal_privileges_item', privilege: 'supporter', description: t('views.modal.privilege.supporter'), user: @user
|
||||
= render 'user/modal_privileges_item', privilege: 'moderator', description: t('views.modal.privilege.moderator'),user: @user
|
||||
= render 'user/modal_privileges_item', privilege: 'admin', description: t('views.modal.privilege.admin'), user: @user
|
||||
.modal-footer
|
||||
%button.btn.btn-primary{name: 'checked-privileges', type: :button, data: { dismiss: :modal }}= t 'views.actions.done'
|
|
@ -22,7 +22,7 @@
|
|||
= t 'views.actions.load'
|
||||
.visible-xs= render 'shared/links'
|
||||
- if user_signed_in?
|
||||
= render 'user/modal_group_memberships'
|
||||
= render 'modal/group'
|
||||
- if current_user.mod? and @user != current_user
|
||||
= render 'user/modal_privileges'
|
||||
= render 'user/modal_ban'
|
||||
= render 'modal/privileges'
|
||||
= render 'modal/ban'
|
||||
|
|
Loading…
Reference in New Issue