Commit Graph

12672 Commits

Author SHA1 Message Date
Eeshan Garg a4dbb30543 for_education: Add better screenshots with proper size.
The screenshots we have currently don't really fit into the width
available and the font looks too small. This commit adds newer
screenshots that have been scaled to fit a width of 400px such that
the font is readable with a small amount of content.
2021-07-23 14:03:41 -07:00
Riken Shah 67f4851ded user_status: Add `get_emoji_info` function.
This is a prep commit to add the status emoji feature.

This function will add missing/extra parameters to the
emoji info object, that would need by the template to
render an emoji.

Co-authored-by: Yash Rathore <33805964+YashRE42@users.noreply.github.com>
2021-07-23 13:03:32 -07:00
Riken Shah b7b18cdfd3 emoji_picker: Update architecture to support status emoji.
This is a prep commit to add the status emoji feature.

We update the templates associated with the emoji
picker to add class `status_emoji` to `emoji` in the
popover.  So we can later add the events when the user
selects the emoji.

We also update the functions in `emoji_picker.js` to
support opening emoji picker popover in the 'set_status_
overlay`.

We also increase the `z-index` of the `popover-flex`
class (This class is only added to popover-emoji content
if the view is mobile), so in the mobile view the emoji
popover doesn't go behind the '#set_user_status_modal'.
2021-07-23 13:03:13 -07:00
Riken Shah 98710d67a2 refactor: Rename Set a status message/Edit status message button text.
In this commit,

* We rename `Set a status message` to `Set a status`
and
* We rename `Edit status message` to `Edit status`

for more clarity.
2021-07-23 12:57:51 -07:00
manavdesai27 9cebd1ec80 markdown: Fixed hr visibility in day theme.
Tweaked by tabbott to use a simpler approach proposed by the author in
the PR.
2021-07-23 12:48:43 -07:00
Aman Agrawal e977f42819 case-studies: Add links back to /for/education page.
Transfer case study title to hero image.
Used the same education background for image.
2021-07-23 12:25:03 -07:00
PIG208 60e3429da3 bots: Remove the need to debounce for dispatching bot events.
We rely on calling eventually_render_bots from the event handling
code path for bot events to both updating the list and switching
the tab.

Now we decouple the logic and make render_bots take care of
rendering the list of bots only and switch the tab upon calling
the success handler of creating the bot.

Fixes: zulip#17743
2021-07-23 11:26:42 -07:00
Eeshan Garg 78ff74d3fd landing_page: Fix anchor links on landing pages.
As it turns out, anchor links on headings only worked on our /help and
/api pages but were broken everywhere else. This commit adds the
required JS to scroll properly when an anchor link on any of our
various landing pages is clicked. We already have similar code to
accomplish this in help.js.

We verified with console logging, browser Sources inspection, and
checking source files that help.js and landing-page.js are never
included in the same page, but we add comments to make this
architecture clear.

Fixes #19349.
2021-07-23 10:29:41 -07:00
Tim Abbott 5e591f840b css: Fix night styling for deactivated pills.
The new styling isn't perfect, but it's also not obviously broken.

We also move the existing day theme styling to the appropriate files.
2021-07-22 15:29:00 -07:00
Tim Abbott 99e6618f07 compose: Fix validation treating welcome bot as deactivated. 2021-07-22 15:22:20 -07:00
Priyansh Garg c541699b9b compose: Fix expanded compose un-collapsible in presence of navbar_alerts.
The distance of compose-box from the top is hardcoded in the existing
code as `50px`, which only considers the height of the `.header`, plus the
padding-bottom of the header. This results in a bug where the top bar of
compose-box gets hidden behind the header if navbar_alerts is also present
in the view.

This commit calculates the top distance of the compose-box dynamically,
whenever the compose-box is opened and set the `top` property of the
compose-box accordingly.

Tested on my Ubuntu development environment.

Fixes: #19249.
2021-07-22 14:25:48 -07:00
Abhijeet Prasad Bodas d0b3801596 ui_init: Fix "Error: Unknown user_id in get_by_user_id: 0".
For spectators (logged view), we send user_id=0 via page_params.

The people module does not know about this user ID, and so throws the
exception. Earlier `people.get_by_user_id` was not called on page load,
but only when determining settings permissions with `settings_data.user_has_permission`.

But 231c536cad made it so that that function
is always called, so we need to handle the spectator case explicitly.

Co-authored-by: Gaurav Pandey <gauravguitarrocks@gmail.com>
2021-07-22 14:06:13 -07:00
Priyansh Garg 9fe61944e9 compose: Fix compose-preview size in expanded mode.
The CSS properties used to make the `#compose-textarea` full-size
were missing for the `#preview_message_area`, thus, it was just
getting to the height as specified in the `max-height` property
of `#preview_compose_box`.

Adding the missing CSS properties resolved the problem, but only
for not-too-long messages. For very-long messages, the preview
message area was overflowing the parent container (attaining the
maximum height possible according to the content, due to the absence
of max-height), which led to the controls below compose-box to
disappear.

Adding an additional property of `height: 1.5em` solved this problem,
as if a height lower than min-height is set to an element, it attains
its min-height.

Tested manually on my Ubuntu Development environment.

Fixes: #19243.
2021-07-22 12:51:04 -07:00
Aman Agrawal df3fc22e92 for-events: Change header image. 2021-07-22 12:03:35 -07:00
Aman Agrawal 45758ad14f plans: Add buttons to /for pages. 2021-07-22 11:57:32 -07:00
aryanshridhar 049ec674df move_topic: Toggle checkbox by clicking it's label as well.
This commit adds the support to toggle `send_notification`
checkbox by clicking over its corresponding label as well.

It is a similar case as the checkboxes within organization
settings.
2021-07-22 11:07:49 -07:00
aryanshridhar 89e60ef938 message_edit: Toggle checkbox by clicking it's label as well.
This commit adds the support to toggle `send_notification`
checkbox by clicking over its corresponding label as well.

It is a similar case as the checkboxes within organization
settings.
2021-07-22 11:07:49 -07:00
Aryan Shridhar 3991fb3ea6 Revert "message_edit: Replace checkboxes with settings_checkbox partial."
This reverts commit 54a1c73c78.
2021-07-22 11:07:49 -07:00
Sahil Batra 318d71469b api: Remove '/users/me/enter-sends' endpoint.
We remove the '/users/me/enter-sends' endpoint
and 'enter_sends' setting will now be edited
using the '/settings' endpoint.
2021-07-22 11:01:43 -07:00
Ganesh Pawar a2aea23da4 stream_ui: Fix subscription button out of sync.
cb4797e3b7 rearranged the stream templates
but didn't change the selector for the subscibe button.

Fixes #19290
2021-07-21 22:02:33 -07:00
Tim Abbott b03cab8ced plans: Update descriptions of plans.
These descriptions are both more accurate (there were embarrassingly a
few errors in the previous text about what was actually included in
what plan), as well as making clear that Zulip's free self-hostable
version includes essentially all the non-services features of
enterprise editions of competing products.
2021-07-21 17:47:55 -07:00
Aman Agrawal 56ce1f9f63 portico: Add pricing widget from /plans to for-education page. 2021-07-21 12:13:25 -07:00
Aman Agrawal ef74b41777 portico: Use final versions of illustrations for /for pages. 2021-07-21 10:44:53 -07:00
aryanshridhar 54a1c73c78 message_edit: Replace checkboxes with settings_checkbox partial.
This commits replaces the custom `send_notification` message_edit
checkboxes with our `settings_checkbox` partial.

The main intention is to also support the feature of selecting a
checkbox by clicking over its corresponding label as we have
in the case of the organization settings checkboxes.

Due to above change, this commit also removes the redundant
`break-row` HTML class along with it styles.
2021-07-21 10:43:18 -07:00
Sahil Batra 7662b088f5 sponsorship: Fix alignment of inputs in sponsorship form.
All the inputs of form has 'width: 100%' property but then
also the width of inputs were different because of box-sizing
property. The select input had 'box-sizing: border-box' style
but the others did not, so this commit adds this style to
the other inputs - text type input and the textarea input,
to fix the alignment.

Adding 'box-sizing: border-box' changes the actual height of
the normal text type input because the default input height
of 20px set by bootstrap now includes padding and border also,
so we add 'height: 30px' style to make its height same as the
select input.

Fixes #19332.
2021-07-21 08:58:09 -07:00
Aman Agrawal 3c024b2fba portico: Add /for/education, /for/events, /for/research pages.
These modern landing pages cover use cases previously not detailed on
our website. Technically, we had a /for/research page before, but it
wasn't finished or linked everywhere.

Removed "function-url-quotes" stylelint rule
since I need to use quotes in url to use an
svg as list bullet point. There are spacing issues
using it as an image. Also, using quotes in url
is actually the recommended way to do it otherwise
there could be issue with escaping.
2021-07-20 22:37:52 -07:00
Vishnu KS 199d3859fb billing: Make create_ajax_request accept callback function.
This is a prep commit for the Stripe checkout migration.

create_ajax_request function used to create an ajax request to our
billing API and on completion redirect to one of the URLs in our
website. The stripe migration requires the ajax request function to
execute Stripe javascript code post the request completion to redirect
to Stripe checkout page. So this commit updates the function to accept a
callback function which gets executed post the request completion.
2021-07-20 14:43:38 -07:00
Priyank Patel 231c536cad settings_data: Break circular dependency with people. 2021-07-20 14:28:48 -07:00
m-e-l-u-h-a-n c7be17eb73 stream settings: Use buddy list logic for filtering users.
Our logic for filtering subscribed users in stream setting was
buggy and gave irrelevant filters based on email matching.

We correct it by using same logic as we use for filtering in
buddy list.
2021-07-20 14:27:58 -07:00
Eeshan Garg 09a3ebf1e4 landing_page: Link to case studies in the top navigation. 2021-07-20 12:35:11 -07:00
Eeshan Garg 13e566815d landing_page: Fix top navigation dropdowns for mobile screens.
A recent PR introduced a bug where navigation dropdowns on the
landing page would not open for tablet/mobile screens. This
commit fixes that issue by using the proper media query to
differentiate between touch and mouse-based devices.
2021-07-20 11:33:56 -07:00
sahil839 b5b7862571 settings: Use '/settings' endpoint for changing notification settings.
We have merged the '/settings/display' and 'settings/notifications'
endpoints to '/settings' in backend. This commit updates the frontend
code to '/settings' endpoint for updating notification settings
instead of '/settings/notifications' endpoint.
2021-07-19 21:14:33 -07:00
sahil839 bbee0fdf6f settings: Use '/settings' endpoint for changing display settings.
We have merged the '/settings/display' and 'settings/notifications'
endpoints to '/settings' in backend. This commit updates the
frontend code to '/settings' endpoint for updating display settings
instead of '/settings/display' endpoint.
2021-07-19 21:14:33 -07:00
Alya Abbott 89724e5bb4 billing: Edit helper text on sponsorship application
* nonprofit -> non-profit
* Edit pass on defautl helper text to use more user-oriented language.
2021-07-19 17:26:45 -07:00
m-e-l-u-h-a-n b23fd2f1f3 stream settings: Move subscription_result template to stream_settings.
This commit moves stream_subscription_request_result.hbs to
stream_settings folder to have a consistent file structure
for stream setting templates.
2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n 70aa957e55 stream settings: Move stream list templates to stream_settings.
We move templates related to listing streams in left pannel of
stream settings overlay to stream_settings folder by making
following changes:

* Rename `subscriptions.hbs` to `browse_streams_list.hbs`.
* Move `settings_stream_list.hbs` to stream_settings folder.
* Rename `subscription.hbs` to `browse_streams_list_item.hbs`.
* Move `settings_stream_list_item.hbs` to stream_settings folder.
2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n 62c9b2916e stream settings: Move small independent templates to stream_settings.
We do following changes to two small independet templates used
in stream_settings area:

* Move subscription_setting_icon.hbs to stream settings folder
  to have a consistent folder structure for stream settings templates.
* Rename `subscription_count.hbs` to `subscriber_count.hbs`.
* Move `subscriber_count.hbs` to `stream_settings` folder.
2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n a61048e167 stream settings: Move subscription_table_body.hbs to stream_settings.
Following changes are done to subscription_table_body.hbs:

* Rename subscription_table_body.hbs to stream_settings_overlay.hbs,
  to have a uniform naming pattern for stream settings templates.

* Move it to stream_settings folder.
2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n 1a5566bf9b stream settings: Move stream_creation_form.hbs to stream_settings. 2021-07-19 10:54:11 -07:00
m-e-l-u-h-a-n cf0f74c7ce stream settings: Move stream_types.hbs to stream_settings folder. 2021-07-19 10:54:11 -07:00
sahil839 0594207180 realm_logo: Rename realm_logo.rerender to realm_logo.render.
As realm_logo.rerender is now used for initial rendering of
logo as well in c8849f8, so we rename this function from
rerender to render.
2021-07-19 09:45:29 -07:00
Dinesh dd1fccd2c2 tippy: Fix blueslip error on edit history timestamp hover.
The timestamp in edit history ui also has .message_time.
We had a tippy hover event attached to .message_time
whose code assumes it to belong to an actual message
which caused an error on hovering the message timestamp
in edit history.

This commit fixes it by making the selector more specific.
2021-07-19 09:34:52 -07:00
Tim Abbott a5afbb60ff ui_init: Initialize people before right_sidebar.
Because the right_sidebar initialization calls user_has_permission, in
organizations that has a waiting period before users become full
members, and only full members can send invitations, Zulip will throw
an exception on startup.
2021-07-19 00:33:02 -07:00
Tim Abbott 0268a4d06a css: Use separate CSS for create_stream_plus_button.
This part of the second commit in #19218 was actually important to the
first commit working.
2021-07-18 23:52:39 -07:00
Tim Abbott 4e876191c3 billing: Fix typo in Standard spelling. 2021-07-18 21:18:55 -07:00
Tim Abbott d7ef0c7232 billing: Fix options and help text for sponsorship requests.
This makes several changes:

* Fixes a bug where the help text explaining our policies was not displayed.
* No help text was defined for many organization types.
* Copy-edits the help text somewhat.
* Offers all of the organization type options.
* Removes the 100% coverage requirement because it's annoying to test
  the e.currentTarget click handler.
2021-07-18 20:48:27 -07:00
Alya Abbott 12d9ad957c billing: Clean up sponsorship form helper text.
- Change to match proposed hero text.
- Fix incorrect statement about event sponsorship; commercial
events should not be sponsored.
2021-07-18 12:15:33 -07:00
sahil839 ceb5333352 images: Rename loader.svg to loader-white.svg for clarity.
We rename loader.svg to loader-white.svg as this svg contains
white rectangles for clarity as we have also added loader-black.svg
which is same but with black rectangles instead of white.
2021-07-18 11:44:17 -07:00
sahil839 fb53556cef loading: Use img tag for loading indicator instead of object tag.
We use img tag for showing the loading spinner in message edit form
and dialog-widget submit button, instead of object tag because using
object tag gives the following error- "Refused to display
'https://chat.zulip.org/' in a frame because it set 'X-Frame-Options'
to 'deny'." in the browser console.

As mentioned by Anders in czo, this is probably because we’re loading
the SVG using an <object> tag as if it’s totally-not-an-IE3-ActiveX-
control.

We also need to add a new svg file similar to loader.svg with the
change that the retangles are filled with black color. This needs
to be done because we cannot get access to the svg document if we
use img tag and so we cannot change the color of rectangles using
jquery as we were doing before to show the spinner depending on
day/night mode. So, now we just set the src attribute of img tag
to the correct svg file depending on day/night mode.

Discussed in #issues > loading tail-spin.svg denied by X-Frame-Options.
2021-07-18 11:44:17 -07:00
sahil839 be8e7fdfb6 upload_widget: Use img tag for tail-spin.svg instead of object tag.
We use img tag for showing the loading spinner in image_upload_widget
instead of object tag because using object tag gives the following
error "Refused to display 'https://chat.zulip.org/' in a frame because
it set 'X-Frame-Options' to 'deny'." in console.

As mentioned by Anders in czo, this is probably because we’re loading
the SVG using an <object> tag as if it’s totally-not-an-IE3-ActiveX-
control.

Discussed in #issues > loading tail-spin.svg denied by X-Frame-Options.
2021-07-18 11:44:17 -07:00
m-e-l-u-h-a-n f377f8a963 stream settings: Move stream setting modals to stream_settings folder.
We do following changes in this commit to have a uniform file
structure for stream setting templates.

* Move change_stream_info_modal.hbs to stream_settings folder.
* Rename subscription_stream_privacy_modal.hbs to
  stream_privacy_setting_modal.hbs.
* Move stream_privacy_setting_modal.hbs to stream_settings folder.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n 36c8923797 stream settings: Move subscription_settings.hbs to stream_settings.
This commmit does following two changes to subscription_settings.hbs:

* Rename subscription_settings to stream_settings to have a uniform
naming pattern for stream settings.
* Move it to stream_settings folder.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n 662d485c15 stream settings: Move stream_settings_checkboxes.hbs to stream_settings. 2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n ee7188e625 stream settings: Move subscription_type.hbs to stream settings folder.
We do follwing changes in this migration:
* Rename subscription_type.hbs to stream_permission_description.
* Move it to stream_settings folder.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n cc983f2b5a stream settings: Move stream privacy icon template to stream_settings.
This commit does following two changes:
* Rename subscription_privacy template to stream_privacy_icon so
that its purpose is clear from its name.
* Move it stream_settings folder.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n c213ed575a stream settings: Move stream description templates to stream_settings. 2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n d82da45564 stream settings: Migrate stream member list template to separate folder. 2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n 661ce2dc25 stream settings: Rename subscription_members.hbs to stream_members.hbs.
This is preparatory commit for migrating stream settings related
templates into a separate folder and have a common naming scheme
for them.
2021-07-18 11:36:39 -07:00
m-e-l-u-h-a-n a63a23087f tooltips: Remove unnecessary checks for message action buttons in tippy.
We handled tooltips for failed message action buttons separately
through our default tippy-zulip-tooltip class because of
a diffrent html structure for these buttons. But as we refactored
html for those buttons to have same structure as for other buttons
in message action this extra check is no more needed.
2021-07-18 11:33:32 -07:00
m-e-l-u-h-a-n e7b1de8ace message view: Show failed message icon tooltips similar to other icons.
We had tooltips bound to failed message action icons, because of
slightly different html structure for these action buttons as
compared to other message action buttons. There were some minor
problems due to this. First there was difference of delay
in which we show other normal action button tooltips. Second
we had to add extra checks to handle tooltip content for these
buttons in tippyjs module.

This is fixed by having same html structure for failed message
buttons as for other message action buttons.
2021-07-18 11:33:32 -07:00
aryanshridhar 594c66edc5 move_topic: Improve the style for dropdown toggle button.
Earlier, the `stream_header_colorblock` wasn't properly styled
with the dropdown toggle button from a UI perspective. This was so
because they had a few space between them due to inconsistencies
in their border radius.

This commit adds an border-radius property to the move topic
dropdown toggle button to eliminate the above issue and
improve it's overall look.
2021-07-16 12:58:15 -07:00
aryanshridhar f4e44228a7 message_edit: Improve the style for dropdown toggle button.
Earlier, the `stream_header_colorblock` wasn't properly styled
with the dropdown toggle button from a UI perspective. This was so
because they had a few space between them due to inconsistencies
in their border radius.

This commit adds an border-radius property to the message_edit
dropdown toggle button to eliminate the above issue and
improve it's overall look.
2021-07-16 12:58:15 -07:00
aryanshridhar 1a2782f95d message_edit: Adjust the height of stream_header_colorblock.
Previously, the message edit `stream_header_colorblock` used
to incorrectly extend down till the textarea which caused
the UI to be buggy.

Fixed this by adding a `margin-bottom` property similar to
what we did in case of Move topic dropdown.

This minor change accidentally was missed within commit
7c25bd1aa8.
2021-07-16 12:58:15 -07:00
Tim Abbott 8f74261d48 drafts: Delete old drafts on page load, not modal launch.
This fixes a bad user experience where clicking to open the drafts
modal causes the number of drafts that you're looking at to suddenly
change.
2021-07-16 12:50:51 -07:00
aryanshridhar af4bd34873 stream_create: Remove unnecessary export keyword.
There's no need for the `create_handlers_for_users`
function to be exported as it's called within its
scope itself.
2021-07-16 08:53:56 -07:00
aryanshridhar d8e2fa5f9c stream_create: Avoid re-initialization of event handlers.
Previously, Everytime the user triggers the Stream create UI
by pressing the `Create stream` button, the
`create_handlers_for_users` function would reinitialize which
created duplicate event handlers for its elements.
This could lead to multiple click events being triggered over the
same element.

One such example was filed as #19255, where the click event was
triggering twice and hence the "Copy from stream" dropdown
would remain folded (closed).

Fixed this by - Initializing the `create_handlers_for_users` function
within the main `set_up_handlers` function, which is triggered only
once upon the opening of Stream create UI.

Fixes #19255.
2021-07-16 08:53:56 -07:00
Wesley Aptekar-Cassels 21fbc94e37 css: Remove some redundant styles.
These links (in addition to the recent topics one) were all already set
as block elements by a rule further up in this same file.
2021-07-15 15:08:50 -07:00
sahil839 711aca3fde settings: Show correct email in user-info form.
This commit fixes the bug of showing custom email to admin in
the user-info form even when email_address_visibility is set
to admins only.

This commit fixes it to show the correct email according to
email_address_visibility values.
2021-07-15 14:26:40 -07:00
Priyansh Garg 3136c08904 compose: Fix compose top-right buttons misalignment. 2021-07-15 14:12:29 -07:00
Eeshan Garg 6036524651 landing_page: Restructure top-level navigation.
This commit restructures the top-level navigation on our landing
page using dropdowns in a manner that allows us to advertise some
important pages to our visitors:

- Use cases for companies, open source projects, and communities.
- Miscellaneous pages about the product are now accessible from the
  "Product" dropdown.
- "Resources" are a few key resources our users may want to consult
  if they need help or support.
2021-07-15 10:56:47 -07:00
Eeshan Garg faa695e86d registration: Collect organization type on sign-up. 2021-07-15 09:58:27 -07:00
sahil839 2f44a08b37 settings: Convert settings_overlay.html to handlebars template.
Fixes #18796.
2021-07-15 08:59:23 -07:00
aryanshridhar 7c25bd1aa8 message_edit: Refactor message_edit to use dropdown_list_widget.
Implemented dropdown_list_widget in message_edit UI
which enables the functionality to search for streams
while moving a particular message across streams.

This matches the UI we have in the "move topic" widget.

Fixes #18416.
2021-07-15 08:27:55 -07:00
sahil839 6a3f22480d settings_emoji: Rename can_admin_emoji to can_delete_emoji. 2021-07-14 14:57:09 -07:00
sahil839 61acf68aa4 emoji: Allow emoji authors to delete the emoji always.
Previously, non-admin emoji authors were allowed to
delete the emoji only if add_emoji_by_admins_only
was false. But, as add_emoji_by_admins_only setting
is for who can add emoji and not delete emojis, it
should not affect the behavior of deleting emojis
and users should always be allowed to delete the
emojis which. they added themselves
2021-07-14 14:57:08 -07:00
Kerry Jackson 5d91a34119 search_icon: Fix contrast color of icon.
Fixes #19053.
2021-07-14 14:53:45 -07:00
sahil839 e736d9d275 settings: Add moderators and full members options in user-group setting.
This commit adds moderators and full members options for user group
settings in frontend.
2021-07-14 14:38:44 -07:00
sahil839 1148937c7b settings: Show tip always in user group settings page.
This commit changes the behavior to show the tip, explaining
which user roles are allowed to edit user groups, to user
with all roles because it is better to show the user which
other roles are allowed to edit. Previously the tip was shown
to non-admin users only.
2021-07-14 14:38:43 -07:00
Tim Abbott a5eb3abc52 css: Fix settings alignment for dialog widget modal. 2021-07-14 13:32:26 -07:00
Tim Abbott c5b455d5c2 dialog_widget: Simplify rendering logic.
This makes the templates a lot more readable.
2021-07-14 13:32:26 -07:00
Tim Abbott e0135e278d dialog_widget: Fix race focusing submit button.
Opening the modal before adding the on_shown handler makes it possible
that the modal could full appear before the handler runs.
2021-07-14 13:32:26 -07:00
Tim Abbott 6fb0d414b4 dialog_widget: Remove is_confirm_dialog variable.
Making the controls declarative makes the system more flexible for
future use cases.
2021-07-14 13:32:24 -07:00
sahil839 fd55df9f7c settings: Use dialog_widget for bot-edit form and remove edit_fields_modal.
This commit changes the bot-edit modal to use dialog_widget instead of
edit_fields_modal.

This commit also removes edit_fields_modal module as it is no longer used.
2021-07-14 13:02:26 -07:00
sahil839 0b21ca725e settings: Use dialog_widget for edit-user-info modal.
This commit changes the edit-user-info modal to use
dialog_widget instead of edit_fields_modal.
The edit_fields_modal module will be removed in
further commits to avoid code duplication.
2021-07-14 13:02:26 -07:00
sahil839 e0ab9e52b5 settings: Use dialog_widget for edit-linkifier modal.
This commit changes the edit-linkifier modal to use
dialog_widget instead of edit_fields_modal.
The edit_fields_modal module will be removed in
further commits to avoid code duplication.
2021-07-14 13:02:26 -07:00
sahil839 f6d8204d23 dialog_widget: Color of button should be according to use of modal.
We show red color for confirmation modals and green for other
modals with input fields.

As of this commit, only confirmation modals use dialog_widget but
some other modals with input fields will be migrated to use
dialog_widget.
2021-07-14 13:02:26 -07:00
sahil839 dff374a48b frontend: Remove html_submit_button paramter passed to dialog_widget.
We used html_submit_button to pass text to be present in the modal
submit button. There are only two possible options as of now -
"Confirm" and "Save changes" and the correct one can be determined
using is_confirm_modal parameter. So, we remove this paramter for
now and we can add it later if we have more type of modals using
this widget.
2021-07-14 13:02:25 -07:00
sahil839 ec3c5547ff frontend: Add dialog_widget module and refactor confirm_dialog.
This commit adds a new dialog_widget.js file containing most
of the code of confirm_dialog.js with some minor changes and
changes confirm_dialog to be a wrapper around dialog_widget.js.
We pass 'is_confim_dialog' as true in dialog_widget for a
confirm_dialog modal. This commit also renames confirm_dialog.hbs
and confirm_dialog_heading.hbs to dialog_widget.js,
dialog_widget.hbs and dialog_widget_heading.hbs respectively.
2021-07-14 12:58:00 -07:00
sahil839 71969f5196 confirm_dialog: Add post_render support in confirm_dialog.
This will be used by other modals when we will migrate
those to use the same code as that of confirm_dialog.
2021-07-14 12:21:24 -07:00
sahil839 c87c4f92ee confirm_dialog: Rename variables and classes used in templates.
This commit renames the variables, functions used in confirm_dialog.js
and classes and ids used in confirm_dialog.hbs.

This change is made so that we can easily migrate edit_fields_modal to
use this same code with some more changes.

We will change the file names and correspondingly import variables in
the next commit.
2021-07-14 12:21:24 -07:00
Gaurav Pandey 269f6fb577 compose: Fix overlaping expand-compose icon.
The expand-compose icon currently overlaps with the
recipient input field of private message compose box.
Reduce the size of the division to fix overlap.
2021-07-14 11:40:16 -07:00
Gaurav Pandey 5e97ec9ad9 narrow: Do not mark messages as read in mentioned narrow.
The current behaviour marks messages as read when in mentioned
narrow. This is not the ideal behaviour, hence do not mark them
as read.

Fixes #19098.
2021-07-14 11:39:46 -07:00
akshatdalton 66ba35d7fe search_operators: Add info about `is:resolved` keyword. 2021-07-13 23:48:45 -07:00
akshatdalton 272901326c narrow_banner: Add banner for no resolved topics found search. 2021-07-13 23:36:24 -07:00
akshatdalton fe9693c824 search_suggestion: Add suggestion support for `is:resolved` keyword. 2021-07-13 23:35:41 -07:00
akshatdalton 6a45379a30 resolve topic: Add frontend support for `is:resolved` search keyword/filtering.
This commit adds the frontend support for `is:resolved` search
keyword. Test cases are added for the same.

Fixes: #18990.
2021-07-13 23:18:41 -07:00
Aman Agrawal a748a2f03c subscription_settings: Improve look of create stream button.
Use the same styling used in send button of compose box.
2021-07-13 16:58:30 -07:00
aryanshridhar 1a3c719967 about_zulip: Indicate the copy icon to be clickable.
Added CSS property of cursor as pointer to the copy
icon in about_zulip section which indicates the
icon to be clickable.

(This minor adjustment was probably missed in a74b52db22)
2021-07-13 16:55:15 -07:00
m-e-l-u-h-a-n 7c0c75b6ca stream settings: Fix scroll issue in subscriber list in stream settings.
As we want subscriber list to occupy rest of available space
in the tab, we use relative units (vh) and calc to set the
max-height property dynamically without losing scroll behavior
for stream list.
2021-07-13 16:50:32 -07:00
Riken Shah 644cd18dfd refactor: Move "send button" related code from `compose_validate.js`.
This commit moves "send button" related code from
`compose_validate.js` to `compose.js` as it makes more
sense there.
2021-07-13 16:45:29 -07:00
Tim Abbott 41dbe8ee6b recipient bars: Make unresolve topic CSS match resolve topic.
This avoids showing a highlighted checkmark for resolve topics, which
looks weird given that the topic name itself contains a "resolve
topic" checkmark.
2021-07-13 09:13:14 -07:00
Riken Shah 801ebba7c7 compose: Avoid showing empty msg error when send by enter is enabled.
We are doing this to avoid annoying behavior, when
"enter sends" is enabled, and the user accidentally hits
"Enter" and has to deal with the error message.

Fixes #19182
2021-07-13 08:29:55 -07:00
Riken Shah 0dbc7e0d21 compose: Improve how we handle over character limit message error.
We improved it in the following ways:
* Show the error message with the maximum character
limit.

* Disable the send button.

* When the user tries to send the message via hotkeys
i.e, When "Press enter to send" is enabled or the user
uses "Shift" + "Enter" shortcut, Flash the red border
around the compose box.

Also renamed `check_and_set_overflow_text` to
`check_overflow_text` for better clarity.
2021-07-13 08:29:55 -07:00
Riken Shah 43e7c2c7fa css: Remove `important` rule from `over_limit` class.
The main reason for doing this is to allow flashing
`box_shadow` animation when the user tried to send
over character limit message.
2021-07-13 08:29:55 -07:00
Riken Shah 4cce23b564 compose: Hide sending indicator when the message failed validation.
This bug was found when the user tries to send a
over character limit message, i.e It has failed the
validation but it still shows the "Sending..." text.
2021-07-13 08:29:55 -07:00
Tim Abbott 0bf13ce5db portico: Add Technical University of Munich case study.
This isn't linked yet, since the main place we'll link to is isn't
added yet.
2021-07-09 13:04:38 -07:00
Priyank Patel 519e8471c9 ts: Convert upload_widget to TypeScript. 2021-07-09 12:42:31 -07:00
Priyank Patel 92912a3b1c ts: Convert compose_error module to TypeScript. 2021-07-09 12:42:31 -07:00
Priyank Patel 97a27eb239 ts: Convert watchdog module to TypeScript. 2021-07-09 12:42:31 -07:00
Priyank Patel fdedced521 ts: Convert password_quality module to TypeScript. 2021-07-09 12:42:31 -07:00
Priyank Patel 5a65a47b21 ts: Convert message_parser module to TypeScript. 2021-07-09 12:42:31 -07:00
Priyank Patel 261df2b4dc js: Rename muting_ui module to muted_topics_ui. 2021-07-09 10:00:45 -07:00
Priyank Patel 05c3164bb8 js: Split out muted_users_ui from muting_ui module. 2021-07-09 10:00:45 -07:00
aryanshridhar 4cd2fab7b0 user_popover: Replace custom email tooltip with tippy tooltip.
This commit essentially migrates our custom email tooltip
to tippy tooltip for displaying user's email when their
names would overflow past the right edge of user popover.

This also removes the `email_tooltip` and `tooltip_holder` HTML
classes aloong with their CSS styles as they no longer used.
2021-07-09 09:55:22 -07:00
m-e-l-u-h-a-n 781179c56a subs: Rename subs.js to stream_settings_ui.js.
We use subs as a common variable name for a collection of stream
data structure used in settings, in lot of modules. So this
rename clears a bunch of related shadowed variables.
2021-07-09 09:38:58 -07:00
m-e-l-u-h-a-n a41d5e58f9 stream settings: Improve UI for editing stream permissions.
This now is much more similar to our normal settings UI.
2021-07-08 17:53:58 -07:00
m-e-l-u-h-a-n 8987fed001 stream settings: Fix hover issue with message retention label.
Another minor issue fixed in this commit is behaviour of cursor
on hovering message retention setting label. We fix it by changing
this element this to be a div instead by label. It could be fixed
by adding a css rule for this instead of changing it to div rather
than label but this looked more stable to future refactors.
2021-07-08 17:53:58 -07:00
m-e-l-u-h-a-n 2daa4eb755 stream settings: Fix label issues with stream permission settings.
Labels for stream post/privacy value settings were not properly
linked with their input element so clicking on labels did not
toggle radio buttons. We fix this by having inputs elements inside
label elements to have correct linking.
2021-07-08 17:53:58 -07:00
m-e-l-u-h-a-n 5de4b2dfbd stream settings: Improve stream name in stream permissions description.
We remove icons (hash | lock | globe) in permission description of
an stream, as it is pretty obvious as we use them at quite a number
of places with stream names, also it does not fits well with rest of
the text in that area.
2021-07-08 17:53:58 -07:00
m-e-l-u-h-a-n 66cf0ae9ff stream settings: Improve stream permissions description in settings.
Previously stream permissions were hard to find and understand
as they were displayed like a paragraph in description format.

We improve them by using a list item for each different permission.
2021-07-08 17:53:58 -07:00
m-e-l-u-h-a-n 64339e6b60 minor: Improve heading for different stream setting subsections. 2021-07-08 17:53:58 -07:00
m-e-l-u-h-a-n 889229ba16 stream settings: Improve message for no description streams. 2021-07-08 17:53:57 -07:00
m-e-l-u-h-a-n 85230e1953 stream settings: Use full space in subscribers tab for listing them.
We increase the height of the widget used for listing subscribers
in stream settings to 100% so that it occupies the remaining
space in the tab.
2021-07-08 17:47:14 -07:00
m-e-l-u-h-a-n 060ae0226c stream settings: Move stream email to General settings tab. 2021-07-08 17:47:14 -07:00
m-e-l-u-h-a-n 8a2cc75e0e stream settings: Clean unnecessary elements in stream settings. 2021-07-08 17:47:14 -07:00
m-e-l-u-h-a-n e8030fadc6 stream settings: Improve title for stream settings based on content.
We had a common title `stream settings` for two cases
when no stream was selected and also when settings for
a particular stream were shown.

To improve this situation we now show `Settings for {stream_name}`
when settings for a particular stream are shown.
2021-07-08 17:47:13 -07:00
m-e-l-u-h-a-n cb4797e3b7 stream settings: Re-design stream settings page using tab-switchers.
We move away from a single scrollable page to have a tabs settings
structure instead.
This commit consists of the minimal changes required to set up toggler
component. And the subsequent commits would include all the UI UX
changes required for updating the layouts.

Co-authored-by: Ryan Rehman <ryanrehman99@gmail.com>
2021-07-08 17:47:13 -07:00
akshatdalton 8c9b2012ca topic_edit_form: Restyle topic edit save button with logo colours.
Similar to what mentioned in 2e196fd5d3
previous sea-green colour didn't meet the WCAG AA standard
guidelines for color contrast. This changes meets WCAG AAA
standard.
2021-07-08 17:45:42 -07:00
akshatdalton 834e8c0b63 tooltip: Improve tooltip visibility for message control buttons.
This change ensures that the tooltip doesn't hide by the
selected message blue border.
2021-07-08 17:41:22 -07:00
akshatdalton 13671b87f5 recipient_row: Shift topic edit form code to the above of external link.
When editing a topic name (and the topic name has some link
in it) through the recipient bar, the external link icon
overlaps with the stream name. Shifting the code now
ensures that the external link icon would appear to the
right of the topic edit form box.

Also see: https://chat.zulip.org/#narrow/stream/9-issues/topic/topic.20edit.20recipient.20bar
2021-07-08 12:39:01 -07:00
aryanshridhar 9049fb3bd4 users: Remove redundant compute_show_invites function.
This commits removes the redundant `compute_show_invites` function
which computes the `show_invites` page parameter in `lib/users.py`.

It is so because, commit 13399833b0 removed
the `show_invites` context variable passed in index.html.
Hence, the `show_invites` page_param key is no
longer required to compute in backend as it can be switched with
`settings_data.user_can_invite_others_to_realm()` in the frontend.

This commits also removes the `test_compute*` tests in
`test_home` that concerned with the `show_invites` page parameter
as they are no longer required.
2021-07-08 12:37:47 -07:00
Aman Agrawal 8b692943e7 css: Directly use `only-visible-for-spectaros` class to hide elements. 2021-07-08 12:33:56 -07:00
Aman Agrawal 4c0c067136 actions_popover: Hide irrelevant options for spectator. 2021-07-08 12:33:56 -07:00
Aman Agrawal 2e196fd5d3 compose: Restyle compose send button with logo colours.
Previous sea-green colour didn't meet the WCAG AA standard
guidelines for color contrast. This changes meets WCAG AAA
standard.
2021-07-08 12:06:55 -07:00
Ganesh Pawar 4df2fd2b61 hotkey: Disable hotkeys when a modal is open. 2021-07-08 12:04:19 -07:00
Anders Kaseorg dc1342825b Revert "compose: Convert pasted url to named link."
This reverts commit 5a61c9bb14 (#18849),
which had a number of bugs:

• It had a poor interaction with Ctrl+Shift+L resulting in double link
  formatting.
• It didn’t work at all in Firefox.
• It didn’t check whether what you’re pasting into is even a compose
  box.
• On pasting into the message edit box, it would throw “Error: Cannot
  read property 'text' of undefined”.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-07-08 12:00:22 -07:00
Priyam Seth ca54997767 compose: Fix the color or expand/collapse compose box in night mode.
Follow-up: #17667
2021-07-08 11:33:37 -07:00
sahil839 91d2960252 confirm_dialog: Disable the cancel button also while loading.
We disable the cancel button of dialog while loading because
the action cannot be cancelled even afer clicking cancel.
2021-07-08 09:43:32 -07:00
sahil839 6b995050b0 confirm_dialog: Fix loading spinner in confirm button in night mode.
We change the color of loading indicator to black only if we are not
using night mode, and in night mode indicator remains white.
2021-07-08 09:43:32 -07:00
sahil839 cd333cf157 message_edit: Fix loading spinner in message-edit button in night mode.
We change the color of loading indicator to black only if we are not
using night mode, and in night mode indicator remains white.
2021-07-08 09:43:32 -07:00
sahil839 a3f7639af3 settings: Extract code for checking night-mode setting.
We extract the code for checking night mode setting on
the basis of color_scheme value and using matchMedia when
color_scheme is set to automatic. This is currently used
in rendering the correct logo only.

This is a prep commit for fixing loading indicator not
visible on message-edit button in night-mode.
2021-07-08 09:43:32 -07:00
Steve Howell 8ffe22fc15 slash commands: Remove /settings command.
It's easy enough for power keyboard users to just use "g"
to get to settings, and it's certainly easier for
mouse users to just go to the menu.
2021-07-08 10:47:52 -04:00
Dinesh 5f684bf119 markdown: Change timezone to time zone in <time> tooltip.
This makes it consistent with the second line.
2021-07-08 10:10:11 -04:00
Tim Abbott c61a42615c Revert "stream_sidebar_row: Use tooltips for showing stream name on hover."
This reverts commit be240c2820.

This commit didn't get a positive reception on chat.zulip.org.
2021-07-07 21:20:15 -07:00
Tim Abbott 718caf453e move_topic_model: Fix the line-height of dropdown-toggle button.
Our dropdown-toggle buttons are meant to have the same size as select
elements, but looked weird if you selected a stream with non-English
characters in its name.

We fix this by copying some styling details settings from our common
input/select styling.

Fixes #18479.
2021-07-07 17:46:24 -07:00
Tim Abbott 98b5f01d14 third: Prevent typeahead from going off top of screen.
This is by no means the ideal solution, since we are likely to occlude
your cursor, but it prevents the user experience from being clearly
broken.
2021-07-07 16:47:30 -07:00
Signior-X 6cf33c4275 compose: Add support for full size compose box.
This commit makes a working toggler in compose_actions that adds the
compose-fullscreen class to the compose that removes the max-height
from the compose textarea and adds flex elements above so that the
height automatically adjust with the device height. This results in
making the compose box full screen sized.

The compose_height.js maintains the state of the height of the compose
box. Also, when the compose box is closed, the compose box is reset to
it's default behaviour and original height. So, everytime user need
not toggle off the compose full size and only for specific message
it is used.

It also adds destroy autosize on compose_height state change.
It destroys the autosize of textarea when the full
screen sized compose box is toggled on. And everytime when it is
turned off, it reinitialises the autosize. This also adds a
condition in autosize_textarea to only autosize when composebox
is not in full height state.

Fixes #17660
2021-07-07 16:47:30 -07:00
Tim Abbott 739ee1d15f templates: Improve labels for the edit stream name modal. 2021-07-07 16:13:50 -07:00
Anders Kaseorg 83120f218b compose: Don’t convert absolute upload URLs to relative.
Especially not by trying to edit markdown with a context-ignorant
unescaped regexp.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-07-07 15:41:52 -07:00
Anders Kaseorg e0f4013b21 upload: Don’t convert relative upload URLs to absolute.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2021-07-07 15:41:52 -07:00