I need to remove the save as button from openerp upload field. Can someone please help me.
First go below path.
7.0-web => addons => web => static => src => xml => base.xml
Now find class="oe_form_binary_file_save_data" and comment that whole <a> tag.
<!--a class="oe_form_binary_file_save_data">
<button class="oe_button oe_form_binary_file_save" type="button" title="Save As">
<img t-att-src='_s + "/web/static/src/img/icons/gtk-save.png"'/>
<span>Save As</span>
</button>
</a-->
After refresh browser and it will remove a Save As button.
Related
I'm pretty new to PrestaShop and PHP, I was asked to transform the current accordion checkout steps of PrestaShop 1.7 (classic theme) into a steps progress bar. I've got some good enough notions of CSS and a bit of JavaScript but I'm totally at lost when I look at the PrestaShop files. :(
Here some code (what's in comment is what I tried to add to create the steps progress bar).
The checkout-process.tpl is a mystery:
{foreach from=$steps item="step" key="index"}
{render identifier = $step.identifier
position = ($index + 1)
ui = $step.ui
{* steps = $steps *}
}
{/foreach}
Then I've got the checkout-step.tpl:
{block name='step'}
{* <div id="checkout-steps">
<ul id="checkout-steps__bar">
{foreach from=$steps item="step" key="index"}
<li id="{$step.identifier}" class="step-title h3">{$step.title}</li>
{/foreach}
</ul>
</div> *}
<section id="{$identifier}" class="{[
'checkout-step' => true,
'-current' => $step_is_current,
'-reachable' => $step_is_reachable,
'-complete' => $step_is_complete,
'js-current-step' => $step_is_current
]|classnames}">
<h1 class="step-title h3">
<i class="material-icons rtl-no-flip done"></i>
<span class="step-number">{$position}</span>
{$title}
<span class="step-edit text-muted">
<img src="{$urls.img_url}/icn/edit.png" alt="{l s='Update' d='Shop.Theme.Actions'}" class="icn-16" />
{l s='Edit' d='Shop.Theme.Actions'}</span>
</h1>
<div class="content">
{block name='step_content'}DUMMY STEP CONTENT{/block}
</div>
</section>
{/block}
I managed to got the title by editing CheckoutProcess.php:
public function render(array $extraParams = array())
{
$scope = $this->smarty->createData(
$this->smarty
);
$params = array(
'steps' => array_map(function (CheckoutStepInterface $step) {
return array(
'identifier' => $step->getIdentifier(),
'ui' => new RenderableProxy($step),
// Add title to steps array
'title' => $step->getTitle(),
);
}, $this->getSteps()),
);
$scope->assign(array_merge($extraParams, $params));
$tpl = $this->smarty->createTemplate(
$this->template,
$scope
);
return $tpl->fetch();
}
I don't think I'm doing the right thing but if I almost understood what's happening there, I've got no clue where to begin. -_-"
If anybody got some advices or even better (one can always dream) already attempt this kind of modification, I'll be glad for any information, help, code example!!
Thanks in advance.
It took me a while and it's probably not the best way to go, but I managed the transformation by adding my progress bar then overriding the default behaviour with custom CSS and JavaScript.
It's a lot of code, I'm not sure it's useful I post it there but if anyone want some information or the code, I will share it gladly!
I am working in angular-9 , there are many things which works on reloading, but not after navigation. eg: there are two components A and B. and another component c have a reveal modal code(in foundation).
c component is to be included in both A and B.from component A through navigation I can move to component B which is a another page.
c.ts:
import { FormControl, Validators, FormBuilder,FormGroup, FormGroupDirective } from '#angular/forms';
loginFormControl:FormGroup;
ngOnInit() {
$('#loginModal').foundation();
this.loginFormControl = this.formBuilder.group({
phone_number: ''
});
}
c.html
<div class="reveal" id="loginModal" data-reveal>
<form class="loginForm" [formGroup]="loginFormControl"
(ngSubmit)="onSubmit()">
<input placeholder="Enter Mobile Number" formControlName="phone_number">
<button type="submit" class="button">LOGIN</button>
</form>
<button class="close-button" data-close aria-label="Close modal" type="button">
<span aria-hidden="true">×</span>
</button>
</div>
If I open the modal 'c' in both of the pages A and B on a click of two buttons on both pages with $('#loginModal').foundation('open'); in A.ts and B.ts files, it results me with some unexpected behavior.
1. the modal is open in both the pages. no issue related to view
2. But events of that modal(click,change) or if I enter phone number, It doesn't accept it from user. Even there no event works in a page until i refresh or reload the page.
3. After refreshing a page it will work on that page (including all
events and inputs), there won't be any issue in that page after reloading. but as i navigate to another component B, then it's(c) events and input won't work until i refresh this page too. this same will happen again with component A.
I haven't reach at any solution of this till now and why is this happening. Please let me know if anyone have solution of my problem. It would be fruitful for me.
I want to navigate to another page after logging in with facebook. Right now I am able to log in using Facebook and stay on the same page, but i want to navigate to another page.
My .html file is
<button ion-button full (click)="loginWithFB()">Login!</button>
<ion-card *ngIf="userData; else facebookLogin">
<ion-card-header>{{ userData.username }}</ion-card-header>
<img [src]="userData.picture" />
<ion-card-content>
<p>Email: {{ userData.email }}</p>
<p>First Name: {{ userData.first_name }}</p>
</ion-card-content>
</ion-card>
My .ts file is
loginWithFB() {
this.facebook.login(['email', 'public_profile']).then((response: FacebookLoginResponse) => {
this.facebook.api('me?fields=id,name,email,first_name,picture.width(720).height(720).as(picture_large)', []).then(profile => {
this.userData = {email: profile['email'], first_name: profile['first_name'], picture: profile['picture_large']['data']['url'], username: profile['name']}
});
});
}
You just need to push the page using navController in the promise returned after your facebook login call:
this.facebook.api('me?fields=id,name,email,first_name,picture.width(720).height(720).as(picture_large)', []).then(profile => {
this.userData = {email: profile['email'], first_name: profile['first_name'], picture: profile['picture_large']['data']['url'], username: profile['name']};
this.navCtrl.push(PageName, PageParametersIfAny);
});
There's two ways of pushing a page:
Importing the page directly from it's file if you haven't lazy loaded your application.
Just passing the string containing the page name if it's lazy loaded.
Like this if not lazy loaded:
import { MyPage } from 'path/to/my/page/folder';
...
this.navCtrl.push(MyPage);
or this if lazy loaded:
this.navCtrl.push('MyPage'); // There's no import
Hope this helps.
Can anyone tell me how to integrate Bootstrap into my Wordpress theme for the navigation menus? I just want a simple explanation that is easy to follow because I am a beginner coder.
There is a great tutorial located here https://a1websitepro.com/boostrap-nav-menu-wordpress/ You can use this in your header.php or wherever you are putting you menu.
<nav class="navbar navbar-default"><div class="container-fluid">
<?php wp_nav_menu( array(
'container' => 'ul',
'menu_class' => 'nav navbar-nav',
'menu_id' => 'bootmenu',
'echo' => true,
'theme_location' => 'main-menu',
) );?>
</div>
</nav>
I have an edit action that I would like to put on a modal window on my App, and when it's closed I need to refresh a part of my view.
Does anybody knows how can I do that using Rails 4?
Lets assume you want to open the user edit page in a modal. Here's the solution I prefer:
# Create a ajax link somewhere that opens the user modal:
<%= link_to user.name, edit_user_path(user), remote: true %>
# This link calls your controller action:
class UsersController < ApplicationController
def edit
#user = User.find(params[:id])
render_js_modal(:any_id, 'edit')
end
end
class ApplicationController
def render_js_modal(id, partial, options)
#id = id
#partial = partial
#options = options
respond_to do |format|
format.js { render 'application/render_modal' }
end
end
end
# The view depends on which CSS library you are using. This
# example is if you use semantic ui. If you use something like
# bootstrap you will probably need to create a bit more html in the JS.
# views/application/render_modal.js.erb:
$(body).append('<div id="<%= #id %>"></div>');
var element = $('#<%= #id %>');
element.html('<%= j(render partial: #partial, #options) %>');
element.modal('show');
Hope this helps. If you get any errors, remember to look in the rails server log for details. For JS details look in the browser console. Note you can pass locals to the partial in the options param. You can create many other useful methods like this:
render_js_modal_hide: hide a modal on screen by id. Useful when the user is created successfully. Consider replacing the page flash messages with the JS response as well.
render_js_content_replace: replaces a div on the page with the content of provided partial. This is useful for replacing the content of a modal if there are validation errors.
etc.
I've done this in that way (using Slim):
.text-center = link_to 'Visualizar Documentos', 'Visualizar Documentos', class: 'btn btn-default btn-primary btn-large', "data-toggle" => "modal", "data-target" => "#meioambiente"
.modal.fade id="meioambiente" tabindex="-1" role="dialog" aria-labelledby="meioambiente-label" aria-hidden="true"
And everything worked perfectly. Thanks!
Twitter Bootstrap and ZURB Foundation both have modal components. You will need to use JavaScript to update the DOM.
Codecademy is a free online learning website and have great tutorials to learn JavaScript and jQuery. I would also suggest Code School since they have a free course on JavaScript, jQuery and Angular.js.