customization

Django Admin Customizing

强颜欢笑 提交于 2019-12-03 14:15:07
问题 I am designing an admin interface where invite mails will be sent to users. My Invitation model is ready & in my invitation admin interface I am able to see my added users for which the admin can send email invites. now I want to customize this a bit. I want to add for each row a SEND button which will actually send an email to that user. Sending email function etc. are all ready. I am not getting as to how I can customize this admin template to add a send button. Can someone help ?? or

Symfony2 customize form error messages

廉价感情. 提交于 2019-12-03 14:05:20
can you please help me understand how to customize error messages in a form with Symfony2? I want to change the HTML layout, adding div, class, etc... Reading the guide, it gives a piece of code to put in a file called fields_errors.html.twig but it doesn't tells where to put this file and if some extra configuration is needed. Can somebody help me? You have to put the template in Resourses/views/ folder of your bundle. For example, {# Vendor/YourBundle/Resourses/views/form_fields.html.twig #} {% extends 'form_div_layout.html.twig' %} {% block form_errors %} {# your form error template #} {%

CakePHP customize flash message

二次信任 提交于 2019-12-03 13:48:47
问题 Normally, the $this->Session->setFlash(__('My message.')); Will output: <div id="flashMessage" class="message"> My message. </div> How can I change that, so it'll output: <p class="notification> My message. </p> instead? 回答1: If you look at the source code you will see that the second parameter of the SessionComponent method is the name of an element: function setFlash($message, $element = 'default', $params = array(), $key = 'flash') You can create a file in views/elements (or Views/Elements

Ruby On Rails: pluralize for other languages

让人想犯罪 __ 提交于 2019-12-03 12:31:22
I am building apps for a non-english audience. Right now, I use english nouns to name my models, yet I prefer to use native dutch ones. As the convention uses the plural of the class name for tables, I assume it is the pluralize method inside Rails (where it resides, I wouldn't know). How can I change the pluralize method and where is it located? Would this break Rails? I am using Rails 2.3.5 and Ruby 1.8.7 Example: The Book class becomes books now. My Boek class becomes boeks , but it is grammatically correct to use boeken Christian Lescuyer Add your rules to an inflections.rb file in config

How do I customize text color in IPython?

只愿长相守 提交于 2019-12-03 11:02:41
问题 I'd like to customize the color of text in IPython, but am not sure how to do it. I know that in Python, I can do this by ending sys.ps1 and sys.ps2 with an ANSI color code such as sys.ps1=">>> \001\033[0m\033[34m\002" But the corresponding approach, using PromptManager.in_template , does not work for IPython. For example c = get_config() c.PromptManager.in_template = 'In [{count}] : {color.Blue}' has no effect on the color of text after the prompt. Is there a way to change the color of text

custom postfix notation, Apply / Function

ε祈祈猫儿з 提交于 2019-12-03 09:35:01
问题 I would like to set up the following custom notation in Mathematica 7. This notation is not particularly useful in itself, so please do not suggest existing alternatives, or point out that this only saves a few keystrokes. I want to know if and how it may be done. At present, one may enter f = #2 + #^2 / #3 & @@ # & ; f[ {a, b, c} ] Out[]= b + a^2 / c Where the inner function #^2 / #3 + #2 & is Apply 'd to the first argument. I would like to implement the syntax f = #2 + #^2 / #3 @@& ; and

How to customize the will_paginate link base?

蓝咒 提交于 2019-12-03 09:08:49
<%= will_paginate(@posts) %> # will generate the links like this '<a href="/posts?page=n">a link</a>' What should I do if I want to change the href base on /contents , etc. <a href="/contents?page=n">a link</a> ? It seems that there is no options for this , help! You will probably have to write your own LinkRenderer. See this blog post, and the code for LinkRenderer. Briefly: in environment.rb you need something like this: WillPaginate::ViewHelpers.pagination_options[:renderer] = 'MyLinkRenderer' in application_helper.rb class MyLinkRenderer < WillPaginate::LinkRenderer def page_link(page,

How to create a new “templates” category on Xcode 4 and use my own file templates there?

自古美人都是妖i 提交于 2019-12-03 08:11:48
I would like to start using my own templates for iOS applications. I don't want any significant changes, but simpler things like add/remove some boilerplate code add some pragma mark sections hardcode my company's name and some comments for every file change the indentation etc etc etc The idea is that we will share these templates when we create apps, but at the same time we want to keep the default template files that Xcode 4 already provides. So, in the following screenshot, how can I add a "CompanyName Application" section that contains exactly the same templates (Navigation-based, View

Modifying Window Button Colors in Mac OS X

Deadly 提交于 2019-12-03 07:36:33
问题 How can I modify the red/yellow/green window buttons for close/minimize/zoom in Mac OS X? There must be an editable resource or plist somewhere. Here are the buttons I'm talking about: For red/green colorblind individuals, those colors can be maddening. I wish they chose the actual bluish shade of green used in a traffic light instead of the puke grass green. That grassy green is indeterminable from the red. Changing the theme to graphite is a poor alternative, so any other method is much

Are there any standards for tmlanguage keyword types?

瘦欲@ 提交于 2019-12-03 07:08:22
问题 .tmlanguage files work by defining a list of key value pairs. Regular expressions are the keys and the type of syntax is the value. This is done in the following XML-ish manner: <key>match</key> <string>[0-9]</string> <key>name</key> <string>constant.numeric</string> My main question is: Is there a list of values that could go in place of constant.numeric if the file is to be used by a text editor like Sublime? 回答1: For a basic introduction, check out the Language Grammars section of the